fix(portal-shell): rename teacher leave GraphQL ops to resolve duplicate declarations
Rename teacher-domain leave operations to avoid name collisions with parent-domain operations in __generated__/operations.ts: - GetLeaveRequests -> GetTeacherLeaveRequests - ApproveLeave -> TeacherApproveLeave - RejectLeave -> TeacherRejectLeave Update MSW mock cases in graphql-data.ts to match the new operation names. Student-domain acceptance (§9.2) verified: typecheck/lint/tokens clean for student code, 9/9 student vitest tests pass. Pre-existing CreateGrade/GetSchedulingRules duplicates belong to admin/teacher domains and are out of student-domain scope (§14.2).
This commit is contained in:
@@ -13,7 +13,7 @@ import { gql } from "@apollo/client";
|
|||||||
// 页面通过 MSW 兜底获取列表数据,后端补齐后切换 fetcher 指向真实查询
|
// 页面通过 MSW 兜底获取列表数据,后端补齐后切换 fetcher 指向真实查询
|
||||||
// 契约工单:classes_contract.md#leave-requests-list
|
// 契约工单:classes_contract.md#leave-requests-list
|
||||||
export const GET_TEACHER_LEAVE_REQUESTS_DOC = gql`
|
export const GET_TEACHER_LEAVE_REQUESTS_DOC = gql`
|
||||||
query GetLeaveRequests(
|
query GetTeacherLeaveRequests(
|
||||||
$classId: ID
|
$classId: ID
|
||||||
$studentId: ID
|
$studentId: ID
|
||||||
$status: String
|
$status: String
|
||||||
@@ -56,7 +56,7 @@ export const GET_TEACHER_LEAVE_REQUESTS_DOC = gql`
|
|||||||
// 页面通过 MSW 兜底提交,后端补齐 mutation 后切换 fetcher
|
// 页面通过 MSW 兜底提交,后端补齐 mutation 后切换 fetcher
|
||||||
// 契约工单:classes_contract.md#approve-leave
|
// 契约工单:classes_contract.md#approve-leave
|
||||||
export const TEACHER_APPROVE_LEAVE_DOC = gql`
|
export const TEACHER_APPROVE_LEAVE_DOC = gql`
|
||||||
mutation ApproveLeave($input: ApproveLeaveInput!) {
|
mutation TeacherApproveLeave($input: ApproveLeaveInput!) {
|
||||||
approveLeave(input: $input) {
|
approveLeave(input: $input) {
|
||||||
id
|
id
|
||||||
status
|
status
|
||||||
@@ -67,7 +67,7 @@ export const TEACHER_APPROVE_LEAVE_DOC = gql`
|
|||||||
// 拒绝请假:schema 无 Mutation 类型 → MSW 兜底
|
// 拒绝请假:schema 无 Mutation 类型 → MSW 兜底
|
||||||
// 契约工单:classes_contract.md#reject-leave
|
// 契约工单:classes_contract.md#reject-leave
|
||||||
export const TEACHER_REJECT_LEAVE_DOC = gql`
|
export const TEACHER_REJECT_LEAVE_DOC = gql`
|
||||||
mutation RejectLeave($input: RejectLeaveInput!) {
|
mutation TeacherRejectLeave($input: RejectLeaveInput!) {
|
||||||
rejectLeave(input: $input) {
|
rejectLeave(input: $input) {
|
||||||
id
|
id
|
||||||
status
|
status
|
||||||
|
|||||||
@@ -6627,8 +6627,8 @@ export function graphqlResponse(
|
|||||||
// schema 无 leaveRequests(...) 根字段 → 全部走 MSW 兜底
|
// schema 无 leaveRequests(...) 根字段 → 全部走 MSW 兜底
|
||||||
// 契约工单:docs/architecture/issues/contracts/classes_contract.md#leave
|
// 契约工单:docs/architecture/issues/contracts/classes_contract.md#leave
|
||||||
//
|
//
|
||||||
// GetLeaveRequests($classId, $studentId, $status, $q):列表查询
|
// GetTeacherLeaveRequests($classId, $studentId, $status, $q):列表查询
|
||||||
case "GetLeaveRequests": {
|
case "GetTeacherLeaveRequests": {
|
||||||
const classId = variables?.classId as string | undefined;
|
const classId = variables?.classId as string | undefined;
|
||||||
const studentId = variables?.studentId as string | undefined;
|
const studentId = variables?.studentId as string | undefined;
|
||||||
const status = variables?.status as string | undefined;
|
const status = variables?.status as string | undefined;
|
||||||
@@ -6653,8 +6653,8 @@ export function graphqlResponse(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// ApproveLeave($input):审批请假 mutation 兜底
|
// TeacherApproveLeave($input):审批请假 mutation 兜底
|
||||||
case "ApproveLeave": {
|
case "TeacherApproveLeave": {
|
||||||
const input = (variables?.input ?? {}) as Record<string, unknown>;
|
const input = (variables?.input ?? {}) as Record<string, unknown>;
|
||||||
const id = (input.id as string) ?? "";
|
const id = (input.id as string) ?? "";
|
||||||
return {
|
return {
|
||||||
@@ -6663,8 +6663,8 @@ export function graphqlResponse(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// RejectLeave($input):拒绝请假 mutation 兜底
|
// TeacherRejectLeave($input):拒绝请假 mutation 兜底
|
||||||
case "RejectLeave": {
|
case "TeacherRejectLeave": {
|
||||||
const input = (variables?.input ?? {}) as Record<string, unknown>;
|
const input = (variables?.input ?? {}) as Record<string, unknown>;
|
||||||
const id = (input.id as string) ?? "";
|
const id = (input.id as string) ?? "";
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user