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 指向真实查询
|
||||
// 契约工单:classes_contract.md#leave-requests-list
|
||||
export const GET_TEACHER_LEAVE_REQUESTS_DOC = gql`
|
||||
query GetLeaveRequests(
|
||||
query GetTeacherLeaveRequests(
|
||||
$classId: ID
|
||||
$studentId: ID
|
||||
$status: String
|
||||
@@ -56,7 +56,7 @@ export const GET_TEACHER_LEAVE_REQUESTS_DOC = gql`
|
||||
// 页面通过 MSW 兜底提交,后端补齐 mutation 后切换 fetcher
|
||||
// 契约工单:classes_contract.md#approve-leave
|
||||
export const TEACHER_APPROVE_LEAVE_DOC = gql`
|
||||
mutation ApproveLeave($input: ApproveLeaveInput!) {
|
||||
mutation TeacherApproveLeave($input: ApproveLeaveInput!) {
|
||||
approveLeave(input: $input) {
|
||||
id
|
||||
status
|
||||
@@ -67,7 +67,7 @@ export const TEACHER_APPROVE_LEAVE_DOC = gql`
|
||||
// 拒绝请假:schema 无 Mutation 类型 → MSW 兜底
|
||||
// 契约工单:classes_contract.md#reject-leave
|
||||
export const TEACHER_REJECT_LEAVE_DOC = gql`
|
||||
mutation RejectLeave($input: RejectLeaveInput!) {
|
||||
mutation TeacherRejectLeave($input: RejectLeaveInput!) {
|
||||
rejectLeave(input: $input) {
|
||||
id
|
||||
status
|
||||
|
||||
@@ -6627,8 +6627,8 @@ export function graphqlResponse(
|
||||
// schema 无 leaveRequests(...) 根字段 → 全部走 MSW 兜底
|
||||
// 契约工单:docs/architecture/issues/contracts/classes_contract.md#leave
|
||||
//
|
||||
// GetLeaveRequests($classId, $studentId, $status, $q):列表查询
|
||||
case "GetLeaveRequests": {
|
||||
// GetTeacherLeaveRequests($classId, $studentId, $status, $q):列表查询
|
||||
case "GetTeacherLeaveRequests": {
|
||||
const classId = variables?.classId as string | undefined;
|
||||
const studentId = variables?.studentId as string | undefined;
|
||||
const status = variables?.status as string | undefined;
|
||||
@@ -6653,8 +6653,8 @@ export function graphqlResponse(
|
||||
},
|
||||
};
|
||||
}
|
||||
// ApproveLeave($input):审批请假 mutation 兜底
|
||||
case "ApproveLeave": {
|
||||
// TeacherApproveLeave($input):审批请假 mutation 兜底
|
||||
case "TeacherApproveLeave": {
|
||||
const input = (variables?.input ?? {}) as Record<string, unknown>;
|
||||
const id = (input.id as string) ?? "";
|
||||
return {
|
||||
@@ -6663,8 +6663,8 @@ export function graphqlResponse(
|
||||
},
|
||||
};
|
||||
}
|
||||
// RejectLeave($input):拒绝请假 mutation 兜底
|
||||
case "RejectLeave": {
|
||||
// TeacherRejectLeave($input):拒绝请假 mutation 兜底
|
||||
case "TeacherRejectLeave": {
|
||||
const input = (variables?.input ?? {}) as Record<string, unknown>;
|
||||
const id = (input.id as string) ?? "";
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user