150 lines
3.7 KiB
TypeScript
150 lines
3.7 KiB
TypeScript
export const SERVICE_CATEGORIES = [
|
|
'OLD_AGE',
|
|
'WOMEN',
|
|
'CHILD',
|
|
'DISABILITY',
|
|
'LIFE_DIFFICULTY',
|
|
'OTHER',
|
|
] as const;
|
|
export type ServiceCategory = (typeof SERVICE_CATEGORIES)[number];
|
|
|
|
export const APPLICATION_APPLY_MODES = [
|
|
'SELF',
|
|
'FAMILY',
|
|
'COMMUNITY',
|
|
'VOLUNTEER',
|
|
'OTHER',
|
|
] as const;
|
|
export type ApplicationApplyMode = (typeof APPLICATION_APPLY_MODES)[number];
|
|
|
|
export const SERVICE_APPLICATION_STATUSES = [
|
|
'SUBMITTED',
|
|
'PENDING_CONTACT',
|
|
'ASSESSING',
|
|
'REJECTED',
|
|
'OUT_OF_SCOPE',
|
|
'REFERRED',
|
|
'ACCEPTED',
|
|
'SERVICE_PLANNED',
|
|
'IN_SERVICE',
|
|
'SERVICE_COMPLETED',
|
|
'FOLLOW_UP_PENDING',
|
|
'CLOSED',
|
|
'CANCELLED',
|
|
'SUSPENDED',
|
|
] as const;
|
|
export type ServiceApplicationStatus = (typeof SERVICE_APPLICATION_STATUSES)[number];
|
|
|
|
export const SERVICE_CATEGORY_LABELS: Record<ServiceCategory, string> = {
|
|
OLD_AGE: '关爱老人',
|
|
WOMEN: '困境妇女',
|
|
CHILD: '儿童关爱',
|
|
DISABILITY: '残障帮扶',
|
|
LIFE_DIFFICULTY: '生活困难',
|
|
OTHER: '其他服务',
|
|
};
|
|
|
|
export const APPLICATION_APPLY_MODE_LABELS: Record<ApplicationApplyMode, string> = {
|
|
SELF: '为自己申请',
|
|
FAMILY: '帮家人申请',
|
|
COMMUNITY: '社区或机构代办',
|
|
VOLUNTEER: '志愿者代办',
|
|
OTHER: '其他代办',
|
|
};
|
|
|
|
export const SERVICE_APPLICATION_STATUS_LABELS: Record<ServiceApplicationStatus, string> = {
|
|
SUBMITTED: '已提交',
|
|
PENDING_CONTACT: '工作人员正在联系',
|
|
ASSESSING: '需求评估中',
|
|
REJECTED: '暂未通过',
|
|
OUT_OF_SCOPE: '超出当前服务范围',
|
|
REFERRED: '已协助转介',
|
|
ACCEPTED: '已受理',
|
|
SERVICE_PLANNED: '服务安排中',
|
|
IN_SERVICE: '服务进行中',
|
|
SERVICE_COMPLETED: '服务已完成',
|
|
FOLLOW_UP_PENDING: '等待回访',
|
|
CLOSED: '服务已结束',
|
|
CANCELLED: '申请已取消',
|
|
SUSPENDED: '服务暂缓',
|
|
};
|
|
|
|
export interface ServiceCategoryOption {
|
|
code: ServiceCategory;
|
|
label: string;
|
|
description: string;
|
|
}
|
|
|
|
export interface ServiceCategoriesResponse {
|
|
items: ServiceCategoryOption[];
|
|
}
|
|
|
|
export interface CreateServiceApplicationRequest {
|
|
clientRequestId: string;
|
|
serviceCategory: ServiceCategory;
|
|
applyMode: ApplicationApplyMode;
|
|
beneficiaryName: string;
|
|
contactMobile: string;
|
|
regionCode: string;
|
|
description: string;
|
|
preferredContactTime?: string;
|
|
needsHomeVisit?: boolean;
|
|
mobilityDifficulty?: boolean;
|
|
privacyConsent: true;
|
|
}
|
|
|
|
export interface ServiceApplicationHistoryItem {
|
|
status: ServiceApplicationStatus;
|
|
statusLabel: string;
|
|
reasonLabel: string;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface ServiceApplicationListItem {
|
|
publicId: string;
|
|
applicationNo: string;
|
|
serviceCategory: ServiceCategory;
|
|
serviceCategoryLabel: string;
|
|
applyMode: ApplicationApplyMode;
|
|
applyModeLabel: string;
|
|
beneficiaryName: string;
|
|
contactMobileMasked: string;
|
|
regionCode: string;
|
|
status: ServiceApplicationStatus;
|
|
statusLabel: string;
|
|
submittedAt: string;
|
|
}
|
|
|
|
export interface ServiceApplicationDetail extends ServiceApplicationListItem {
|
|
contactMobile: string;
|
|
description: string;
|
|
preferredContactTime: string | null;
|
|
needsHomeVisit: boolean | null;
|
|
mobilityDifficulty: boolean | null;
|
|
history: ServiceApplicationHistoryItem[];
|
|
}
|
|
|
|
export interface CreateServiceApplicationResponse {
|
|
application: ServiceApplicationDetail;
|
|
idempotentReplay: boolean;
|
|
}
|
|
|
|
export interface PaginatedServiceApplicationsResponse {
|
|
items: ServiceApplicationListItem[];
|
|
page: number;
|
|
pageSize: number;
|
|
total: number;
|
|
}
|
|
|
|
export interface ServiceApplicationDetailResponse {
|
|
application: ServiceApplicationDetail;
|
|
}
|
|
|
|
export interface AdminServiceApplicationQuery {
|
|
page?: number;
|
|
pageSize?: number;
|
|
applicationNo?: string;
|
|
serviceCategory?: ServiceCategory;
|
|
status?: ServiceApplicationStatus;
|
|
}
|