更新
This commit is contained in:
+109
-3
@@ -376,6 +376,8 @@ export function getMsgAuditPermitUsers() {
|
||||
export interface PrescriptionEsignConfig {
|
||||
enabled: boolean
|
||||
environment: 'sandbox' | 'production'
|
||||
verification_method?: 'sms' | 'quick'
|
||||
review_enabled?: boolean
|
||||
}
|
||||
|
||||
export interface PrescriptionEsignStatus extends PrescriptionEsignConfig {
|
||||
@@ -384,7 +386,19 @@ export interface PrescriptionEsignStatus extends PrescriptionEsignConfig {
|
||||
status_label: string
|
||||
can_sign: boolean
|
||||
can_download: boolean
|
||||
can_resume_identity?: boolean
|
||||
doctor_identity_required?: boolean
|
||||
signing_authorization_required?: boolean
|
||||
signing_authorization_reason?: 'missing' | 'expired' | 'exhausted' | 'invalid'
|
||||
sms_sent?: boolean
|
||||
can_retry_verify?: boolean
|
||||
message: string
|
||||
issued_at?: number
|
||||
signature_time?: number
|
||||
signature_time_source?: 'tsa' | 'local' | ''
|
||||
review_signer_name?: string
|
||||
review_signature_time?: number
|
||||
signed_at?: number
|
||||
auth_url?: string
|
||||
}
|
||||
|
||||
@@ -394,6 +408,57 @@ export interface PrescriptionEsignFile {
|
||||
sha256: string
|
||||
}
|
||||
|
||||
export interface PrescriptionEsignReviewStatus {
|
||||
required: boolean
|
||||
state: 'pending' | 'signing' | 'verifying' | 'signed' | 'failed' | 'uncertain'
|
||||
can_confirm: boolean
|
||||
can_retry_verify: boolean
|
||||
can_approve: boolean
|
||||
can_setup: boolean
|
||||
actor_id: number
|
||||
actor_name: string
|
||||
signer_name: string
|
||||
signature_time: number
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface PrescriptionEsignReviewTarget {
|
||||
id: number
|
||||
order_id?: number
|
||||
}
|
||||
|
||||
export function prescriptionEsignReviewStatus(params: PrescriptionEsignReviewTarget, signal?: AbortSignal): Promise<PrescriptionEsignReviewStatus> {
|
||||
return request.get({ url: '/tcm.prescription/esignReviewStatus', params, signal },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
export function prescriptionEsignReviewConfirm(
|
||||
params: PrescriptionEsignReviewTarget & { actor_id: number; verify_only: boolean }
|
||||
): Promise<PrescriptionEsignReviewStatus> {
|
||||
return request.post({ url: '/tcm.prescription/esignReviewConfirm', params, timeout: 360000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
export interface PrescriptionEsignIdentityStatus extends PrescriptionEsignStatus {
|
||||
identity_status: 'INIT' | 'ING' | 'SUCCESS' | 'FAIL' | 'EXPIRED' | 'UNAVAILABLE'
|
||||
can_complete: boolean
|
||||
identity_details_required?: boolean
|
||||
}
|
||||
|
||||
export interface PrescriptionEsignDoctorStatus {
|
||||
enabled: boolean
|
||||
status: 'unbound' | 'needs_mobile' | 'renewal_required' | 'authenticating' | 'binding_required' | 'ready'
|
||||
cert_expires_at: number
|
||||
identity_details_required?: boolean
|
||||
quicksign_enabled?: boolean
|
||||
quicksign_authorizing?: boolean
|
||||
quicksign_expires_at?: number
|
||||
quicksign_remaining_times?: number
|
||||
quicksign_unavailable_reason?: '' | 'missing' | 'expired' | 'exhausted' | 'invalid'
|
||||
auth_url?: string
|
||||
message?: string
|
||||
}
|
||||
|
||||
export function prescriptionEsignConfig(): Promise<PrescriptionEsignConfig> {
|
||||
return request.get({ url: '/tcm.prescription/esignConfig' })
|
||||
}
|
||||
@@ -402,16 +467,57 @@ export function prescriptionEsignStatus(params: { id: number }): Promise<Prescri
|
||||
return request.get({ url: '/tcm.prescription/esignStatus', params })
|
||||
}
|
||||
|
||||
export function prescriptionEsignStart(params: { id: number }): Promise<PrescriptionEsignStatus> {
|
||||
/** Read-only identity readiness; this endpoint never submits a signature. */
|
||||
export function prescriptionEsignIdentityStatus(params: { id: number }, signal?: AbortSignal): Promise<PrescriptionEsignIdentityStatus> {
|
||||
return request.get(
|
||||
{ url: '/tcm.prescription/esignIdentityStatus', params, signal, timeout: 15000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true }
|
||||
)
|
||||
}
|
||||
|
||||
export function prescriptionEsignStart(params: { id: number; restart_identity?: true }): Promise<PrescriptionEsignStatus> {
|
||||
return request.post(
|
||||
{ url: '/tcm.prescription/esignStart', params, timeout: 180000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true }
|
||||
)
|
||||
}
|
||||
|
||||
export function prescriptionEsignComplete(params: { id: number }): Promise<PrescriptionEsignStatus> {
|
||||
export function prescriptionEsignVerifyWillingness(params: { id: number; auth_code: string }): Promise<PrescriptionEsignIdentityStatus> {
|
||||
return request.post(
|
||||
{ url: '/tcm.prescription/esignComplete', params, timeout: 180000 },
|
||||
{ url: '/tcm.prescription/esignVerifyWillingness', params, timeout: 60000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true }
|
||||
)
|
||||
}
|
||||
|
||||
export function prescriptionEsignDoctorStatus(signal?: AbortSignal): Promise<PrescriptionEsignDoctorStatus> {
|
||||
return request.get(
|
||||
{ url: '/tcm.prescription/esignDoctorStatus', signal, timeout: 15000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true }
|
||||
)
|
||||
}
|
||||
|
||||
export function prescriptionEsignDoctorStart(params: { mobile?: string }): Promise<PrescriptionEsignDoctorStatus> {
|
||||
return request.post(
|
||||
{ url: '/tcm.prescription/esignDoctorStart', params, timeout: 180000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true }
|
||||
)
|
||||
}
|
||||
|
||||
export function prescriptionEsignDoctorComplete(params: { identity_number?: string }): Promise<PrescriptionEsignDoctorStatus> {
|
||||
return request.post(
|
||||
{ url: '/tcm.prescription/esignDoctorComplete', params, timeout: 180000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true }
|
||||
)
|
||||
}
|
||||
|
||||
export function prescriptionEsignComplete(params: { id: number } & (
|
||||
{ verify_only: true; identity_number?: never } | { verify_only?: never; identity_number?: string }
|
||||
)): Promise<PrescriptionEsignStatus> {
|
||||
const payload = { id: params.id }
|
||||
if (params.verify_only) Object.assign(payload, { verify_only: true })
|
||||
else if (params.identity_number !== undefined) Object.assign(payload, { identity_number: params.identity_number })
|
||||
return request.post(
|
||||
{ url: '/tcm.prescription/esignComplete', params: payload, timeout: 180000 },
|
||||
{ isOpenRetry: false, retryCount: 0, ignoreCancelToken: true }
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user