Skip to content

Commit

Permalink
Merge pull request #50 from oaknational/feat/pupil-1017/add-pathways
Browse files Browse the repository at this point in the history
feat: adding pathways but excluding by keystage
  • Loading branch information
kimon-satan authored Oct 2, 2024
2 parents af69ab3 + fe7f6a2 commit 8041b55
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/fixtures/programmeFields.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export const programmeFieldsFixture = ({
tier_slug: null,
tier_description: null,
tier_display_order: null,
pathway: null,
pathway_id: null,
pathway_slug: null,
pathway_description: null,
pathway_display_order: null,
examboard: null,
examboard_id: null,
examboard_slug: null,
Expand Down
4 changes: 4 additions & 0 deletions src/schema/base.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export const tiers = z.enum(["core", "foundation", "higher"]);
export const tierSlugs = z.enum(["core", "foundation", "higher"]);
export const tierDescriptions = z.enum(["Core", "Foundation", "Higher"]);

export const pathways = z.enum(["Core", "GCSE"]);
export const pathwaySlugs = z.enum(["core", "gcse"]);
export const pathwayDescriptions = z.enum(["Core", "GCSE"]);

export const examboardSlugs = z.enum([
"aqa",
"edexcel",
Expand Down
9 changes: 9 additions & 0 deletions src/schema/programmeFields.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ import {
phaseDescriptions,
subjects,
subjectSlugs,
pathways,
pathwaySlugs,
pathwayDescriptions,
} from "./base.schema";

export const programmeFieldsSchema = z.object({
pathway: pathways.nullable(),
pathway_id: z.number().nullable(),
pathway_slug: pathwaySlugs.nullable(),
pathway_description: pathwayDescriptions.nullable(),
pathway_display_order: z.number().nullable(),

tier: tiers.nullable(),
tier_id: z.number().nullable(),
tier_slug: tierSlugs.nullable(),
Expand Down
8 changes: 8 additions & 0 deletions src/schema/syntheticUnitvariantLessonsByKs.schema.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { z } from "zod";
import { syntheticUnitvariantLessonsSchema } from "./syntheticUnitvariantLessons.schema";
import { unitvariantSchema } from "./unitvariant.schema";
import { programmeFieldsSchema } from "./programmeFields.schema";

export const syntheticUnitvariantLessonsByKsSchema = z.object({
...syntheticUnitvariantLessonsSchema.omit({ null_unitvariant_id: true })
.shape,
unitvariant_id: z.number().nullable(),
null_unitvariant: unitvariantSchema,
programme_fields: programmeFieldsSchema.omit({
pathway: true,
pathway_description: true,
pathway_display_order: true,
pathway_id: true,
pathway_slug: true,
}),
});

export type SyntheticUnitvariantLessonsByKs = z.infer<
Expand Down

0 comments on commit 8041b55

Please sign in to comment.