import { initContract } from '@ts-rest/core'; import { z } from 'zod'; import { errorResponseSchema } from '../schemas/common.schemas'; import { shopAlertPreferencesSchema, updateShopAlertPreferencesSchema, } from '../schemas/shopkeeper-settings.schemas'; const c = initContract(); export const shopkeeperSettingsContract = c.router({ getAlertPreferences: { method: 'GET', path: '/shopkeeper/settings/alert-preferences', responses: { 200: z.object({ preferences: shopAlertPreferencesSchema, defaults: shopAlertPreferencesSchema, }), 401: errorResponseSchema, }, summary: 'Get owner alert push and digest preferences', }, patchAlertPreferences: { method: 'PATCH', path: '/shopkeeper/settings/alert-preferences', body: updateShopAlertPreferencesSchema, responses: { 200: z.object({ preferences: shopAlertPreferencesSchema, defaults: shopAlertPreferencesSchema, }), 401: errorResponseSchema, }, summary: 'Update alert push and digest preferences (partial merge)', }, });