feat(M08-D): 补门店与房间管理
This commit is contained in:
@@ -6,6 +6,7 @@ import type {
|
||||
CleaningTaskEvent,
|
||||
CleaningTaskMember,
|
||||
BusinessStatistics,
|
||||
ManagedRoom,
|
||||
ManagedStore,
|
||||
ManagedUser,
|
||||
PageResult,
|
||||
@@ -14,6 +15,10 @@ import type {
|
||||
SettlementStatus,
|
||||
TaskStatus,
|
||||
TransferMode,
|
||||
RoomConfigurationStatus,
|
||||
RoomInput,
|
||||
RoomOperationalStatus,
|
||||
StoreInput,
|
||||
UserStatus,
|
||||
WechatTransferPreflight
|
||||
} from './types';
|
||||
@@ -38,6 +43,71 @@ export function listManagedStores(session: ApiSession) {
|
||||
return request<ManagedStore[]>(session, '/stores');
|
||||
}
|
||||
|
||||
export function createManagedStore(session: ApiSession, input: StoreInput) {
|
||||
return request<{ storeId: string }>(session, '/stores', {
|
||||
method: 'POST', body: JSON.stringify(input)
|
||||
});
|
||||
}
|
||||
|
||||
export function updateManagedStore(session: ApiSession, storeId: string, input: StoreInput) {
|
||||
return request<{ storeId: string }>(session, `/stores/${storeId}`, {
|
||||
method: 'PUT', body: JSON.stringify(input)
|
||||
});
|
||||
}
|
||||
|
||||
export function archiveManagedStore(session: ApiSession, storeId: string) {
|
||||
return request<{ storeId: string; archived: boolean }>(session, `/stores/${storeId}`, {
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
export function listManagedRooms(session: ApiSession, storeId: string) {
|
||||
return request<ManagedRoom[]>(session, `/stores/${storeId}/rooms`);
|
||||
}
|
||||
|
||||
export function createManagedRoom(session: ApiSession, input: RoomInput) {
|
||||
return request<{ roomId: string }>(session, '/rooms', {
|
||||
method: 'POST', body: JSON.stringify(input)
|
||||
});
|
||||
}
|
||||
|
||||
export function updateManagedRoom(session: ApiSession, roomId: string, input: RoomInput) {
|
||||
return request<{ roomId: string }>(session, `/rooms/${roomId}`, {
|
||||
method: 'PUT', body: JSON.stringify(input)
|
||||
});
|
||||
}
|
||||
|
||||
export function updateManagedRoomStatus(
|
||||
session: ApiSession,
|
||||
roomId: string,
|
||||
input: {
|
||||
storeId: string;
|
||||
configurationStatus?: RoomConfigurationStatus;
|
||||
operationalStatus?: RoomOperationalStatus;
|
||||
reason: string;
|
||||
}
|
||||
) {
|
||||
return request<{ roomId: string }>(session, `/rooms/${roomId}/status`, {
|
||||
method: 'PATCH', body: JSON.stringify(input)
|
||||
});
|
||||
}
|
||||
|
||||
export function archiveManagedRoom(session: ApiSession, roomId: string, storeId: string) {
|
||||
return request<{ roomId: string; archived: boolean }>(
|
||||
session, `/rooms/${roomId}?${new URLSearchParams({ storeId })}`, { method: 'DELETE' }
|
||||
);
|
||||
}
|
||||
|
||||
export function addManagedRoomDisabledPeriod(
|
||||
session: ApiSession,
|
||||
roomId: string,
|
||||
input: { storeId: string; startsAt: string; endsAt: string; reason: string }
|
||||
) {
|
||||
return request<{ disabledPeriodId: string }>(session, `/rooms/${roomId}/disabled-periods`, {
|
||||
method: 'POST', body: JSON.stringify(input)
|
||||
});
|
||||
}
|
||||
|
||||
export function getBusinessStatistics(
|
||||
session: ApiSession,
|
||||
input: { storeId: string; from: string; to: string }
|
||||
|
||||
Reference in New Issue
Block a user