{"openapi":"3.0.0","paths":{"/":{"get":{"operationId":"AppController_getHello","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["App"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/legacy-redirect/{e}":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nResolves the restaurant from `restaurantId` (or, for older QRs, from `branchId`) and 302-redirects to https://twlm.solutions/emenu/{restaurantId}. One of the two is required.","operationId":"AppController_getLegacyRedirect","parameters":[{"name":"restaurant_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"e","required":true,"in":"path","description":"Opaque segment carried over from the legacy QR URL. Ignored by the handler, but declared so the emitted OpenAPI document is valid — without it the spec fails client codegen.","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"summary":"Redirect a legacy branch QR to the restaurant e-menu","tags":["App"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/activity-log":{"get":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nFilter by date range, branch, category, status, code, actor, or subject. `subject_type` + `subject_id` (e.g. `order` + an order id) gives an entity its History tab. Each row carries `operation_count` and `failed_operation_count`; fetch one activity for its operations.","operationId":"ActivityLogController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"from","required":false,"in":"query","description":"Inclusive lower bound on `created_at`.","schema":{"format":"date-time","type":"string"}},{"name":"to","required":false,"in":"query","description":"Exclusive upper bound on `created_at`.","schema":{"format":"date-time","type":"string"}},{"name":"branch_ids","required":false,"in":"query","description":"Branch filter: CSV list or repeated key.","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"categories","required":false,"in":"query","description":"Category filter: CSV list or repeated key.","schema":{"type":"array","items":{"type":"string","enum":["ORDERS","PAYMENTS","INVENTORY","MENU","EMENU","CUSTOMERS","LOYALTY","STAFF","BRANCHES","FINANCE","BILLING","PLATFORM","SYSTEM","REPORTS"]}}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["SUCCEEDED","FAILED"]}},{"name":"code","required":false,"in":"query","description":"One activity code.","schema":{"type":"string","enum":["order.created","order.placed_online","order.delivery_app_received","order.delivery_app_dropped","order.delivery_app_status_updated","order.delivery_app_cancelled","order.delivery_app_cancel_requested","order.updated","order.items_added","order.item_updated","order.item_removed","order.sent_to_kitchen","order.status_updated","order.reviewed","order.kitchen_status_updated","order.cancelled","order.voided","order.deferred","order.return_created","order.refund_recorded","pager.created","pager.marked_ready","pager.called","pager.collected","pager.cancelled","table.session_opened","table.session_closed","order.payment_recorded","order.payment_added","order.payment_method_changed","customer_credit.settled","customer_credit.payment_link_created","online_payment.confirmed","online_payment.refunded","zatca.retry_swept","stock_item.created","stock_item.updated","stock_item.deactivated","stock_category.created","stock_category.updated","stock_category.deleted","unit_of_measure.created","unit_of_measure.updated","unit_of_measure.deactivated","inventory_location.created","inventory_location.updated","inventory_location.deactivated","inventory_settings.updated","recipe.created","recipe.updated","recipe.deleted","recipe.ingredient_added","recipe.ingredient_updated","recipe.ingredient_removed","option_value_effect.created","option_value_effect.updated","option_value_effect.deleted","supplier.created","supplier.updated","supplier.deactivated","supplier.item_added","supplier.item_updated","supplier.item_removed","purchase.created","purchase.updated","purchase.submitted","purchase.confirmed","purchase.received","purchase.posted","purchase.voided","purchase.cancelled","transfer.created","transfer.updated","transfer.submitted","transfer.approved","transfer.shipped","transfer.received","transfer.cancelled","inventory_count.created","inventory_count.item_added","inventory_count.started","inventory_count.submitted","inventory_count.approved","inventory_count.discarded","stock.adjusted","wastage_reason_code.created","wastage_reason_code.updated","wastage_entry.created","wastage_entry.updated","wastage_entry.submitted","wastage_entry.approved","wastage_entry.rejected","wastage_entry.posted","production_order.created","production_order.started","production_order.completed","production_order.posted","production_order.cancelled","order_posting.retried","order_posting.resolved","product.created","product.updated","product.deactivated","product.bulk_deactivated","product.variant_created","product.variant_updated","product.variant_deleted","product.option_groups_linked","product.option_group_unlinked","product.option_groups_reordered","product.branch_availability_updated","product.branch_availability_removed","product.variant_branch_availability_updated","product.variant_branch_availability_removed","product.prices_adjusted","product.prices_bulk_updated","product.imported","product.legacy_variants_cleaned","category.created","category.updated","category.deleted","category.reordered","category.branch_availability_added","category.branch_availability_removed","option_group.created","option_group.updated","option_group.deactivated","option_group.snoozed","option_group.sorted","option_value.created","option_value.updated","option_value.deleted","option_value.reordered","discount.created","discount.updated","discount.deleted","scale_barcode_format.created","scale_barcode_format.updated","scale_barcode_format.deleted","promotion.created","promotion.updated","promotion.deleted","price_override.set","price_override.removed","emenu.settings_updated","emenu.theme_applied","emenu.page_created","emenu.page_updated","emenu.page_deleted","reservation_config.updated","reservation_schedule.added","reservation_schedule.removed","reservation_schedule.applied_to_all_days","table_reservation.created","table_reservation.requested","table_reservation.updated","table_reservation.deleted","customer.created","customer.updated","customer.deleted","customer.account_deleted","customer.note_added","customer.note_deleted","gift_card.issued","gift_card.cancelled","gift_card.expired","gift_card_theme.created","gift_card_theme.updated","gift_card_theme.archived","loyalty_pass_theme.created","loyalty_pass_theme.updated","loyalty_pass_theme.archived","loyalty_pass_theme.unarchived","loyalty_pass.joined","loyalty_pass.stamps_added","loyalty_pass.redeemed","loyalty_pass.voided","loyalty_pass.unvoided","loyalty_pass.promotional_alert_sent","loyalty_pass.geolocation_message_updated","loyalty_pass_icon.created","loyalty_pass_icon.deleted","staff_member.added","staff_member.updated","staff_member.role_changed","staff_member.removed","staff_member.branch_assigned","staff_member.branch_unassigned","staff_member.permissions_updated","staff_member.availability_set","staff_member.availability_removed","staff_member.service_assigned","staff_member.service_unassigned","cashier_shift.opened","cashier_shift.closed","cashier_shift.reopened","cashier_shift.corrected","branch.created","branch.updated","branch.deleted","order_field.created","order_field.updated","order_field.deactivated","delivery_zone.created","delivery_zone.updated","delivery_zone.deleted","delivery_settings.updated","dining_table.created","dining_table.updated","dining_table.deleted","table_group.created","table_group.updated","table_group.deleted","printer.created","printer.updated","printer.deleted","printer.duplicated","printer.categories_updated","printer.category_linked","printer.category_unlinked","customer_display.paired","customer_display.renamed","customer_display.revoked","ordering_channel.created","ordering_channel.updated","ordering_channel.deleted","ordering_channel.branch_linked","ordering_channel.branch_unlinked","channel_commission.set","channel_commission.removed","payment_method.created","payment_method.updated","payment_method.deleted","payment_provider.connected","payment_provider.updated","payment_provider.disconnected","restaurant_settings.updated","restaurant_settings.invoice_counter_reset","zatca.csr_generated","zatca.compliance_csid_requested","zatca.compliance_checks_run","zatca.production_csid_requested","zatca.production_csid_renewed","zatca.unlinked","service_booking.created","service_booking.updated","service_booking.cancelled","expense.created","expense.updated","expense.paid","expense.cancelled","expense.attachment_added","expense.attachment_removed","expense_category.created","expense_category.updated","expense_category.deleted","recurring_expense.created","recurring_expense.updated","recurring_expense.deleted","report.exported","offline_sync.batch_received","offline_sync.issue_resolved","offline_sync.action_settled","subscription.payment_started","subscription.change_purchase_started","subscription.updated","marketplace.trial_started","marketplace.purchase_started","marketplace.app_granted","marketplace.app_revoked","loyalty.points_expired","recurring_expenses.generated","subscriptions.expired"]}},{"name":"actor_id","required":false,"in":"query","description":"User or customer id of whoever acted.","schema":{"maxLength":80,"type":"string"}},{"name":"subject_type","required":false,"in":"query","description":"Use with `subject_id` for a History tab.","schema":{"maxLength":40,"example":"order","type":"string"}},{"name":"subject_id","required":false,"in":"query","schema":{"maxLength":80,"type":"string"}},{"name":"group","required":false,"in":"query","description":"Fold related edits into their newest row: the same person editing the same thing, each within two minutes of the next. The folded rows ride along under `group`.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityListResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires RESTAURANT_ADMIN."}},"security":[{"Bearer":[]}],"summary":"List activities, newest first","tags":["Activity Log"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/activity-log/{activityId}":{"get":{"operationId":"ActivityLogController_get","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"activityId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires RESTAURANT_ADMIN."},"404":{"description":"No such activity in this restaurant."}},"security":[{"Bearer":[]}],"summary":"One activity with the operations it caused","tags":["Activity Log"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/auth/register":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nCreates a user account with the default `STAFF` global role and returns access + refresh tokens.","operationId":"AuthController_register","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponseDto"}}}},"201":{"description":"User registered; returns tokens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponseDto"}}}},"400":{"description":"Missing required login fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"409":{"description":"Email already in use","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Self-register a new platform user","tags":["Auth"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/auth/login":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nWhen `accountNumber` is provided in the body, authenticates against that restaurant. When omitted, authenticates as a platform super admin.","operationId":"AuthController_login","parameters":[{"name":"x-fcm-token","required":false,"in":"header","description":"Firebase Cloud Messaging device token. Registered for push notifications against the branch from `x-branch-id`, falling back to the session branch when that header is absent. Omitting it (e.g. web logins) is safe — the login still succeeds.","schema":{"type":"string"}},{"name":"x-branch-id","required":false,"in":"header","description":"Branch the device should receive push notifications for. Ignored unless `x-fcm-token` is also sent, and must be one of the caller’s accessible branches. When omitted, the branch of the issued session is used (multi-branch restaurant admins should send it explicitly).","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}}},"responses":{"200":{"description":"Authenticated; returns tokens (and accessible branches for restaurant logins). For accounts with two-factor sign-in, returns only `mfa` — finish via `/auth/mfa/*`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"No restaurant membership (restaurant flow) or not a platform admin (super-admin flow)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Unified login (restaurant staff/admin or super admin)","tags":["Auth"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/auth/customer/request-otp":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nGenerates and dispatches an OTP to the supplied phone number for the given restaurant. Rate-limited to 5 requests/minute per IP.","operationId":"AuthController_customerRequestOtp","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerRequestOtpDto"}}}},"responses":{"200":{"description":"OTP request accepted (SMS delivery is async).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpRequestedResponseDto"}}}},"400":{"description":"Missing required login fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"Too many OTP requests from this IP; try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Request a one-time password for a customer phone number","tags":["Auth"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/auth/customer/login":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nUpserts a customer by phone number and issues tokens. Provide `name` and `email` on first call — they are only stored during account creation. OTP verification is not required in this phase; it will be added in a future release.","operationId":"AuthController_customerLogin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerLoginDto"}}}},"responses":{"200":{"description":"Customer authenticated; returns tokens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponseDto"}}}},"400":{"description":"Missing required login fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Customer account is deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Customer phone login / auto-register","tags":["Auth"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/auth/refresh":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nRotates the refresh token: the old one is revoked and a new pair is issued.","operationId":"AuthController_refresh","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenDto"}}}},"responses":{"200":{"description":"New access and refresh tokens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponseDto"}}}},"400":{"description":"Missing required login fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Exchange a refresh token for new access and refresh tokens","tags":["Auth"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/auth/forgot-password":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nSends a 6-digit reset code to the email when an active staff account exists. Always returns `{ sent: true }` to prevent email enumeration. Rate-limited to 5 requests/minute per IP.","operationId":"AuthController_forgotPassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordDto"}}}},"responses":{"200":{"description":"Reset request accepted (email delivery is async).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpRequestedResponseDto"}}}},"400":{"description":"Missing required login fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"Too many reset requests from this IP; try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Request a staff password reset code","tags":["Auth"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/auth/reset-password":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nVerifies the reset code, updates the password, and revokes all refresh tokens. Returns generic invalid-credentials on failure.","operationId":"AuthController_resetPassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordDto"}}}},"responses":{"204":{"description":"Password reset; all sessions revoked."},"400":{"description":"Missing required login fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Reset staff password with email and code","tags":["Auth"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/auth/change-password":{"post":{"description":"Requires a staff JWT. Verifies the current password, updates to the new password, and revokes all refresh tokens.","operationId":"AuthController_changePassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordDto"}}}},"responses":{"204":{"description":"Password changed; all sessions revoked."},"400":{"description":"Missing required login fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Not authenticated or current password incorrect","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Staff session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Change staff password (authenticated)","tags":["Auth"]}},"/auth/system-admin/restaurant-session":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nMints access + refresh tokens as the oldest active RESTAURANT_ADMIN for the restaurant. Used by the system-admin console to open POS already authenticated.","operationId":"AuthController_issueRestaurantSession","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueRestaurantSessionDto"}}}},"responses":{"200":{"description":"STAFF manager session (same shape as restaurant login).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponseDto"}}}},"400":{"description":"Invalid body or branch_id not in restaurant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Requires SUPER_ADMIN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Restaurant missing, or no active RESTAURANT_ADMIN membership","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Issue a restaurant manager STAFF session (SUPER_ADMIN)","tags":["Auth"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/verify":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nTrade the login ticket plus one proof for a session. TOTP / RECOVERY_CODE send `code`; PASSKEY sends `credential` after `POST /auth/mfa/passkey/options`. Five tries per ticket; ten failures in 15 minutes lock the account for the rest of that window.","operationId":"MfaController_verify","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaVerifyDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaSessionResponseDto"}}}},"401":{"description":"AUTH_MFA_INVALID (wrong proof) or AUTH_MFA_TICKET_INVALID (restart login)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"AUTH_MFA_LOCKED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Complete an MFA login","tags":["Auth MFA"],"x-authorization":{"isPublic":true,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/passkey/options":{"post":{"operationId":"MfaController_passkeyLoginOptions","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaTicketDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptionsResponseDto"}}}}},"summary":"WebAuthn assertion options for an MFA login ticket","tags":["Auth MFA"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/enroll/totp":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns a fresh secret and `otpauth://` URL to render as a QR code.","operationId":"MfaController_enrollTotp","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaTicketDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpSetupResponseDto"}}}}},"summary":"Start mandatory TOTP enrollment (ENROLLMENT_REQUIRED ticket)","tags":["Auth MFA"],"x-authorization":{"isPublic":true,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/enroll/totp/confirm":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns the session plus recovery codes — shown once.","operationId":"MfaController_confirmEnrollTotp","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnrollConfirmDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaSessionResponseDto"}}}}},"summary":"Confirm mandatory TOTP enrollment and sign in","tags":["Auth MFA"],"x-authorization":{"isPublic":true,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa":{"get":{"operationId":"MfaController_status","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaStatusResponseDto"}}}}},"summary":"My two-factor settings","tags":["Auth MFA"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/totp":{"post":{"operationId":"MfaController_beginTotp","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpSetupResponseDto"}}}},"409":{"description":"AUTH_MFA_ALREADY_ENABLED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Start authenticator-app setup","tags":["Auth MFA"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}},"delete":{"operationId":"MfaController_disableTotp","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaPasswordDto"}}}},"responses":{"204":{"description":""},"409":{"description":"AUTH_MFA_LAST_FACTOR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Remove the authenticator app (password required)","tags":["Auth MFA"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/totp/confirm":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)\n\nWhen this is the first factor, every other session is signed out and `session` carries replacement tokens.","operationId":"MfaController_confirmTotp","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaTotpConfirmDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorAddedResponseDto"}}}}},"summary":"Confirm authenticator-app setup (password required)","tags":["Auth MFA"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/passkeys/options":{"post":{"operationId":"MfaController_passkeyRegistrationOptions","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptionsResponseDto"}}}}},"summary":"WebAuthn registration options for a new passkey","tags":["Auth MFA"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/passkeys":{"post":{"operationId":"MfaController_registerPasskey","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyRegisterDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorAddedResponseDto"}}}}},"summary":"Register a passkey (password required)","tags":["Auth MFA"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/passkeys/{id}":{"delete":{"operationId":"MfaController_removePasskey","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaPasswordDto"}}}},"responses":{"204":{"description":""},"409":{"description":"AUTH_MFA_LAST_FACTOR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Remove a passkey (password required)","tags":["Auth MFA"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/recovery-codes":{"post":{"operationId":"MfaController_regenerateRecoveryCodes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaPasswordDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodesResponseDto"}}}}},"summary":"Replace recovery codes (password required)","tags":["Auth MFA"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/auth/mfa/users/{userId}":{"delete":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)\n\nFor a lost device: removes all factors and recovery codes and signs the admin out everywhere.","operationId":"MfaController_resetForUser","parameters":[{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaPasswordDto"}}}},"responses":{"204":{"description":""}},"summary":"Reset another admin's two-factor sign-in (SUPER_ADMIN, password required)","tags":["Auth MFA"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/branches/{branchId}/customer-displays":{"get":{"operationId":"CustomerDisplaysController_list","parameters":[{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerDisplayResponseDto"}}}}}},"summary":"List the branch's paired customer displays","tags":["Customer Displays"],"description":"**Access:** ![Permission: read:customer_displays:branch](https://img.shields.io/badge/Permission-read%3Acustomer__displays%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customer_displays:branch"]}},"post":{"description":"**Access:** ![Permission: manage:customer_displays:branch](https://img.shields.io/badge/Permission-manage%3Acustomer__displays%3Abranch-green)\n\nClaims the pairing code for this branch. The monitor then collects its display token on its next poll of `POST /customer-display/pairings/:pairingId/collect`.","operationId":"CustomerDisplaysController_claim","parameters":[{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimCustomerDisplayDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDisplayResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDisplayResponseDto"}}}},"403":{"description":"APP_NOT_ACTIVE — the branch lacks the CUSTOMER_PAGER app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"CUSTOMER_DISPLAY_PAIRING_CODE_INVALID — unknown, expired or already used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Pair a customer display by the code it shows","tags":["Customer Displays"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customer_displays:branch"]}}},"/branches/{branchId}/customer-displays/{displayId}":{"patch":{"operationId":"CustomerDisplaysController_rename","parameters":[{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"displayId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameCustomerDisplayDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDisplayResponseDto"}}}},"404":{"description":"Display not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Rename a customer display","tags":["Customer Displays"],"description":"**Access:** ![Permission: manage:customer_displays:branch](https://img.shields.io/badge/Permission-manage%3Acustomer__displays%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customer_displays:branch"]}},"delete":{"description":"**Access:** ![Permission: manage:customer_displays:branch](https://img.shields.io/badge/Permission-manage%3Acustomer__displays%3Abranch-green)\n\nIts token stops working at once and its live connections are dropped.","operationId":"CustomerDisplaysController_revoke","parameters":[{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"displayId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDisplayResponseDto"}}}},"404":{"description":"Display not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Revoke a customer display","tags":["Customer Displays"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customer_displays:branch"]}}},"/branches/{branchId}/customer-pager":{"get":{"operationId":"CustomerPagerPlanController_status","parameters":[{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPagerStatusResponseDto"}}}}},"summary":"Whether the branch has the Customer Display & Pager add-on","tags":["Customer Displays"],"description":"**Access:** ![Permission: read:customer_displays:branch](https://img.shields.io/badge/Permission-read%3Acustomer__displays%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customer_displays:branch"]}}},"/customer-display/pairings":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nRate-limited to 10 requests/minute per IP.","operationId":"CustomerDisplaySessionController_startPairing","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingStartedResponseDto"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Start pairing: get a code to show on the monitor","tags":["Customer Display (monitor)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/customer-display/pairings/{pairingId}/collect":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\n`pending` until claimed; `paired` (with the token) exactly once after.","operationId":"CustomerDisplaySessionController_collectPairing","parameters":[{"name":"pairingId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectPairingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingCollectResponseDto"}}}},"404":{"description":"CUSTOMER_DISPLAY_PAIRING_CODE_INVALID — expired, consumed or wrong secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Collect the display token once a manager claimed the code","tags":["Customer Display (monitor)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/customer-display/snapshot":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe source of truth. Load it on every socket (re)connect, when the page becomes visible, and on a slow timer; socket events only bring changes forward in between.","operationId":"CustomerDisplaySessionController_snapshot","parameters":[{"name":"cashier_ids","required":false,"in":"query","description":"Only orders created by these cashiers (comma-separated). Omit for all cashiers in the branch.","schema":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"x-display-token","in":"header","description":"The display token the monitor collected when it was paired.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisplaySnapshotResponseDto"}}}},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED — re-pair the monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"The display's full state: branding, cashiers, and the QR queue in server order","tags":["Customer Display (monitor)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/customer-display/queue/{itemId}/dismiss":{"post":{"operationId":"CustomerDisplaySessionController_dismiss","parameters":[{"name":"itemId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"x-display-token","in":"header","description":"The display token the monitor collected when it was paired.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Dismissed (or already gone)"},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Take an unscanned QR off the displays of this branch","tags":["Customer Display (monitor)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/public/order-tracking/{token}":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nNumber, items, status, calls and branding — never customer details, notes or prices. A pager closed for over 24 hours comes back as `state: finished`.","operationId":"OrderTrackingPublicController_view","parameters":[{"name":"token","required":true,"in":"path","schema":{"example":"0bR2xq9cJ4e1Vb7nLkPz3A","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderTrackingResponseDto"}}}},"404":{"description":"Unknown token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Order or pager status by public token","tags":["Order Tracking (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/public/order-tracking/{token}/open":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe first open takes the QR off the customer display. Idempotent.","operationId":"OrderTrackingPublicController_markOpened","parameters":[{"name":"token","required":true,"in":"path","schema":{"example":"0bR2xq9cJ4e1Vb7nLkPz3A","type":"string"}}],"responses":{"204":{"description":"Recorded"},"404":{"description":"Unknown or finished token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Record that a phone opened the page","tags":["Order Tracking (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/public/order-tracking/{token}/push-subscriptions":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe phone is notified once per call: when the order becomes ready, and each time staff call again. Calls made before it subscribed are not sent.","operationId":"OrderTrackingPublicController_subscribePush","parameters":[{"name":"token","required":true,"in":"path","schema":{"example":"0bR2xq9cJ4e1Vb7nLkPz3A","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeOrderPushDto"}}}},"responses":{"204":{"description":"Subscribed"},"404":{"description":"Unknown or finished token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Follow the order with Web Push","tags":["Order Tracking (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/tables":{"post":{"operationId":"DiningTablesController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDiningTableDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Create dining table (branch-scoped)","tags":["Dining Tables"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nReturns `{ groups: [...], ungrouped: [...] }`. Each group contains its tables. Tables not assigned to any group appear in `ungrouped`.","operationId":"DiningTablesController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"List dining tables grouped by floor/section","tags":["Dining Tables"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/tables/{tableId}/qr.png":{"get":{"operationId":"DiningTablesController_qrPng","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"tableId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"PNG image"}},"summary":"PNG QR code for the e-menu URL with this table pre-selected","tags":["Dining Tables"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/tables/{tableId}":{"get":{"operationId":"DiningTablesController_getOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"tableId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Get one dining table","tags":["Dining Tables"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}},"patch":{"operationId":"DiningTablesController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"tableId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDiningTableDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Update dining table (pass group_id: null to ungroup)","tags":["Dining Tables"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"delete":{"operationId":"DiningTablesController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"tableId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"summary":"Delete dining table","tags":["Dining Tables"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/tables/{tableId}/open":{"post":{"operationId":"DiningTablesController_openSession","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"tableId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"summary":"Open a table session — creates a DINE_IN order linked to the table","tags":["Dining Tables"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/tables/{tableId}/close":{"post":{"operationId":"DiningTablesController_closeSession","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"tableId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Close a table session — order must be PAID first","tags":["Dining Tables"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/table-groups":{"get":{"operationId":"DiningTableGroupsController_listGroups","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"summary":"List all table groups (floors/sections) with their tables","tags":["Dining Tables"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}},"post":{"operationId":"DiningTableGroupsController_createGroup","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDiningTableGroupDto"}}}},"responses":{"201":{"description":""}},"summary":"Create a table group (floor/section)","tags":["Dining Tables"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/table-groups/{groupId}":{"patch":{"operationId":"DiningTableGroupsController_updateGroup","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDiningTableGroupDto"}}}},"responses":{"200":{"description":""}},"summary":"Update a table group name or sort order","tags":["Dining Tables"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"delete":{"operationId":"DiningTableGroupsController_removeGroup","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Delete a table group — tables in the group become ungrouped","tags":["Dining Tables"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/cashier-shifts/open":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nBranch is resolved from the `x-branch-id` header. The target cashier must be assigned to that branch. Pass `onBehalfOfStaffId` (manager-only) to open on behalf of another cashier. Fails with CONFLICT if the target already has an open shift.","operationId":"CashierShiftsController_open","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenShiftDto"}}}},"responses":{"201":{"description":"Shift opened","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftViewDto"}}}},"400":{"description":"Validation failed"},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Non-manager attempted on-behalf open, or target cashier is not assigned to the current branch"},"409":{"description":"The target cashier already has an open shift"}},"security":[{"Bearer":[]}],"summary":"Open a cashier shift with declared opening float","tags":["Restaurants Cashier Shifts"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/cashier-shifts/{id}/close":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nReturns the shift summary (cash expected vs counted, variance, payment breakdown).","operationId":"CashierShiftsController_close","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"Cashier shift id","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseShiftDto"}}}},"responses":{"200":{"description":"Shift closed; returns shift summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftSummaryDto"}}}},"400":{"description":"Validation failed"},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Caller lacks the required membership role"},"404":{"description":"Shift not found"},"409":{"description":"Shift is already closed"}},"security":[{"Bearer":[]}],"summary":"Close a cashier shift with counted drawer cash","tags":["Restaurants Cashier Shifts"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/cashier-shifts/{id}/reopen":{"patch":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nManager-only. Clears the close-time snapshot (counted/expected/variance, closingNotes) and sets the shift back to OPEN. Refuses if the cashier already has another open shift. The reopening actor is recorded in `closedByStaffId`.","operationId":"CashierShiftsController_reopen","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"Cashier shift id","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Shift reopened","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftViewDto"}}}},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Caller is not a RESTAURANT_ADMIN or BRANCH_MANAGER"},"404":{"description":"Shift not found"},"409":{"description":"Shift is not closed, or the cashier already has another open shift"}},"security":[{"Bearer":[]}],"summary":"Reopen a closed shift (manager recovery path)","tags":["Restaurants Cashier Shifts"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/cashier-shifts/{id}/correction":{"patch":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nManager-only. Fixes a mistyped opening balance or counted amounts on a closed shift without reopening it. Expected cash, variance and `closing_counts` are restated against the orders on the shift; status and `closed_at` are untouched. Omitted figures keep their stored value; `counted_by_method` is merged over the stored counts. The actor, time and `reason` are recorded in `corrected_*`.","operationId":"CashierShiftsController_correct","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"Cashier shift id","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectShiftDto"}}}},"responses":{"200":{"description":"Shift corrected; returns shift summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftSummaryDto"}}}},"400":{"description":"Validation failed or reason missing"},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Caller is not a RESTAURANT_ADMIN or BRANCH_MANAGER"},"404":{"description":"Shift not found"},"409":{"description":"Shift is not closed"}},"security":[{"Bearer":[]}],"summary":"Correct a closed shift (opening float, counted amounts)","tags":["Restaurants Cashier Shifts"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/cashier-shifts/current":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nThe drawer is resolved from the `x-branch-id` header.","operationId":"CashierShiftsController_current","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple.","schema":{"type":"array","items":{"type":"string","enum":["staff","opened_by_staff","closed_by_staff","corrected_by_staff","branch"]}}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The current open shift, or null if none","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ShiftViewDto"}],"nullable":true}}}},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Caller lacks the required membership role"}},"security":[{"Bearer":[]}],"summary":"Get the currently open shift for the authenticated cashier","tags":["Restaurants Cashier Shifts"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/cashier-shifts":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nCASHIER sees only their own shifts in their current branch. BRANCH_MANAGER / RESTAURANT_ADMIN can filter by `branchId` and `staffId`.","operationId":"CashierShiftsController_findHistory","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"start_date","required":false,"in":"query","description":"Inclusive lower bound on openedAt, as a UTC instant.","schema":{"format":"date-time","example":"2026-05-12T00:00:00.000Z","type":"string"}},{"name":"end_date","required":false,"in":"query","description":"Inclusive upper bound on openedAt, as a UTC instant.","schema":{"format":"date-time","example":"2026-05-12T23:59:59.999Z","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"staff_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["OPEN","CLOSED"]}}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple.","schema":{"type":"array","items":{"type":"string","enum":["staff","opened_by_staff","closed_by_staff","corrected_by_staff","branch"]}}}],"responses":{"200":{"description":"Paginated shift history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftListResponseDto"}}}},"400":{"description":"Invalid query parameters"},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Caller lacks the required membership role"}},"security":[{"Bearer":[]}],"summary":"Shift history","tags":["Restaurants Cashier Shifts"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/cashier-shifts/{id}":{"get":{"operationId":"CashierShiftsController_findOne","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"Cashier shift id","schema":{"format":"uuid","type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple.","schema":{"type":"array","items":{"type":"string","enum":["staff","opened_by_staff","closed_by_staff","corrected_by_staff","branch"]}}}],"responses":{"200":{"description":"The shift","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftViewDto"}}}},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Caller lacks the required membership role"},"404":{"description":"Shift not found"}},"security":[{"Bearer":[]}],"summary":"Get a shift by id","tags":["Restaurants Cashier Shifts"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/cashier-shifts/{id}/summary":{"get":{"operationId":"CashierShiftsController_findSummary","parameters":[{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for branch-scoped cashier/manager sessions; restaurant admins can use query filters where allowed.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"Cashier shift id","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Shift summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftSummaryDto"}}}},"401":{"description":"Missing or invalid bearer token"},"403":{"description":"Caller lacks the required membership role"},"404":{"description":"Shift not found"}},"security":[{"Bearer":[]}],"summary":"Shift summary: sales by payment method, expected vs counted cash, variance","tags":["Restaurants Cashier Shifts"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/table-reservations":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nAuto-assigns the smallest available table that fits `party_size`. Validates the requested time is within the branch reservation schedule and that the duration does not exceed `max_duration_minutes`. Overlap detection accounts for `buffer_minutes` between reservations.","operationId":"TableReservationsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReservationDto"}}}},"responses":{"201":{"description":"Reservation created and table assigned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableReservationResponseDto"}}}},"400":{"description":"Customer not found for this restaurant, requested time outside schedule, or duration exceeds maximum."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Reservations are not enabled for this branch."},"409":{"description":"No table can accommodate this reservation at the requested time."}},"security":[{"Bearer":[]}],"summary":"Create reservation","tags":["Emenu Table reservations"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"get":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nReturns all reservations ordered by `reservation_time` ascending. Optionally filter by a specific dining table.","operationId":"TableReservationsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"dining_table_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Array of reservations with embedded customer and table summaries.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TableReservationResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"List reservations for the branch","tags":["Emenu Table reservations"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/table-reservations/{reservationId}":{"get":{"operationId":"TableReservationsController_getOne","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"reservationId","required":true,"in":"path","description":"Reservation UUID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Reservation with full customer (including email) and dining table details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableReservationResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Reservation not found for this branch."}},"security":[{"Bearer":[]}],"summary":"Get one reservation","tags":["Emenu Table reservations"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"patch":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nPartial update. When `reservation_time`, `duration_minutes`, or `party_size` changes, the system re-runs table allocation to find the best available table. Set `status` to `cancelled` to cancel; `cancelled_at` is recorded automatically.","operationId":"TableReservationsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"reservationId","required":true,"in":"path","description":"Reservation UUID","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTableReservationDto"}}}},"responses":{"200":{"description":"Updated reservation with new table assignment (if reallocated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableReservationResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Reservation not found for this branch."},"409":{"description":"No table available after update."}},"security":[{"Bearer":[]}],"summary":"Update reservation","tags":["Emenu Table reservations"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"delete":{"operationId":"TableReservationsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"reservationId","required":true,"in":"path","description":"Reservation UUID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Reservation deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteReservationResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Reservation not found for this branch."}},"security":[{"Bearer":[]}],"summary":"Delete reservation (hard delete)","tags":["Emenu Table reservations"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/table-reservations/available-times":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns all available 15-minute time slots for the given date and party size. No authentication required. Returns 404 if reservations are not configured for this branch.","operationId":"CustomerTableReservationsController_getAvailableTimes","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"date","required":true,"in":"query","description":"Local date (YYYY-MM-DD) in the branch timezone","schema":{"example":"2026-07-10","type":"string"}},{"name":"party_size","required":true,"in":"query","schema":{"minimum":1,"type":"number"}},{"name":"duration_minutes","required":false,"in":"query","schema":{"minimum":1,"type":"number"}},{"name":"duration_minutes","required":false,"in":"query","description":"Desired reservation duration in minutes. Defaults to branch `max_duration_minutes`.","schema":{"type":"number"}},{"name":"party_size","required":true,"in":"query","description":"Number of guests","schema":{"example":2,"type":"number"}}],"responses":{"200":{"description":"Available time slots as ISO 8601 UTC strings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableTimeSlotsResponseDto"}}}},"404":{"description":"Reservations not enabled or not configured for this branch."}},"summary":"Get available reservation time slots (public)","tags":["Emenu Table reservations"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/customer/table-reservations":{"get":{"description":"Customer-only. Returns all table reservations for the authenticated customer across branches of this restaurant.","operationId":"CustomerAccountReservationsController_listMine","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TableReservationResponseDto"}}}}},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Not a customer token, or restaurant mismatch."}},"security":[{"Bearer":[]}],"summary":"List my table reservations","tags":["Customer Account"]},"post":{"description":"Customer-only. Auto-assigns a table for the given branch, party size, and start time. Use the returned `id` as `reservation_id` when placing a TABLE_RESERVATION / DINE_IN order.","operationId":"CustomerAccountReservationsController_createMine","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerReservationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableReservationResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableReservationResponseDto"}}}},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Not a customer token, or restaurant mismatch."}},"security":[{"Bearer":[]}],"summary":"Create a table reservation for myself","tags":["Customer Account"]}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/tables/{tableId}/status":{"get":{"description":"Returns whether the table is available, occupied, or reserved. When a customer Bearer token is sent, also returns owned_by_me / can_order so the seated guest can place another order on their own table.","operationId":"DiningTableStatusController_getStatus","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"tableId","required":true,"in":"path","description":"Dining table UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"Table availability","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiningTableStatusResponseDto"}}}},"404":{"description":"Restaurant, branch, or table not found"}},"summary":"Public dining table availability for QR walk-in","tags":["Emenu Dining Tables"]}},"/restaurants/{restaurantId}/branches/{branchId}/reservation-config":{"get":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nReturns the reservation config with all schedule slots ordered by day and start time.","operationId":"BranchReservationConfigController_get","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"Branch reservation configuration with schedules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchReservationConfigResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"No reservation config found for this branch."}},"security":[{"Bearer":[]}],"summary":"Get branch reservation configuration","tags":["Emenu Reservation Config"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"put":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nUpserts the top-level config record (`is_enabled`, `max_duration_minutes`, `buffer_minutes`). Schedule slots are managed separately via the `/schedules` sub-routes.","operationId":"BranchReservationConfigController_upsert","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertBranchReservationConfigDto"}}}},"responses":{"200":{"description":"Upserted reservation configuration with current schedules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchReservationConfigResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Branch not found for this restaurant."}},"security":[{"Bearer":[]}],"summary":"Create or update branch reservation configuration","tags":["Emenu Reservation Config"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/reservation-config/schedules":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nAppends a new schedule entry for the given `day_of_week`. Multiple slots per day are allowed (e.g. lunch and dinner windows).","operationId":"BranchReservationConfigController_addSchedule","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddReservationScheduleDto"}}}},"responses":{"201":{"description":"Schedule slot created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchReservationScheduleResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"No reservation config found for this branch."}},"security":[{"Bearer":[]}],"summary":"Add a time slot to the reservation schedule","tags":["Emenu Reservation Config"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/reservation-config/schedules/{scheduleId}":{"delete":{"operationId":"BranchReservationConfigController_removeSchedule","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"scheduleId","required":true,"in":"path","description":"Schedule slot UUID","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Schedule slot deleted."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Schedule slot not found or no config for this branch."}},"security":[{"Bearer":[]}],"summary":"Remove a time slot from the reservation schedule","tags":["Emenu Reservation Config"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/reservation-config/apply-to-all-days":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nAtomically deletes all existing schedule slots for this branch and recreates them across all 7 days (SAT–FRI) using the provided `slots` as a template. Useful for applying a uniform weekly schedule in one call.","operationId":"BranchReservationConfigController_applyToAllDays","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyToAllDaysDto"}}}},"responses":{"200":{"description":"Updated reservation configuration with the new schedules applied to all days.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchReservationConfigResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"No reservation config found for this branch."}},"security":[{"Bearer":[]}],"summary":"Copy the given time slots to all 7 days of the week (replaces existing)","tags":["Emenu Reservation Config"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/carts":{"post":{"description":"**Access:** ![Feature: ONLINE_ORDERING](https://img.shields.io/badge/Feature-ONLINE__ORDERING-orange)\n\nRequires a customer JWT. At most one cart per customer per branch: if one already exists (including a previously checked-out cart), it is reactivated and its line items are replaced.","operationId":"CartsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCartDto"}}}},"responses":{"201":{"description":"Cart created or existing cart reused with updated line items.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Only e-menu CUSTOMER sessions may manage carts."},"409":{"description":"Unexpected uniqueness conflict (should not occur for customer+branch)."}},"security":[{"Bearer":[]}],"summary":"Create or reuse cart (customer session)","tags":["Emenu Carts"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"ONLINE_ORDERING","permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/carts/{cartId}":{"patch":{"description":"**Access:** ![Feature: ONLINE_ORDERING](https://img.shields.io/badge/Feature-ONLINE__ORDERING-orange)\n\nWhen `items` is present, existing line items and addons are removed and replaced with the payload. Totals are recomputed from stored lines.","operationId":"CartsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"cartId","required":true,"in":"path","description":"Cart UUID","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCartDto"}}}},"responses":{"200":{"description":"Cart updated with recalculated totals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Only e-menu CUSTOMER sessions may manage carts."},"404":{"description":"Cart not found for this customer + branch."}},"security":[{"Bearer":[]}],"summary":"Update cart","tags":["Emenu Carts"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"ONLINE_ORDERING","permissions":[]}},"delete":{"operationId":"CartsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"cartId","required":true,"in":"path","description":"Cart UUID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Cart deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCartResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Only e-menu CUSTOMER sessions may manage carts."},"404":{"description":"Cart not found for this customer + branch."}},"security":[{"Bearer":[]}],"summary":"Delete cart (cascades items, addons, discounts, loyalty rows)","tags":["Emenu Carts"],"description":"**Access:** ![Feature: ONLINE_ORDERING](https://img.shields.io/badge/Feature-ONLINE__ORDERING-orange)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"ONLINE_ORDERING","permissions":[]}}},"/restaurants/{restaurantId}/inventory/locations":{"get":{"operationId":"InventoryLocationsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"type","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["MAIN_WAREHOUSE","BRANCH_STORE"]}}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryLocationListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List inventory locations","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_locations:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__locations%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_locations:restaurant"]}},"post":{"operationId":"InventoryLocationsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInventoryLocationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryLocationDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryLocationDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create an inventory location","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_locations:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__locations%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_locations:restaurant"]}}},"/restaurants/{restaurantId}/inventory/locations/{id}":{"get":{"operationId":"InventoryLocationsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryLocationDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get an inventory location by id","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_locations:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__locations%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_locations:restaurant"]}},"patch":{"operationId":"InventoryLocationsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInventoryLocationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryLocationDto"}}}},"409":{"description":"Location still holds stock, or is referenced by unfinished inventory documents."}},"security":[{"Bearer":[]}],"summary":"Update an inventory location","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_locations:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__locations%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_locations:restaurant"]}},"delete":{"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_locations:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__locations%3Arestaurant-green)\n\nRefused while the location holds stock or is named by an unfinished inventory document — transfer or write off the stock and settle the documents first.","operationId":"InventoryLocationsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""},"409":{"description":"Location still holds stock, or is referenced by unfinished inventory documents."}},"security":[{"Bearer":[]}],"summary":"Soft-delete an inventory location (sets isActive=false)","tags":["Inventory"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_locations:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-categories":{"get":{"operationId":"StockCategoriesController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StockCategoryDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List stock categories","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_items:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_items:restaurant"]}},"post":{"operationId":"StockCategoriesController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStockCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockCategoryDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockCategoryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a stock category","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-categories/{id}":{"patch":{"operationId":"StockCategoriesController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStockCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockCategoryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a stock category","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}},"delete":{"operationId":"StockCategoriesController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete a stock category","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-items":{"get":{"operationId":"StockItemsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"type","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["RAW_MATERIAL","SEMI_FINISHED","FINISHED_GOOD","CONSUMABLE","PACKAGING"]}}},{"name":"category_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple: `?expand=storageUnit&expand=recipeUnit`","schema":{"type":"array","items":{"type":"string","enum":["storage_unit","recipe_unit","category"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockItemListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List stock items","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_items:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_items:restaurant"]}},"post":{"operationId":"StockItemsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStockItemDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockItemDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockItemDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a stock item","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-items/{id}":{"get":{"operationId":"StockItemsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple: `?expand=storageUnit&expand=recipeUnit`","schema":{"type":"array","items":{"type":"string","enum":["storage_unit","recipe_unit","category"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockItemDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a stock item by id","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_items:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_items:restaurant"]}},"patch":{"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)\n\nSetting is_active=false is refused while the item still has stock on hand or is named by an unfinished inventory document.","operationId":"StockItemsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple: `?expand=storageUnit&expand=recipeUnit`","schema":{"type":"array","items":{"type":"string","enum":["storage_unit","recipe_unit","category"]}}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStockItemDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockItemDto"}}}},"409":{"description":"Item still has stock on hand, or is referenced by unfinished inventory documents."}},"security":[{"Bearer":[]}],"summary":"Update a stock item","tags":["Inventory"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}},"delete":{"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)\n\nRefused while the item still has stock on hand or is named by an unfinished inventory document — consume or write off the remaining quantity and settle the documents first.","operationId":"StockItemsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""},"409":{"description":"Item still has stock on hand, or is referenced by unfinished inventory documents."}},"security":[{"Bearer":[]}],"summary":"Soft-delete a stock item (sets isActive=false)","tags":["Inventory"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}}},"/restaurants/{restaurantId}/inventory/recipes":{"get":{"operationId":"RecipesController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["SALES","PRODUCTION"]}},{"name":"product_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"output_stock_item_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List recipes","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_recipes:restaurant"]}},"post":{"operationId":"RecipesController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecipeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a recipe","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}}},"/restaurants/{restaurantId}/inventory/recipes/cost-preview":{"get":{"operationId":"RecipesController_costPreview","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"product_id","required":true,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"variant_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"option_value_ids","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostPreviewDto"}}}}},"security":[{"Bearer":[]}],"summary":"Preview ingredient cost for a product + option selection","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_recipes:restaurant"]}}},"/restaurants/{restaurantId}/inventory/recipes/{id}":{"get":{"operationId":"RecipesController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a recipe by id","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_recipes:restaurant"]}},"patch":{"operationId":"RecipesController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRecipeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a recipe","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}},"delete":{"operationId":"RecipesController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Soft-delete a recipe","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}}},"/restaurants/{restaurantId}/inventory/recipes/{id}/ingredients":{"post":{"operationId":"RecipesController_addIngredient","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecipeIngredientDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeIngredientDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeIngredientDto"}}}}},"security":[{"Bearer":[]}],"summary":"Add an ingredient to a recipe","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}}},"/restaurants/{restaurantId}/inventory/recipes/{id}/ingredients/{ingredientId}":{"patch":{"operationId":"RecipesController_updateIngredient","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"ingredientId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRecipeIngredientDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeIngredientDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a recipe ingredient","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}},"delete":{"operationId":"RecipesController_removeIngredient","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"ingredientId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Remove an ingredient from a recipe","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}}},"/restaurants/{restaurantId}/inventory/option-value-effects":{"get":{"operationId":"OptionValueEffectsController_list","parameters":[{"name":"option_value_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"option_group_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Comma-separated or repeated: `?expand=stock_item,option_value`.","schema":{"type":"array","items":{"type":"string","enum":["stock_item","option_value"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OptionValueRecipeEffectDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List option-value recipe effects (filter by optionValueId or optionGroupId)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_recipes:restaurant"]}},"post":{"operationId":"OptionValueEffectsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOptionValueRecipeEffectDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionValueRecipeEffectDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionValueRecipeEffectDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create an option-value recipe effect","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}}},"/restaurants/{restaurantId}/inventory/option-value-effects/{id}":{"patch":{"operationId":"OptionValueEffectsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOptionValueRecipeEffectDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionValueRecipeEffectDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update an option-value recipe effect","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}},"delete":{"operationId":"OptionValueEffectsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete an option-value recipe effect","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_recipes:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__recipes%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_recipes:restaurant"]}}},"/restaurants/{restaurantId}/inventory/suppliers":{"get":{"operationId":"SuppliersController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List suppliers","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_purchases:restaurant"]}},"post":{"operationId":"SuppliersController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupplierDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a supplier","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/suppliers/{id}":{"get":{"operationId":"SuppliersController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a supplier by id","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_purchases:restaurant"]}},"patch":{"operationId":"SuppliersController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupplierDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a supplier","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}},"delete":{"operationId":"SuppliersController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Soft-delete a supplier","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/suppliers/{supplierId}/items":{"get":{"operationId":"SuppliersController_listItems","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SupplierItemDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List items supplied by a supplier","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_purchases:restaurant"]}},"post":{"operationId":"SuppliersController_addItem","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupplierItemDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierItemDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierItemDto"}}}}},"security":[{"Bearer":[]}],"summary":"Add a stock item to a supplier catalogue","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/suppliers/{supplierId}/items/{itemId}":{"patch":{"operationId":"SuppliersController_updateItem","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}},{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupplierItemDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierItemDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a supplier item","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}},"delete":{"operationId":"SuppliersController_deleteItem","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}},{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Remove a supplier item","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/suppliers/{supplierId}/items/{itemId}/price-history":{"get":{"operationId":"SuppliersController_getPriceHistory","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}},{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SupplierItemPriceHistoryDto"}}}}}},"security":[{"Bearer":[]}],"summary":"Get price history for a supplier item","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/purchases":{"get":{"operationId":"StockPurchasesController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"location_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"supplier_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","CONFIRMED","RECEIVED","POSTED","VOIDED","CANCELLED"]}}},{"name":"mode","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["DIRECT","PO"]}}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=supplier&expand=location`","schema":{"type":"array","items":{"type":"string","enum":["supplier","location","stock_item"]}}},{"name":"locale","required":false,"in":"query","description":"Locale for exported column headers.","schema":{"type":"string","enum":["ar","en"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List stock purchases","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_purchases:restaurant"]}},"post":{"operationId":"StockPurchasesController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStockPurchaseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a stock purchase (DRAFT)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:branch"]}}},"/restaurants/{restaurantId}/inventory/purchases/export":{"get":{"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__purchases%3Arestaurant-green)\n\nStreams a CSV of every purchase matching the current filters (not paginated). Pass `locale=ar|en` to localize the column headers.","operationId":"StockPurchasesController_export","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"location_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"supplier_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","CONFIRMED","RECEIVED","POSTED","VOIDED","CANCELLED"]}}},{"name":"mode","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["DIRECT","PO"]}}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=supplier&expand=location`","schema":{"type":"array","items":{"type":"string","enum":["supplier","location","stock_item"]}}},{"name":"locale","required":false,"in":"query","description":"Locale for exported column headers.","schema":{"type":"string","enum":["ar","en"]}}],"responses":{"200":{"description":"CSV file","content":{"text/csv; charset=utf-8":{"schema":{"type":"string","format":"binary"}}}}},"security":[{"Bearer":[]}],"summary":"Export stock purchases to CSV","tags":["Inventory"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/purchases/{id}":{"get":{"operationId":"StockPurchasesController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=supplier&expand=location`","schema":{"type":"array","items":{"type":"string","enum":["supplier","location","stock_item"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a stock purchase by id","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_purchases:restaurant"]}},"patch":{"operationId":"StockPurchasesController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStockPurchaseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a DRAFT purchase","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:branch"]}}},"/restaurants/{restaurantId}/inventory/purchases/{id}/submit":{"post":{"operationId":"StockPurchasesController_submit","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Submit a PO (DRAFT → SUBMITTED)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:branch"]}}},"/restaurants/{restaurantId}/inventory/purchases/{id}/confirm":{"post":{"operationId":"StockPurchasesController_confirm","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Confirm a PO (SUBMITTED → CONFIRMED)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:branch"]}}},"/restaurants/{restaurantId}/inventory/purchases/{id}/receive":{"post":{"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Abranch-green)\n\nRecords arrival, who received it and when, and the delivered quantity per line. Send an empty body to receive every line in full; supply `items` to record a short delivery. Still moves no stock — only `post` writes to the ledger.","operationId":"StockPurchasesController_receive","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiveStockPurchaseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Mark purchase as received (→ RECEIVED)","tags":["Inventory"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:branch"]}}},"/restaurants/{restaurantId}/inventory/purchases/{id}/post":{"post":{"operationId":"StockPurchasesController_post","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Post purchase to ledger (RECEIVED → POSTED)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/purchases/{id}/void":{"post":{"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)\n\nReverses everything posting did: a compensating PURCHASE_VOID ledger entry per item, the purchase's cost layers dropped, and its contribution removed from the weighted average cost. Not blocked when the stock has already been consumed — the resulting negative balance is the accurate signal that consumption drew on stock that never existed.","operationId":"StockPurchasesController_void","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Void a purchase","tags":["Inventory"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/purchases/{id}/cancel":{"post":{"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_purchases:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__purchases%3Arestaurant-green)\n\nAllowed for a DRAFT in either mode, and for a SUBMITTED or CONFIRMED PO. Distinct from void, which reverses a purchase that already posted.","operationId":"StockPurchasesController_cancel","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPurchaseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Cancel a purchase before it reaches the ledger","tags":["Inventory"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_purchases:restaurant"]}}},"/restaurants/{restaurantId}/inventory/adjustments":{"post":{"operationId":"AdjustmentsController_adjust","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAdjustmentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockMovementDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockMovementDto"}}}}},"security":[{"Bearer":[]}],"summary":"Post a manual stock adjustment (ADD or REMOVE)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_adjustments:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__adjustments%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_adjustments:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/levels":{"get":{"operationId":"InventoryReportsController_getLevels","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"location_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"low_stock_only","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"negative_only","required":false,"in":"query","description":"Only rows whose quantity is below zero. A negative balance means recorded consumption exceeded recorded receipts — an unrecorded purchase, over-portioning, or a missed transfer. Sales are never blocked by stock, so these surface here.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLevelListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List current stock levels with pagination and search","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/valuation":{"get":{"operationId":"InventoryReportsController_getValuation","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StockValuationDto"}}}}}},"security":[{"Bearer":[]}],"summary":"Get WAC-based stock valuation across all locations","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/movements":{"get":{"operationId":"InventoryReportsController_getMovements","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"stock_item_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"stock_item_ids","required":false,"in":"query","description":"Filter to these stock items. Repeat or comma-separate: `?stock_item_ids=<id1>,<id2>` or `?stock_item_ids=<id1>&stock_item_ids=<id2>`.","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple: `?expand=stock_item&expand=unit`.","schema":{"type":"array","items":{"type":"string","enum":["stock_item","unit","location"]}}},{"name":"location_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["PURCHASE","PURCHASE_VOID","SALE","SALE_RETURN","TRANSFER_IN","TRANSFER_OUT","TRANSFER_LOSS","PRODUCTION_CONSUME","PRODUCTION_OUTPUT","ADJUSTMENT_ADD","ADJUSTMENT_REMOVE","WASTAGE","COUNT_ADJUSTMENT","OPENING_BALANCE"]}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockMovementListDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get paginated stock movement (transaction) history","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/wastage":{"get":{"operationId":"InventoryReportsController_getWastage","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"location_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageSummaryListDto"}}}}},"security":[{"Bearer":[]}],"summary":"Paginated wastage entry summary, filterable by location, status, and date range","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/oversold":{"get":{"operationId":"InventoryReportsController_getOversold","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"location_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OversoldLineListDto"}}}}},"security":[{"Bearer":[]}],"summary":"Order lines sold past their stock, with who approved each, filterable by location and date range","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/low-stock":{"get":{"operationId":"InventoryReportsController_getLowStock","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LowStockDto"}}}}}},"security":[{"Bearer":[]}],"summary":"Items below reorder point with preferred supplier and estimated reorder cost","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/purchases":{"get":{"operationId":"InventoryReportsController_getPurchases","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"supplier_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"location_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["DRAFT","SUBMITTED","CONFIRMED","RECEIVED","POSTED","VOIDED","CANCELLED"]}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseSummaryListDto"}}}}},"security":[{"Bearer":[]}],"summary":"Paginated purchase history, filterable by supplier, location, status, and date","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/profitability":{"get":{"operationId":"InventoryReportsController_getProfitability","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","description":"ISO date — start of range (inclusive), defaults to 30 days ago","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date — end of range (inclusive), defaults to today","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","description":"Scope to a single branch","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfitabilityReportDto"}}}}},"security":[{"Bearer":[]}],"summary":"Profitability report: revenue vs COGS with gross margin, by product and by day","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/reports/cost-profitability":{"get":{"operationId":"CostProfitabilityController_getReport","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","description":"ISO date — start of range (inclusive), defaults to 30 days ago","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date — end of range (inclusive), defaults to today","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","description":"Scope to a single branch","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfitabilityReportDto"}}}}},"security":[{"Bearer":[]}],"summary":"Profitability report priced from product cost_price (revenue − cost × units)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_reports:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__reports%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_reports:restaurant"]}}},"/restaurants/{restaurantId}/inventory/settings":{"get":{"operationId":"InventorySettingsController_get","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventorySettingsDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get inventory settings (auto-creates defaults if not set)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_items:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_items:restaurant"]}},"put":{"operationId":"InventorySettingsController_upsert","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertInventorySettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventorySettingsDto"}}}}},"security":[{"Bearer":[]}],"summary":"Upsert inventory settings","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}}},"/restaurants/{restaurantId}/inventory/wastage-reason-codes":{"get":{"operationId":"WastageController_listReasonCodes","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WastageReasonCodeDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List wastage reason codes","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_wastage:branch](https://img.shields.io/badge/Permission-read%3Ainventory__wastage%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_wastage:branch"]}},"post":{"operationId":"WastageController_createReasonCode","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWastageReasonCodeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageReasonCodeDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a wastage reason code","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:restaurant"]}}},"/restaurants/{restaurantId}/inventory/wastage-reason-codes/{id}":{"patch":{"operationId":"WastageController_updateReasonCode","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWastageReasonCodeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageReasonCodeDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a wastage reason code","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:restaurant"]}}},"/restaurants/{restaurantId}/inventory/wastage-entries":{"get":{"operationId":"WastageController_listEntries","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string"}}},{"name":"location_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=location,stock_item,reason_code,unit`","schema":{"type":"array","items":{"type":"string","enum":["location","stock_item","reason_code","unit"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List wastage entries","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_wastage:branch](https://img.shields.io/badge/Permission-read%3Ainventory__wastage%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_wastage:branch"]}},"post":{"operationId":"WastageController_createEntry","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWastageEntryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a wastage entry (DRAFT)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:branch"]}}},"/restaurants/{restaurantId}/inventory/wastage-entries/{id}":{"get":{"operationId":"WastageController_getEntry","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=location,stock_item,reason_code,unit`","schema":{"type":"array","items":{"type":"string","enum":["location","stock_item","reason_code","unit"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a wastage entry by id","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_wastage:branch](https://img.shields.io/badge/Permission-read%3Ainventory__wastage%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_wastage:branch"]}},"patch":{"operationId":"WastageController_updateEntry","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWastageEntryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a DRAFT wastage entry","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:branch"]}}},"/restaurants/{restaurantId}/inventory/wastage-entries/{id}/submit":{"post":{"operationId":"WastageController_submitEntry","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Submit a DRAFT wastage entry for approval","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:branch"]}}},"/restaurants/{restaurantId}/inventory/wastage-entries/{id}/approve":{"post":{"operationId":"WastageController_approveEntry","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Approve a SUBMITTED wastage entry","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:restaurant"]}}},"/restaurants/{restaurantId}/inventory/wastage-entries/{id}/reject":{"post":{"operationId":"WastageController_rejectEntry","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectWastageEntryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Reject a SUBMITTED wastage entry","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:restaurant"]}}},"/restaurants/{restaurantId}/inventory/wastage-entries/{id}/post":{"post":{"operationId":"WastageController_postEntry","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WastageEntryDto"}}}}},"security":[{"Bearer":[]}],"summary":"Post an APPROVED wastage entry to the ledger","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_wastage:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__wastage%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_wastage:restaurant"]}}},"/restaurants/{restaurantId}/inventory/order-postings":{"get":{"operationId":"OrderPostingsController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["PENDING","POSTED","FAILED","RESOLVED","REVERSED"]}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPostingListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List order inventory postings","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_postings:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__postings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_postings:restaurant"]}}},"/restaurants/{restaurantId}/inventory/order-postings/{id}":{"get":{"operationId":"OrderPostingsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPostingDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get an order inventory posting","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_postings:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__postings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_postings:restaurant"]}}},"/restaurants/{restaurantId}/inventory/order-postings/{id}/retry":{"post":{"operationId":"OrderPostingsController_retry","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPostingDto"}}}}},"security":[{"Bearer":[]}],"summary":"Retry a FAILED order inventory posting","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_postings:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__postings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_postings:restaurant"]}}},"/restaurants/{restaurantId}/inventory/order-postings/{id}/mark-resolved":{"post":{"operationId":"OrderPostingsController_markResolved","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPostingDto"}}}}},"security":[{"Bearer":[]}],"summary":"Manually mark a FAILED posting as resolved (skip deduction)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_postings:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__postings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_postings:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-transfers":{"get":{"operationId":"StockTransfersController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string"}}},{"name":"from_location_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"to_location_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=from_location&expand=to_location`","schema":{"type":"array","items":{"type":"string","enum":["from_location","to_location"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List stock transfers","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_transfers:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__transfers%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_transfers:restaurant"]}},"post":{"operationId":"StockTransfersController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStockTransferDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a stock transfer (DRAFT)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: create:inventory_transfers:branch](https://img.shields.io/badge/Permission-create%3Ainventory__transfers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["create:inventory_transfers:branch"]}}},"/restaurants/{restaurantId}/inventory/stock-transfers/{id}":{"get":{"operationId":"StockTransfersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=from_location&expand=to_location`","schema":{"type":"array","items":{"type":"string","enum":["from_location","to_location"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a stock transfer","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_transfers:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__transfers%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_transfers:restaurant"]}},"patch":{"operationId":"StockTransfersController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStockTransferDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a DRAFT stock transfer","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: create:inventory_transfers:branch](https://img.shields.io/badge/Permission-create%3Ainventory__transfers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["create:inventory_transfers:branch"]}}},"/restaurants/{restaurantId}/inventory/stock-transfers/{id}/submit":{"post":{"operationId":"StockTransfersController_submit","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Submit a DRAFT transfer for approval","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: create:inventory_transfers:branch](https://img.shields.io/badge/Permission-create%3Ainventory__transfers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["create:inventory_transfers:branch"]}}},"/restaurants/{restaurantId}/inventory/stock-transfers/{id}/approve":{"post":{"operationId":"StockTransfersController_approve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveStockTransferDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Approve a PENDING_APPROVAL transfer and post TRANSFER_OUT","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_transfers:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__transfers%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_transfers:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-transfers/{id}/in-transit":{"post":{"operationId":"StockTransfersController_markInTransit","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Mark an APPROVED transfer as IN_TRANSIT","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_transfers:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__transfers%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_transfers:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-transfers/{id}/receive":{"post":{"operationId":"StockTransfersController_receive","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiveStockTransferDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Receive a transfer and post TRANSFER_IN + TRANSFER_LOSS","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_transfers:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__transfers%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_transfers:restaurant"]}}},"/restaurants/{restaurantId}/inventory/stock-transfers/{id}/cancel":{"post":{"operationId":"StockTransfersController_cancel","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferDto"}}}}},"security":[{"Bearer":[]}],"summary":"Cancel a non-received transfer","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_transfers:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__transfers%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_transfers:restaurant"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts":{"get":{"operationId":"InventoryCountsController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string"}}},{"name":"location_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=location` or `?expand=stock_item`","schema":{"type":"array","items":{"type":"string","enum":["location","stock_item"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List inventory count sessions","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}},"post":{"operationId":"InventoryCountsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInventoryCountDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a count session (DRAFT)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts/{id}":{"get":{"operationId":"InventoryCountsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=location` or `?expand=stock_item`","schema":{"type":"array","items":{"type":"string","enum":["location","stock_item"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a count session","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts/{id}/items":{"post":{"operationId":"InventoryCountsController_addItem","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCountItemDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Add a stock item to a count session","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts/{id}/items/all":{"post":{"operationId":"InventoryCountsController_addAllItems","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Add every active stock item to a count session","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts/{id}/start":{"post":{"operationId":"InventoryCountsController_start","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Start a DRAFT count (snapshots expectedQty, enforces one active per location)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts/{id}/submit":{"post":{"operationId":"InventoryCountsController_submit","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitInventoryCountDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Submit counted quantities for approval","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts/{id}/approve":{"post":{"operationId":"InventoryCountsController_approve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Approve count and post COUNT_ADJUSTMENT transactions","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/inventory-counts/{id}/discard":{"post":{"operationId":"InventoryCountsController_discard","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCountDto"}}}}},"security":[{"Bearer":[]}],"summary":"Discard a non-approved count session","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_counts:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__counts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_counts:branch"]}}},"/restaurants/{restaurantId}/inventory/production-orders":{"get":{"operationId":"ProductionOrdersController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string"}}},{"name":"location_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"recipe_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=location` or `?expand=stock_item&expand=unit`","schema":{"type":"array","items":{"type":"string","enum":["location","stock_item","unit"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionOrderListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List production orders","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_production:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__production%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_production:branch"]}},"post":{"operationId":"ProductionOrdersController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductionOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionOrderDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a production order (DRAFT); auto-populates from recipe if recipeId provided","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_production:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__production%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_production:branch"]}}},"/restaurants/{restaurantId}/inventory/production-orders/{id}":{"get":{"operationId":"ProductionOrdersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Example: `?expand=location` or `?expand=stock_item&expand=unit`","schema":{"type":"array","items":{"type":"string","enum":["location","stock_item","unit"]}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionOrderDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a production order","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_production:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__production%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_production:branch"]}}},"/restaurants/{restaurantId}/inventory/production-orders/{id}/start":{"post":{"operationId":"ProductionOrdersController_start","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionOrderDto"}}}}},"security":[{"Bearer":[]}],"summary":"Start a DRAFT production order","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_production:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__production%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_production:branch"]}}},"/restaurants/{restaurantId}/inventory/production-orders/{id}/complete":{"post":{"operationId":"ProductionOrdersController_complete","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteProductionOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionOrderDto"}}}}},"security":[{"Bearer":[]}],"summary":"Record actual quantities; transitions IN_PROGRESS → COMPLETED","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_production:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__production%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_production:branch"]}}},"/restaurants/{restaurantId}/inventory/production-orders/{id}/post":{"post":{"operationId":"ProductionOrdersController_post","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionOrderDto"}}}}},"security":[{"Bearer":[]}],"summary":"Post COMPLETED order to ledger (PRODUCTION_CONSUME + PRODUCTION_OUTPUT)","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_production:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__production%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_production:branch"]}}},"/restaurants/{restaurantId}/inventory/production-orders/{id}/cancel":{"post":{"operationId":"ProductionOrdersController_cancel","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionOrderDto"}}}}},"security":[{"Bearer":[]}],"summary":"Cancel a non-posted production order","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_production:branch](https://img.shields.io/badge/Permission-manage%3Ainventory__production%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_production:branch"]}}},"/restaurants/{restaurantId}/inventory/units-of-measure":{"get":{"operationId":"UnitsOfMeasureController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"example":true,"type":"boolean"}},{"name":"is_system","required":false,"in":"query","description":"true: only the system units, none hidden by a business unit of the same symbol (the units a product can be sold in). false: only the business's own units.","schema":{"example":true,"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List units of measure","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_items:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_items:restaurant"]}},"post":{"operationId":"UnitsOfMeasureController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUnitOfMeasureDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a unit of measure","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}}},"/restaurants/{restaurantId}/inventory/units-of-measure/{id}":{"get":{"operationId":"UnitsOfMeasureController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a unit of measure","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: read:inventory_items:restaurant](https://img.shields.io/badge/Permission-read%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["read:inventory_items:restaurant"]}},"patch":{"operationId":"UnitsOfMeasureController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUnitOfMeasureDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a unit of measure","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}},"delete":{"operationId":"UnitsOfMeasureController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Deactivate a unit of measure","tags":["Inventory"],"description":"**Access:** ![Feature: INVENTORY](https://img.shields.io/badge/Feature-INVENTORY-orange) ![Permission: manage:inventory_items:restaurant](https://img.shields.io/badge/Permission-manage%3Ainventory__items%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":"INVENTORY","permissions":["manage:inventory_items:restaurant"]}}},"/restaurants/{restaurantId}/price-overrides":{"put":{"description":"**Access:** ![Permission: manage:orders:restaurant](https://img.shields.io/badge/Permission-manage%3Aorders%3Arestaurant-green)\n\nCreates or updates an override for a product, variant, or option value scoped to a channel and/or branch. At least one of channelId or branchId is required.","operationId":"PriceOverrideController_upsert","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertPriceOverrideDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceOverrideDto"}}}}},"security":[{"Bearer":[]}],"summary":"Upsert a price override","tags":["Pricing"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:orders:restaurant"]}},"delete":{"operationId":"PriceOverrideController_removeByScope","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePriceOverrideDto"}}}},"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Remove an override by its scope key","tags":["Pricing"],"description":"**Access:** ![Permission: manage:orders:restaurant](https://img.shields.io/badge/Permission-manage%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:orders:restaurant"]}}},"/restaurants/{restaurantId}/price-overrides/{overrideId}":{"delete":{"operationId":"PriceOverrideController_removeById","parameters":[{"name":"overrideId","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Remove an override by its ID","tags":["Pricing"],"description":"**Access:** ![Permission: manage:orders:restaurant](https://img.shields.io/badge/Permission-manage%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:orders:restaurant"]}}},"/restaurants/{restaurantId}/price-overrides/product-channel-prices":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nEvery product-level, channel-specific price for the restaurant (across all branches), returned flat in one query for bulk consumers such as the catalog export.","operationId":"PriceOverrideController_listProductChannelPrices","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProductChannelPriceDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List product channel prices","tags":["Pricing"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/price-overrides/products/{productId}":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nReturns overrides for the product itself, all its variants, and all option values — grouped by entity.","operationId":"PriceOverrideController_getProductOverview","parameters":[{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPricingOverviewDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get all price overrides for a product","tags":["Pricing"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/promotions":{"get":{"operationId":"PromotionsController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"branch_id","required":false,"in":"query","description":"Only promotions that run at this branch","schema":{"format":"uuid","type":"string"}},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["CODE","AUTOMATIC"]}},{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated list of promotions"}},"security":[{"Bearer":[]}],"summary":"List promotions","tags":["Promotions"],"description":"**Access:** ![Permission: read:promotions:restaurant](https://img.shields.io/badge/Permission-read%3Apromotions%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:promotions:restaurant"]}},"post":{"operationId":"PromotionsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromotionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionResponseDto"}}}},"409":{"description":"A promotion already uses this code"}},"security":[{"Bearer":[]}],"summary":"Create a promotion","tags":["Promotions"],"description":"**Access:** ![Permission: manage:promotions:restaurant](https://img.shields.io/badge/Permission-manage%3Apromotions%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:promotions:restaurant"]}}},"/restaurants/{restaurantId}/promotions/{id}":{"get":{"operationId":"PromotionsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a single promotion","tags":["Promotions"],"description":"**Access:** ![Permission: read:promotions:restaurant](https://img.shields.io/badge/Permission-read%3Apromotions%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:promotions:restaurant"]}},"patch":{"description":"**Access:** ![Permission: manage:promotions:restaurant](https://img.shields.io/badge/Permission-manage%3Apromotions%3Arestaurant-green)\n\nChanges apply to new orders only; redeemed orders keep the terms they were sold.","operationId":"PromotionsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePromotionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a promotion","tags":["Promotions"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:promotions:restaurant"]}},"delete":{"description":"**Access:** ![Permission: manage:promotions:restaurant](https://img.shields.io/badge/Permission-manage%3Apromotions%3Arestaurant-green)\n\nSoft delete — past redemptions stay resolvable and the code stays reserved.","operationId":"PromotionsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete a promotion","tags":["Promotions"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:promotions:restaurant"]}}},"/restaurants/{restaurantId}/customer/promotions/validate":{"post":{"description":"Prices the code without consuming it, using the same evaluator order creation runs, so the amount shown here is the amount the order will carry. An unusable code comes back with `valid: false` and a machine-readable `reason` rather than an error status.","operationId":"CustomerPromotionsController_validate","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidatePromotionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionQuoteResponseDto"}}}},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Not a customer token, or restaurant mismatch."}},"security":[{"Bearer":[]}],"summary":"Check a promo code against my cart","tags":["Customer Promotions"]}},"/pos-orders/history":{"get":{"operationId":"CashierOrdersController_history","parameters":[{"name":"x-branch-id","required":true,"in":"header","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"order_type","required":false,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Cashier order history (Flutter `/pos-orders/history`)","tags":["POS orders (cashier)"],"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}}},"/pos-orders/{id}":{"get":{"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)\n\nAn id that is neither a UUID nor a number is looked up as an offline receipt number (`T3-0042`), matched exactly and case-insensitively; the latest match wins.","operationId":"CashierOrdersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-branch-id","required":true,"in":"header","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Cashier order detail by UUID, daily serial, or offline receipt number","tags":["POS orders (cashier)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}}},"/orders/{orderId}/invoice":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns a customer-facing invoice for the given order UUID. No authentication required — designed for QR-code scan flows where the customer scans a code printed on their receipt to view the digital invoice.","operationId":"OrdersPublicController_getInvoice","parameters":[{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicOrderInvoiceDto"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Get public order invoice","tags":["Orders (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/public/restaurants/{restaurantId}/branches/{branchId}/ready-board":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nLean public queue for lobby TVs. Returns only serial numbers for PREPARING and READY orders — no customer PII. Optional `category_ids` scopes Preparing/Ready columns to a station (item-level readiness). Prefer the Socket.IO `/display` namespace (auth: restaurantId + branchId + optional categoryIds) for live updates via `ready-board` events; this HTTP endpoint remains for one-shot reads. Rate-limited to 120 requests/minute per IP (otp throttler skipped).","operationId":"OrdersPublicController_getReadyBoard","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"category_ids","required":false,"in":"query","description":"Optional station category filter (CSV or repeated). Partitions Preparing/Ready by station item readiness.","schema":{"type":"array","items":{"type":"string","format":"uuid"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadyBoardResponseDto"}}}},"404":{"description":"Branch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"Too many requests from this IP; try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Token display / customer waiting board for a branch","tags":["Orders (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/customer/orders":{"get":{"description":"Customer-only. Returns paginated orders belonging to the authenticated customer in this restaurant.","operationId":"CustomerOrderController_findAll","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"example":"PAID,READY","type":"array","items":{"type":"string","enum":["PENDING","ACCEPTED","PREPARING","READY","COMPLETED","CANCELLED","VOIDED","REJECTED"]}}},{"name":"order_type","required":false,"in":"query","schema":{"example":"DINE_IN,DELIVERY","type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]}}},{"name":"payment_status","required":false,"in":"query","description":"Filter by payment status — DEFERRED lists the open credit (آجل) tabs.","schema":{"example":"DEFERRED","type":"array","items":{"type":"string","enum":["PAID","PARTIAL","UNPAID","DEFERRED"]}}},{"name":"start_date","required":false,"in":"query","description":"ISO date string (start inclusive)","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date string (end inclusive)","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","description":"Customer name / phone (contains), serial number, or offline receipt number (`T3-0042`, exact, case-insensitive)","schema":{"type":"string"}},{"name":"staff_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"shift_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"branch_ids","required":false,"in":"query","description":"Branch filter (CSV list, or repeated key) for multi-branch views. Ignored when the `x-branch-id` header is sent, which always wins. Ids the caller cannot access are rejected.","schema":{"type":"array","items":{"type":"string"}}},{"name":"include_voided","required":false,"in":"query","description":"Include voided (soft-deleted) orders","schema":{"default":false,"type":"boolean"}},{"name":"expand","required":false,"in":"query","description":"Comma-separated expand keys: channel,branch,staff,items.product,items.variant,items.options. Customer is always included.","schema":{"example":"channel,branch","type":"array","items":{"type":"string"}}},{"name":"customFieldFilters","required":false,"in":"query","description":"URL-encoded JSON array. Each entry filters one field; values within an entry OR, separate entries AND. e.g. [{\"field_id\":\"<uuid>\",\"values\":[\"Sara\",\"Rawan\"]}]","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated orders list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderResponseDto"}}}}},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Not a customer token, or restaurant mismatch."}},"security":[{"Bearer":[]}],"summary":"List my orders","tags":["Customer Orders"]},"post":{"description":"Customer-only. Converts an active cart into an `Order`. Calculates delivery fee (Haversine) for DELIVERY orders, assigns a dining table for DINE_IN orders with a reservation, stores vehicle details (or customer plate number) for DRIVE_THROUGH, marks the cart as `checked_out`, and notifies the POS kitchen display via WebSocket.","operationId":"CustomerOrderController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerOrderResultDto"}}}},"201":{"description":"Order created. status=PENDING, paymentStatus=UNPAID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerOrderResultDto"}}}},"400":{"description":"Cart is empty, invalid order type, or missing required details."},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Feature `hasOnlineOrdering` is disabled for this restaurant."}},"security":[{"Bearer":[]}],"summary":"Checkout — create order from cart","tags":["Customer Orders"]}},"/restaurants/{restaurantId}/customer/orders/{orderId}":{"get":{"description":"Customer-only. Returns a single order owned by the authenticated customer.","operationId":"CustomerOrderController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Comma-separated expand keys: channel,branch,staff,items.product,items.variant,items.options. Customer is always included.","schema":{"example":"channel,branch,staff,items.product,items.variant,items.options","type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Not a customer token, or restaurant mismatch."}},"security":[{"Bearer":[]}],"summary":"Get my order by id","tags":["Customer Orders"]}},"/restaurants/{restaurantId}/orders":{"get":{"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)\n\nBranch scope resolves in this order: the `x-branch-id` header (single branch), then the `branch_ids` filter (multi-branch), then every branch the caller can access. Pass `includeVoided=true` to include voided orders.","operationId":"OrderController_findAll","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"example":"PAID,READY","type":"array","items":{"type":"string","enum":["PENDING","ACCEPTED","PREPARING","READY","COMPLETED","CANCELLED","VOIDED","REJECTED"]}}},{"name":"order_type","required":false,"in":"query","schema":{"example":"DINE_IN,DELIVERY","type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]}}},{"name":"payment_status","required":false,"in":"query","description":"Filter by payment status — DEFERRED lists the open credit (آجل) tabs.","schema":{"example":"DEFERRED","type":"array","items":{"type":"string","enum":["PAID","PARTIAL","UNPAID","DEFERRED"]}}},{"name":"start_date","required":false,"in":"query","description":"ISO date string (start inclusive)","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date string (end inclusive)","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","description":"Customer name / phone (contains), serial number, or offline receipt number (`T3-0042`, exact, case-insensitive)","schema":{"type":"string"}},{"name":"staff_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"shift_id","required":false,"in":"query","schema":{"type":"string"}},{"name":"branch_ids","required":false,"in":"query","description":"Branch filter (CSV list, or repeated key) for multi-branch views. Ignored when the `x-branch-id` header is sent, which always wins. Ids the caller cannot access are rejected.","schema":{"type":"array","items":{"type":"string"}}},{"name":"include_voided","required":false,"in":"query","description":"Include voided (soft-deleted) orders","schema":{"default":false,"type":"boolean"}},{"name":"expand","required":false,"in":"query","description":"Comma-separated expand keys: channel,branch,staff,items.product,items.variant,items.options. Customer is always included.","schema":{"example":"channel,branch","type":"array","items":{"type":"string"}}},{"name":"customFieldFilters","required":false,"in":"query","description":"URL-encoded JSON array. Each entry filters one field; values within an entry OR, separate entries AND. e.g. [{\"field_id\":\"<uuid>\",\"values\":[\"Sara\",\"Rawan\"]}]","schema":{"type":"string"}},{"name":"payment_method","required":false,"in":"query","description":"Filter by the derived order-level payment method shown in the list. `mixed` = more than one distinct tender; `credit` = still on account (deferred). Values match the response `payment_method`.","schema":{"example":"cash,card","type":"array","items":{"type":"string","enum":["cash","card","digital_wallet","credit","online","other","gift_card","mixed"]}}},{"name":"channel_ids","required":false,"in":"query","description":"Ordering-channel filter (CSV list of channel ids, or repeated key). Matches orders placed through any of the given channels (e.g. Talabat, Jahez). Orders with no channel (walk-in POS) are never matched.","schema":{"minItems":1,"format":"uuid","example":"0d3b2a7e-9c4f-4d2a-8f1e-6b7c8d9e0f12","type":"string"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). When sent, orders are scoped to this branch alone and `branch_ids` is ignored.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Paginated orders list","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}},"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nCreates a DINE_IN, TAKEAWAY, or DELIVERY order. SERVICE orders are **not allowed** here — use `POST /service-bookings` with `create_order: true` so availability is verified before the order is created. Pass `payments` to settle the order in this same request — `PATCH /:id/payment` is then unnecessary and is kept only for settling orders created earlier.","operationId":"OrderController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). Required for staff assigned to more than one branch — the token carries only the branch that was first at login and is not reissued when the cashier switches branch, so without this header the order is booked against the wrong branch. The caller must be assigned to it.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Create POS order (staff-only)","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/kitchen":{"get":{"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)\n\nLean query — no payment or loyalty data. Tickets appear at `PENDING`; kitchen can accept and advance them. Optional `branch_ids` scopes the queue (admins). Branch staff are already limited to their JWT branch. Optional `category_ids` scopes the queue to a station (only matching line items are returned). Connect to the `/pos` Socket.IO namespace with a staff JWT (`auth.token` or `Authorization: Bearer`). The server auto-joins allowed `branch:{id}` rooms. Live events (snake_case payloads): `new_order` (PosNewOrderEventDto, including PENDING create), `order:status-changed` (PosOrderStatusChangedEventDto), `order:ready` (PosOrderReadyEventDto), `order:item-ready` (PosOrderItemReadyEventDto), `order:item-preparing` (PosOrderItemPreparingEventDto), `order:voided` (PosOrderVoidedEventDto), `cashier:notification` (PosCashierNotificationEventDto — the cashier FCM alert, for clients without FCM).","operationId":"OrderController_findKitchenOrders","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branch_ids","required":false,"in":"query","description":"Optional branch filter (CSV or repeated). Admins can scope KDS to one branch.","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"category_ids","required":false,"in":"query","description":"Optional station category filter (CSV or repeated). Returns only matching line items so each KDS station sees its own queue.","schema":{"type":"array","items":{"type":"string","format":"uuid"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KitchenOrdersResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Active orders for kitchen display (PENDING, ACCEPTED, PREPARING, READY)","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/price-quote":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nPrices `items` exactly as `POST /orders` will, including order-level pricing such as an automatic offer's cap, and creates nothing. Same shape as the `data` of an ORDER_PRICES_CHANGED refusal.","operationId":"OrderController_quotePrices","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID), as on `POST /orders`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PosPriceQuoteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PosPriceQuoteResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Price a POS order before taking the tender","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/promotion-quote":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nPrices `items` exactly as `POST /orders` will, then evaluates the code against them. Consumes nothing. Pass the same `promo_code` on create to apply it.","operationId":"OrderController_quotePromotion","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID), as on `POST /orders`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PosPromotionQuoteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionQuoteResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Check a promo code against a POS order before placing it","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}":{"get":{"operationId":"OrderController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Comma-separated expand keys: channel,branch,staff,items.product,items.variant,items.options. Customer is always included.","schema":{"example":"channel,branch,staff,items.product,items.variant,items.options","type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Full order detail (items + options)","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}},"put":{"operationId":"OrderController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePosOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Edit order fields (updatable fields only)","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/status":{"patch":{"operationId":"OrderController_changeStatus","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrdersStatusDto"}}}},"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Manual order status change (validated transitions)","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/accept-reject":{"patch":{"operationId":"OrderController_acceptOrReject","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrdersStatusDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Accept/reject order (stores reject reason in notes)","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{orderId}/items/{itemId}/ready":{"patch":{"operationId":"OrderController_markItemReady","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}},{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderItemReadyDto"}}}},"responses":{"200":{"description":"Order with updated item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"400":{"description":"Invalid item status transition"},"403":{"description":"Insufficient membership role"}},"security":[{"Bearer":[]}],"summary":"Kitchen marks item ready (+ auto-ready overall order)","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{orderId}/items/{itemId}/kitchen-status":{"patch":{"operationId":"OrderController_updateKitchenItemStatus","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}},{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderItemKitchenStatusDto"}}}},"responses":{"200":{"description":"Order with updated item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"400":{"description":"Invalid item or order status transition"},"403":{"description":"Insufficient membership role"}},"security":[{"Bearer":[]}],"summary":"Kitchen sets line-item status (PREPARING then READY). Station-scoped — does not force other stations’ items.","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/payment":{"patch":{"deprecated":true,"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nDeprecated for new POS flows — send `payments` on `POST /restaurants/:restaurantId/orders` instead. Still used to settle an order that was created unpaid.","operationId":"OrderController_recordPayment","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPaymentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Record or update payment on an order","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/payments":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nAppends one payment rather than replacing the tender, so an order can be settled in chunks over time — the deferred (آجل) path, and instalments are the same path used more than once. A cashier taking 10 now and the rest next week records two payments. Each is attributed to the shift that received it, not to the shift that rang up the order. Overpayment is accepted so a mis-key is visible in the data; the order still caps at PAID.","operationId":"OrderController_addPayment","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOrderPaymentDto"}}}},"responses":{"200":{"description":"Order with the payment appended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"400":{"description":"Unknown or inactive payment method"},"404":{"description":"Order not found"}},"security":[{"Bearer":[]}],"summary":"Add a payment to an order","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/payments/{paymentId}":{"patch":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: update:orders:branch](https://img.shields.io/badge/Permission-update%3Aorders%3Abranch-green)\n\nRe-labels the tender of a payment already taken — e.g. keyed as card, actually paid in cash. Only the method changes: the amount, the shift that received it and the order payment status are untouched. If that shift is already closed, its reconciliation (expected cash, variance) is restated; counted figures are kept. Refused with `ORDER_PAYMENT_METHOD_LOCKED` for credit (آجل) orders — including ones since paid off — gift-card and gateway payments, switching to a CREDIT or ONLINE method, and cancelled/voided/rejected orders. Sending the current method is a no-op.","operationId":"OrderController_changePaymentMethod","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"paymentId","required":true,"in":"path","description":"Order payment UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeOrderPaymentMethodDto"}}}},"responses":{"200":{"description":"Order with the payment re-labelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"400":{"description":"Unknown or inactive payment method"},"404":{"description":"Order or payment not found"},"422":{"description":"Payment method is locked (ORDER_PAYMENT_METHOD_LOCKED)"}},"security":[{"Bearer":[]}],"summary":"Change the payment method of one payment","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["update:orders:branch"]}}},"/restaurants/{restaurantId}/orders/{id}/defer":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nMarks the sale as deferred and issues its tax invoice immediately — the supply has happened, and Article 53(7)(b) of the VAT Implementing Regulations puts a simplified invoice at the earlier of supply or receipt of consideration. The order becomes DEFERRED, never PAID: nothing pretends money moved. Collect it later with `POST /orders/:id/payments`, in as many chunks as you like. A part-paid (PARTIAL) order can be deferred: its payments stay and only the remainder becomes debt. A customer is required (the order’s own, or `customer_id` here, which attaches them and snapshots their ZATCA buyer fields). Idempotent.","operationId":"OrderController_deferOrder","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeferOrderDto"}}}},"responses":{"200":{"description":"Order marked deferred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"400":{"description":"Supplied customer not found"},"404":{"description":"Order not found"},"422":{"description":"Order is already fully paid"}},"security":[{"Bearer":[]}],"summary":"Put a sale on the customer account (آجل)","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/cancel":{"patch":{"operationId":"OrderController_cancelOrder","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidOrderResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Cancel an unpaid order (pre-acceptance). Reverses inventory if already deducted.","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/void":{"patch":{"operationId":"OrderController_voidOrder","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidOrderResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Void an order (post-acceptance, pre-payment). Requires reason. Reverses inventory.","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/kitchen/status":{"patch":{"operationId":"OrderController_kitchenStatus","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KitchenStatusDto"}}}},"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Kitchen updates order status (forward path, or REJECTED / VOIDED / CANCELLED). Reason required when rejecting or voiding.","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: KITCHEN](https://img.shields.io/badge/Membership-KITCHEN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"KITCHEN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/returns":{"post":{"operationId":"OrderController_createReturn","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderReturnDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Process a partial or full return on a COMPLETED + PAID order","tags":["Restaurants Orders"],"description":"**Access:** ![Permission: manage:order_returns:branch](https://img.shields.io/badge/Permission-manage%3Aorder__returns%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:order_returns:branch"]}},"get":{"operationId":"OrderController_listReturns","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"Bearer":[]}],"summary":"List all return records for an order","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/refund":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nTracks the actual money handed back. Applies to: returns on COMPLETED+PAID orders, and CANCELLED/VOIDED orders that were paid. Cumulative — call multiple times for partial payouts. Returns the new refunded total and remaining outstanding balance.","operationId":"OrderController_recordRefund","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRefundDto"}}}},"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Record cash physically returned to the customer","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/analytics/loss-summary":{"get":{"operationId":"OrderController_lossSummary","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"date_from","required":true,"in":"query","description":"ISO date start (inclusive)","schema":{"type":"string"}},{"name":"date_to","required":true,"in":"query","description":"ISO date end (inclusive)","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Count and total cost of cancelled, voided, and returned orders","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/analytics/returns-summary":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nFor the date range: return/item counts and quantities, refunded value and average, refunded-vs-non-refunded item split, cash paid back and outstanding, inventory disposition split (none/restock/waste), and partially/fully-returned order counts.","operationId":"OrderController_returnsSummary","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"date_from","required":true,"in":"query","description":"ISO date start (inclusive)","schema":{"type":"string"}},{"name":"date_to","required":true,"in":"query","description":"ISO date end (inclusive)","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Detailed returns & refunds report","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{id}/items/{itemId}":{"patch":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nOnly allowed while the order is PENDING. Changing quantity recalculates subtotal, tax, service charge, discount, and total.","operationId":"OrderController_updateOrderItem","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrderItemDto"}}}},"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Update quantity or notes on a PENDING order item","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{orderId}/items":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nWorks for both table-session (DINE_IN) and service-booking (SERVICE) orders. Items are created with status PENDING. No stock is deducted at this point — deduction happens on send-to-kitchen (DINE_IN) or payment (SERVICE).","operationId":"OrderController_addTableSessionItems","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddTableSessionItemsDto"}}}},"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Add items to an open DINE_IN or SERVICE order","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{orderId}/items/{itemId}":{"delete":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nOnly allowed while the order status is PENDING. Recalculates subtotal, tax, service charge, discount, and total. Cannot remove the last item — cancel the order instead.","operationId":"OrderController_removeTableSessionItem","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}},{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Remove an item from a PENDING order","tags":["Restaurants Orders"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{orderId}/send-to-kitchen":{"post":{"operationId":"OrderController_sendToKitchen","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Fire all PENDING items to kitchen — transitions to PREPARING and deducts stock","tags":["Restaurants Orders"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/order-payments":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nEvery `OrderPayment` in the range, newest first, with the order it settled. A split order contributes one row per tender. Dates filter the payment, not the order, so a ticket opened before midnight and settled after it lands on the day the money arrived. `totals` covers every payment matching the filters, not just the current page. Branch scope resolves in this order: the `x-branch-id` header, then `branch_ids`, then every branch the caller can access.","operationId":"OrderPaymentsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"start_date","required":false,"in":"query","description":"ISO date string — payments taken at or after this instant","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date string — payments taken at or before this instant","schema":{"type":"string"}},{"name":"branch_ids","required":false,"in":"query","description":"Branch filter (CSV list, or repeated key). Ignored when the `x-branch-id` header is sent, which always wins. Ids the caller cannot access are rejected.","schema":{"type":"array","items":{"type":"string"}}},{"name":"payment_method_ids","required":false,"in":"query","description":"Restaurant payment method ids (CSV list) the payment was taken on.","schema":{"type":"array","items":{"type":"string"}}},{"name":"payment_method_types","required":false,"in":"query","description":"Tender kind, for grouping across differently-named methods.","schema":{"example":"CASH,CARD","type":"array","items":{"type":"string","enum":["CASH","CARD","DIGITAL_WALLET","ONLINE","OTHER"]}}},{"name":"is_gift_card","required":false,"in":"query","description":"true → gift-card redemptions only; false → payment-method entries only. Omit for both.","schema":{"type":"boolean"}},{"name":"order_id","required":false,"in":"query","description":"Every payment on one order.","schema":{"format":"uuid","type":"string"}},{"name":"search","required":false,"in":"query","description":"Order serial number, customer name / phone, or a gateway invoice or bank reference (exact).","schema":{"type":"string"}},{"name":"include_voided","required":false,"in":"query","description":"Include payments belonging to voided (soft-deleted) orders.","schema":{"default":false,"type":"boolean"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID). When sent, payments are scoped to this branch alone and `branch_ids` is ignored.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPaymentListResponseDto"}}}},"401":{"description":"Missing or invalid staff JWT."},"403":{"description":"No access to the requested branch."}},"security":[{"Bearer":[]}],"summary":"Payment ledger — one row per payment taken","tags":["Restaurants Order Payments"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/order-payments/outstanding":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nThe ledger’s complement: totals across every order in scope that is still UNPAID or PARTIAL, excluding cancelled, voided and rejected tickets. Honours `start_date`, `end_date` (on the order) and the same branch scoping as the ledger; other filters are ignored.","operationId":"OrderPaymentsController_outstanding","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"start_date","required":false,"in":"query","description":"ISO date string — payments taken at or after this instant","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date string — payments taken at or before this instant","schema":{"type":"string"}},{"name":"branch_ids","required":false,"in":"query","description":"Branch filter (CSV list, or repeated key). Ignored when the `x-branch-id` header is sent, which always wins. Ids the caller cannot access are rejected.","schema":{"type":"array","items":{"type":"string"}}},{"name":"payment_method_ids","required":false,"in":"query","description":"Restaurant payment method ids (CSV list) the payment was taken on.","schema":{"type":"array","items":{"type":"string"}}},{"name":"payment_method_types","required":false,"in":"query","description":"Tender kind, for grouping across differently-named methods.","schema":{"example":"CASH,CARD","type":"array","items":{"type":"string","enum":["CASH","CARD","DIGITAL_WALLET","ONLINE","OTHER"]}}},{"name":"is_gift_card","required":false,"in":"query","description":"true → gift-card redemptions only; false → payment-method entries only. Omit for both.","schema":{"type":"boolean"}},{"name":"order_id","required":false,"in":"query","description":"Every payment on one order.","schema":{"format":"uuid","type":"string"}},{"name":"search","required":false,"in":"query","description":"Order serial number, customer name / phone, or a gateway invoice or bank reference (exact).","schema":{"type":"string"}},{"name":"include_voided","required":false,"in":"query","description":"Include payments belonging to voided (soft-deleted) orders.","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutstandingSummaryDto"}}}},"401":{"description":"Missing or invalid staff JWT."},"403":{"description":"No access to the requested branch."}},"security":[{"Bearer":[]}],"summary":"Money not taken yet","tags":["Restaurants Order Payments"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/scheduled-slots/full":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe e-menu time picker leaves these steps out. No customer data: only the step starts.","operationId":"ScheduledSlotsPublicController_getFullSlots","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","description":"Window start (ISO 8601)","schema":{"example":"2026-11-30T00:00:00.000Z","type":"string"}},{"name":"to","required":true,"in":"query","description":"Window end, exclusive (ISO 8601). Cut to max_days_ahead + 1 day after from.","schema":{"example":"2026-12-01T00:00:00.000Z","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullScheduledSlotsResponseDto"}}}}},"summary":"Scheduled-order slots that are fully booked","tags":["Customer Scheduled Orders"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/zatca/onboarding/status":{"get":{"operationId":"ZatcaOnboardingController_getStatus","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Current ZATCA onboarding status for the active restaurant","tags":["Restaurants - ZATCA Onboarding"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/zatca/onboarding/csr":{"post":{"operationId":"ZatcaOnboardingController_generateCsr","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCsrDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Generate a keypair + CSR for this restaurant’s EGS unit","tags":["Restaurants - ZATCA Onboarding"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/zatca/onboarding/compliance-csid":{"post":{"operationId":"ZatcaOnboardingController_submitComplianceCsid","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitOtpDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Exchange the CSR + OTP (from the ZATCA Fatoora portal) for a Compliance CSID","tags":["Restaurants - ZATCA Onboarding"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/zatca/onboarding/compliance-checks":{"post":{"operationId":"ZatcaOnboardingController_runComplianceChecks","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Run the required sample-invoice compliance checks against ZATCA","tags":["Restaurants - ZATCA Onboarding"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/zatca/onboarding/production-csid":{"post":{"operationId":"ZatcaOnboardingController_requestProductionCsid","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Issue the long-lived Production CSID once compliance checks pass","tags":["Restaurants - ZATCA Onboarding"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/zatca/onboarding/renewal":{"patch":{"operationId":"ZatcaOnboardingController_renew","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewCsidDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Renew the Production CSID ahead of expiry","tags":["Restaurants - ZATCA Onboarding"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/zatca/onboarding":{"delete":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nClears the CSR, private key, and both CSIDs so the restaurant can re-onboard from scratch. Does not delete the registration row or affect historical invoices/the ICV-PIH chain. Irreversible for the cleared key material — the private key is not recoverable once cleared.","operationId":"ZatcaOnboardingController_unlink","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Unlink ZATCA — reset onboarding to start over (new CSR, new CSIDs)","tags":["Restaurants - ZATCA Onboarding"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/orders/{orderId}/zatca-invoices":{"get":{"operationId":"ZatcaInvoiceStatusController_listForOrder","parameters":[{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ZatcaInvoiceStatusResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"ZATCA invoice/credit-note history for an order","tags":["Restaurants - ZATCA"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/zatca-invoices":{"get":{"description":"**Access:** ![Permission: read:zatca_invoices:restaurant](https://img.shields.io/badge/Permission-read%3Azatca__invoices%3Arestaurant-green)\n\nPaginated, filterable list of every ZATCA invoice/credit-note/debit-note submitted for the restaurant. Filter by status, submission type, invoice type, date range, or search (order serial number / buyer name).","operationId":"ZatcaInvoiceListController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"example":"REPORTED,CLEARED","type":"array","items":{"type":"string","enum":["PENDING","COMPLIANCE_CHECK_PENDING","COMPLIANCE_CHECK_PASSED","COMPLIANCE_CHECK_FAILED","QUEUED_FOR_SUBMISSION","CLEARANCE_PENDING","REPORTED","CLEARED","WARNING","REJECTED","FAILED","SLA_EXCEEDED"]}}},{"name":"submission_type","required":false,"in":"query","schema":{"example":"CLEARANCE","type":"array","items":{"type":"string","enum":["REPORTING","CLEARANCE"]}}},{"name":"invoice_type","required":false,"in":"query","schema":{"example":"STANDARD,CREDIT_NOTE","type":"array","items":{"type":"string","enum":["STANDARD","CREDIT_NOTE","DEBIT_NOTE"]}}},{"name":"start_date","required":false,"in":"query","description":"ISO date string (start inclusive)","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date string (end inclusive)","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","description":"Order serial number or buyer name","schema":{"maxLength":120,"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZatcaInvoiceListResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"List ZATCA invoices","tags":["Restaurants - ZATCA"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:zatca_invoices:restaurant"]}}},"/restaurants/{restaurantId}/zatca-invoices/{id}":{"get":{"operationId":"ZatcaInvoiceListController_detail","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZatcaInvoiceDetailDto"}}}}},"security":[{"Bearer":[]}],"summary":"ZATCA invoice detail","tags":["Restaurants - ZATCA"],"description":"**Access:** ![Permission: read:zatca_invoices:restaurant](https://img.shields.io/badge/Permission-read%3Azatca__invoices%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:zatca_invoices:restaurant"]}}},"/restaurants/{restaurantId}/zatca-invoices/{id}/xml":{"get":{"description":"**Access:** ![Permission: read:zatca_invoices:restaurant](https://img.shields.io/badge/Permission-read%3Azatca__invoices%3Arestaurant-green)\n\nReturns the raw signed or ZATCA-cleared XML document for one invoice, as text/xml. Fetched on demand — never inlined in the list/detail JSON.","operationId":"ZatcaInvoiceListController_xml","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"type","required":true,"in":"query","schema":{"type":"string","enum":["signed","cleared"]}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"ZATCA invoice XML","tags":["Restaurants - ZATCA"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:zatca_invoices:restaurant"]}}},"/super-admin/zatca-invoices/resubmit":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nResets matching invoices and pushes them onto the ZATCA queue, bypassing the retry sweep's 24h SLA cut-off. Credit/debit notes signed without a KSA-10 reason are rebuilt automatically. Use dry_run to preview.","operationId":"ZatcaResubmitController_resubmit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResubmitZatcaInvoicesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResubmitZatcaInvoicesResponseDto"}}}},"401":{"description":"Not authenticated"},"403":{"description":"Requires SUPER_ADMIN"}},"security":[{"Bearer":[]}],"summary":"Re-queue failed / SLA-exceeded ZATCA invoices (SUPER_ADMIN only)","tags":["Super Admin - ZATCA"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/loyalty-pass/themes":{"post":{"operationId":"LoyaltyPassController_createTheme","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateThemeSettingDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a loyalty pass theme","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}},"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: read:loyalty:restaurant](https://img.shields.io/badge/Permission-read%3Aloyalty%3Arestaurant-green)\n\nActive themes only by default. Pass `include_archived=true` to include archived ones.","operationId":"LoyaltyPassController_listThemes","parameters":[{"name":"include_archived","required":false,"in":"query","description":"When true, archived themes are returned alongside active ones.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"}}}}}},"security":[{"bearer":[]}],"summary":"List loyalty pass themes for the restaurant","tags":["Loyalty Pass"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["read:loyalty:restaurant"]}}},"/loyalty-pass/themes/{themeId}":{"get":{"operationId":"LoyaltyPassController_findTheme","parameters":[{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"}}}},"404":{"description":"Theme not found"}},"security":[{"bearer":[]}],"summary":"Get a single loyalty pass theme","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: read:loyalty:restaurant](https://img.shields.io/badge/Permission-read%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["read:loyalty:restaurant"]}},"put":{"operationId":"LoyaltyPassController_updateTheme","parameters":[{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThemeSettingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"}}}},"404":{"description":"Theme not found"}},"security":[{"bearer":[]}],"summary":"Update a loyalty pass theme","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}},"delete":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)\n\nSoft-deletes the theme. Existing customer passes keep working until they remove them from their wallets; no new passes can be issued. Reverse with POST /themes/:themeId/unarchive.","operationId":"LoyaltyPassController_archiveTheme","parameters":[{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"}}}},"404":{"description":"Theme not found"}},"security":[{"bearer":[]}],"summary":"Archive a loyalty pass theme (soft delete)","tags":["Loyalty Pass"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/themes/{themeId}/unarchive":{"post":{"operationId":"LoyaltyPassController_unarchiveTheme","parameters":[{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"}}}},"404":{"description":"Theme not found"}},"security":[{"bearer":[]}],"summary":"Restore a previously archived theme","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/passes":{"get":{"operationId":"LoyaltyPassController_listPasses","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"theme_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassListDto"}}}}},"security":[{"bearer":[]}],"summary":"Paginated list of customer passes for this restaurant","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: read:loyalty:restaurant](https://img.shields.io/badge/Permission-read%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["read:loyalty:restaurant"]}}},"/loyalty-pass/passes/{passSerial}":{"get":{"operationId":"LoyaltyPassController_getPass","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}},"404":{"description":"Pass not found"}},"security":[{"bearer":[]}],"summary":"Get a single pass by serial","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}},"delete":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)\n\nMarks the pass as voided. Apple Wallet shows it as expired/grey on the customer's device after the next refresh. Stamp/redeem operations are blocked server-side. Reverse with POST /passes/:passSerial/unvoid.","operationId":"LoyaltyPassController_voidPass","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}},"404":{"description":"Pass not found"}},"security":[{"bearer":[]}],"summary":"Void a pass (soft delete)","tags":["Loyalty Pass"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/passes/{passSerial}/stamps":{"post":{"operationId":"LoyaltyPassController_addStamps","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddStampsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}},"404":{"description":"Pass not found"}},"security":[{"bearer":[]}],"summary":"Add stamps to a pass (capped at totalStamps)","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/passes/{passSerial}/redeem":{"post":{"operationId":"LoyaltyPassController_redeemPass","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}},"404":{"description":"Pass not found"}},"security":[{"bearer":[]}],"summary":"Redeem a complete pass — resets stamps to 0","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: apply:loyalty:branch](https://img.shields.io/badge/Permission-apply%3Aloyalty%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["apply:loyalty:branch"]}}},"/loyalty-pass/passes/{passSerial}/redemptions":{"get":{"operationId":"LoyaltyPassController_getRedemptions","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyPassRedemptionDto"}}}}}},"security":[{"bearer":[]}],"summary":"Get redemption history for a pass","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: read:loyalty:restaurant](https://img.shields.io/badge/Permission-read%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["read:loyalty:restaurant"]}}},"/loyalty-pass/passes/{passSerial}/unvoid":{"post":{"operationId":"LoyaltyPassController_unvoidPass","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}},"404":{"description":"Pass not found"}},"security":[{"bearer":[]}],"summary":"Restore a previously voided pass","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/icons":{"get":{"operationId":"LoyaltyPassController_listIcons","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyPassIconDto"}}}}}},"security":[{"bearer":[]}],"summary":"List available stamp icons (public library + this restaurant's custom icons)","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: read:loyalty:restaurant](https://img.shields.io/badge/Permission-read%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["read:loyalty:restaurant"]}},"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)\n\nA pass draws four stamp artworks: `icon_light_on` / `icon_light_off` (light glyphs for dark cards, collected and not-yet-collected) and `icon_dark_on` / `icon_dark_off` (dark glyphs for light cards). Send them individually, or send a single `file` part to use one image for every state. `hero_image` is the optional card background and falls back to the collected artwork.","operationId":"LoyaltyPassController_createCustomIcon","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"icon_light_on":{"type":"string","format":"binary"},"icon_light_off":{"type":"string","format":"binary"},"icon_dark_on":{"type":"string","format":"binary"},"icon_dark_off":{"type":"string","format":"binary"},"hero_image":{"type":"string","format":"binary"},"icon_name":{"type":"string","example":"house-special"},"display_name":{"type":"string","example":"{\"en\":\"House Special\",\"ar\":\"الخاصة\"}"}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassIconDto"}}}},"400":{"description":"No file provided or unsupported type"}},"security":[{"bearer":[]}],"summary":"Upload a custom stamp icon","tags":["Loyalty Pass"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/icons/{iconId}":{"delete":{"operationId":"LoyaltyPassController_deleteCustomIcon","parameters":[{"name":"iconId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Icon not found"}},"security":[{"bearer":[]}],"summary":"Delete a custom stamp icon owned by this restaurant","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/promotional-alert":{"post":{"operationId":"LoyaltyPassController_sendPromotionalAlert","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoAlertDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoAlertResultDto"}}}}},"security":[{"bearer":[]}],"summary":"Send a promotional push alert to all registered Apple Wallet devices","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/geolocation-message":{"get":{"operationId":"LoyaltyPassController_getGeoAlertMessage","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeoAlertSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Get the geolocation alert message + geofence radius","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: read:loyalty:restaurant](https://img.shields.io/badge/Permission-read%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["read:loyalty:restaurant"]}},"put":{"operationId":"LoyaltyPassController_setGeoAlertMessage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeoAlertMessageDto"}}}},"responses":{"204":{"description":"Geo settings updated and pushed to devices"}},"security":[{"bearer":[]}],"summary":"Set the geolocation alert message + geofence radius","tags":["Loyalty Pass"],"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet) ![Permission: manage:loyalty:restaurant](https://img.shields.io/badge/Permission-manage%3Aloyalty%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":["manage:loyalty:restaurant"]}}},"/loyalty-pass/public/themes/{themeId}":{"get":{"operationId":"LoyaltyPassPublicController_findTheme","parameters":[{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"}}}},"404":{"description":"Theme not found"}},"summary":"Get a theme by ID (no auth required)","tags":["Loyalty Pass (Public)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/loyalty-pass/public/themes/{themeId}/passes":{"post":{"operationId":"LoyaltyPassPublicController_createPass","parameters":[{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLoyaltyPassDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}},"404":{"description":"Theme not found"}},"summary":"Create or retrieve a loyalty pass for a customer by phone number","tags":["Loyalty Pass (Public)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/loyalty-pass/public/themes/{themeId}/join":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nSend `phone_no` only to check if the customer exists. Returns `needs_registration` when the phone is unknown — resend with `user_name` to create the customer and their pass. Returns `found` (existing pass) or `created` (new pass) on success.","operationId":"LoyaltyPassPublicController_joinAsCustomer","parameters":[{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinLoyaltyPassDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassJoinResultDto"}}}},"404":{"description":"Theme not found"}},"summary":"QR registration flow — look up or register a customer and issue their pass","tags":["Loyalty Pass (Public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/loyalty-pass/public/passes/{passSerial}":{"get":{"operationId":"LoyaltyPassPublicController_getPass","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}},"404":{"description":"Pass not found"}},"summary":"Get pass details by serial (no auth required)","tags":["Loyalty Pass (Public)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/loyalty-pass/public/passes/{passSerial}/apple-wallet":{"get":{"operationId":"LoyaltyPassPublicController_getAppleWalletPass","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""},"404":{"description":"Pass not found"}},"summary":"Download .pkpass file for Apple Wallet","tags":["Loyalty Pass (Public)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/loyalty-pass/public/passes/{passSerial}/google-wallet":{"get":{"operationId":"LoyaltyPassPublicController_getGoogleWalletPass","parameters":[{"name":"passSerial","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleWalletLinkDto"}}}},"404":{"description":"Pass not found"}},"summary":"Get Google Wallet \"Save to Wallet\" link","tags":["Loyalty Pass (Public)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/loyalty-pass/public/icons":{"get":{"operationId":"LoyaltyPassPublicController_listIcons","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyPassIconDto"}}}}}},"summary":"List available stamp icons (no auth required)","tags":["Loyalty Pass (Public)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/customer/loyalty-passes":{"get":{"description":"Customer-only. Returns active (non-voided) loyalty passes for the authenticated customer at this restaurant.","operationId":"CustomerAccountLoyaltyController_listMine","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyPassDto"}}}}},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Not a customer token, or restaurant mismatch."}},"security":[{"Bearer":[]}],"summary":"List my loyalty passes","tags":["Customer Account"]}},"/super-admin/loyalty-pass-icons":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-read%3Aloyalty__pass__icons%3Aplatform-green)\n\nPlatform-wide icons only (restaurant-uploaded custom icons are private to their restaurant). Each row carries `themes_count` — how many restaurant themes are currently using it.","operationId":"LoyaltyPassIconsSuperAdminController_list","parameters":[{"name":"include_archived","required":false,"in":"query","description":"Include archived (retired) icons in the response. Defaults to false.","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlatformIconDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List the platform stamp icon library","tags":["Super Admin — Loyalty Stamp Icons"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:loyalty_pass_icons:platform"]}},"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-manage%3Aloyalty__pass__icons%3Aplatform-green) ![Permission: read:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-read%3Aloyalty__pass__icons%3Aplatform-green)\n\nA pass draws four stamp artworks: `icon_light_on` / `icon_light_off` (light glyphs for dark cards, collected and not-yet-collected) and `icon_dark_on` / `icon_dark_off` (dark glyphs for light cards). Send them individually, or send a single `file` part to use one image for every state. `hero_image` is the optional card background and falls back to the collected artwork.","operationId":"LoyaltyPassIconsSuperAdminController_create","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"icon_light_on":{"type":"string","format":"binary"},"icon_light_off":{"type":"string","format":"binary"},"icon_dark_on":{"type":"string","format":"binary"},"icon_dark_off":{"type":"string","format":"binary"},"hero_image":{"type":"string","format":"binary"},"icon_name":{"type":"string","example":"coffee-cup"},"display_name":{"type":"string","example":"{\"en\":\"Coffee\",\"ar\":\"قهوة\"}"}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIconDto"}}}},"400":{"description":"No file provided or unsupported type"},"409":{"description":"An icon with that name already exists in the library"}},"security":[{"Bearer":[]}],"summary":"Add a stamp icon to the platform library","tags":["Super Admin — Loyalty Stamp Icons"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:loyalty_pass_icons:platform","read:loyalty_pass_icons:platform"]}}},"/super-admin/loyalty-pass-icons/{iconId}":{"get":{"operationId":"LoyaltyPassIconsSuperAdminController_findOne","parameters":[{"name":"iconId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIconDto"}}}},"404":{"description":"Icon not found"}},"security":[{"Bearer":[]}],"summary":"Get one platform stamp icon","tags":["Super Admin — Loyalty Stamp Icons"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-read%3Aloyalty__pass__icons%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:loyalty_pass_icons:platform"]}},"patch":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-manage%3Aloyalty__pass__icons%3Aplatform-green) ![Permission: read:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-read%3Aloyalty__pass__icons%3Aplatform-green)\n\nOmitted fields and omitted file parts keep their current value. Replacing the artwork updates it for every theme already using the icon. `icon_name` is immutable — it is the stable key the seed importer and saved themes match on.","operationId":"LoyaltyPassIconsSuperAdminController_update","parameters":[{"name":"iconId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"icon_light_on":{"type":"string","format":"binary"},"icon_light_off":{"type":"string","format":"binary"},"icon_dark_on":{"type":"string","format":"binary"},"icon_dark_off":{"type":"string","format":"binary"},"hero_image":{"type":"string","format":"binary"},"display_name":{"type":"string","example":"{\"en\":\"Coffee\",\"ar\":\"قهوة\"}"}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIconDto"}}}},"404":{"description":"Icon not found"}},"security":[{"Bearer":[]}],"summary":"Update a platform stamp icon (labels and/or artwork)","tags":["Super Admin — Loyalty Stamp Icons"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:loyalty_pass_icons:platform","read:loyalty_pass_icons:platform"]}}},"/super-admin/loyalty-pass-icons/{iconId}/archive":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-manage%3Aloyalty__pass__icons%3Aplatform-green) ![Permission: read:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-read%3Aloyalty__pass__icons%3Aplatform-green)\n\nHides the icon from every restaurant picker and blocks it for new themes. Themes already using it — and the wallet passes issued from them — keep working. Reversible via /restore.","operationId":"LoyaltyPassIconsSuperAdminController_archive","parameters":[{"name":"iconId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIconDto"}}}},"404":{"description":"Icon not found"}},"security":[{"Bearer":[]}],"summary":"Retire an icon from the library","tags":["Super Admin — Loyalty Stamp Icons"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:loyalty_pass_icons:platform","read:loyalty_pass_icons:platform"]}}},"/super-admin/loyalty-pass-icons/{iconId}/restore":{"post":{"operationId":"LoyaltyPassIconsSuperAdminController_restore","parameters":[{"name":"iconId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformIconDto"}}}},"404":{"description":"Icon not found"}},"security":[{"Bearer":[]}],"summary":"Return a retired icon to the library","tags":["Super Admin — Loyalty Stamp Icons"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-manage%3Aloyalty__pass__icons%3Aplatform-green) ![Permission: read:loyalty_pass_icons:platform](https://img.shields.io/badge/Permission-read%3Aloyalty__pass__icons%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:loyalty_pass_icons:platform","read:loyalty_pass_icons:platform"]}}},"/restaurants/{restaurantId}/media/upload":{"post":{"operationId":"MediaController_upload","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"folder","required":true,"in":"query","schema":{"example":"products","type":"string","enum":["products","categories","assets","variants","branches","expenses","logos","loyalty-icons","loyalty-hero","emenu-hero","emenu-banner","emenu-themes"]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponseDto"}}}},"201":{"description":"Image uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponseDto"}}}},"400":{"description":"No file provided or unsupported type"},"401":{"description":"Not authenticated"},"403":{"description":"Insufficient restaurant membership"}},"summary":"Upload and process an image; returns a public CDN URL","tags":["Media"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/customers/{customerId}/loyalty-history":{"get":{"description":"**Access:** ![Permission: read:loyalty:restaurant](https://img.shields.io/badge/Permission-read%3Aloyalty%3Arestaurant-green)\n\nReturns a paginated, newest-first ledger of all loyalty earn, redeem, and expire events for the customer. Filterable by transaction type. Use `expand=order` to include order summary on each row.","operationId":"LoyaltyPointsController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"customerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["EARN","REDEEM","EXPIRE","ADJUSTMENT"]}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load: `?expand=order`","schema":{"type":"array","items":{"type":"string","enum":["order"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyTransactionListDto"}}}}},"summary":"List loyalty point transactions for a customer","tags":["Loyalty Points"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:loyalty:restaurant"]}}},"/restaurants/{restaurantId}/service-bookings":{"get":{"operationId":"ServiceBookingsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"staff_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"customer_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["PENDING_ADVANCE","SCHEDULED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW"]}},{"name":"date","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":200,"default":50,"type":"number"}},{"name":"expand","required":false,"in":"query","description":"Comma-separated expand keys: staff, customer, product","schema":{"example":"staff,customer,product","type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBookingListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List service bookings with optional filters","tags":["Service Bookings"],"description":"**Access:** ![Permission: read:service_bookings:restaurant](https://img.shields.io/badge/Permission-read%3Aservice__bookings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:service_bookings:restaurant"]}},"post":{"operationId":"ServiceBookingsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateServiceBookingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBookingDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBookingDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a service booking (walk-in if staffId absent or scheduledAt ≤ now+15m)","tags":["Service Bookings"],"description":"**Access:** ![Permission: manage:service_bookings:restaurant](https://img.shields.io/badge/Permission-manage%3Aservice__bookings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:service_bookings:restaurant"]}}},"/restaurants/{restaurantId}/service-bookings/available-slots":{"get":{"operationId":"ServiceBookingsController_availableSlots","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"staff_id","required":true,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"product_id","required":true,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"branch_id","required":true,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"date","required":true,"in":"query","description":"YYYY-MM-DD date in local time","schema":{"example":"2026-06-20","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableSlotsResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get available time slots for a staff member on a given date","tags":["Service Bookings"],"description":"**Access:** ![Permission: read:service_bookings:restaurant](https://img.shields.io/badge/Permission-read%3Aservice__bookings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:service_bookings:restaurant"]}}},"/restaurants/{restaurantId}/service-bookings/{id}":{"get":{"operationId":"ServiceBookingsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBookingDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a single service booking","tags":["Service Bookings"],"description":"**Access:** ![Permission: read:service_bookings:restaurant](https://img.shields.io/badge/Permission-read%3Aservice__bookings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:service_bookings:restaurant"]}},"patch":{"operationId":"ServiceBookingsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateServiceBookingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBookingDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a booking (reschedule, assign staff, change status)","tags":["Service Bookings"],"description":"**Access:** ![Permission: manage:service_bookings:restaurant](https://img.shields.io/badge/Permission-manage%3Aservice__bookings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:service_bookings:restaurant"]}},"delete":{"operationId":"ServiceBookingsController_cancel","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Cancel a service booking","tags":["Service Bookings"],"description":"**Access:** ![Permission: manage:service_bookings:restaurant](https://img.shields.io/badge/Permission-manage%3Aservice__bookings%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:service_bookings:restaurant"]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/services/{productId}/staff":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns the staff members who can perform this service. Use this to populate a staff picker before checkout.","operationId":"CustomerServiceBookingsController_getStaffForService","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","description":"Service product UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicStaffForServiceDto"}}}}}},"summary":"List staff assigned to a service product at this branch","tags":["Customer Service Bookings"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/services/{productId}/available-staff":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns staff assigned to this service at this branch who have one or more free start times on the given local date, including those slots. Staff with no free slots are omitted. Slots are HH:mm in the branch timezone.","operationId":"CustomerServiceBookingsController_getAvailableStaff","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","description":"Service product UUID","schema":{"type":"string"}},{"name":"date","required":true,"in":"query","description":"YYYY-MM-DD in the branch timezone","schema":{"example":"2026-06-22","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableStaffForDateResponseDto"}}}}},"summary":"List assigned staff who have at least one free slot on a date","tags":["Customer Service Bookings"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/services/{productId}/occupancy":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nFor a service with a slot capacity and no assigned staff at this branch: the capacity and the time blocks already taken on the local date (branch timezone). No customer data.","operationId":"CustomerServiceBookingsController_getOccupancy","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","description":"Service product UUID","schema":{"type":"string"}},{"name":"date","required":true,"in":"query","description":"YYYY-MM-DD in the branch timezone","schema":{"example":"2026-06-22","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffLessOccupancyResponseDto"}}}}},"summary":"Seats taken on a date for a service booked without staff","tags":["Customer Service Bookings"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/emenu/services/{productId}/staff/{staffId}/available-slots":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns HH:mm start times (branch local time) when the staff member is free to perform this service. Slots are stepped by serviceDuration + serviceBuffer so they never overlap.","operationId":"CustomerServiceBookingsController_getAvailableSlots","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","description":"Branch UUID","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","description":"Service product UUID","schema":{"type":"string"}},{"name":"staffId","required":true,"in":"path","description":"Staff member UUID","schema":{"type":"string"}},{"name":"date","required":true,"in":"query","description":"YYYY-MM-DD in local branch time","schema":{"example":"2026-06-22","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableSlotsResponseDto"}}}}},"summary":"Get available time slots for a staff member on a given date","tags":["Customer Service Bookings"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/customer/service-bookings":{"get":{"description":"Customer-only. Returns paginated service bookings for the authenticated customer. Any client-supplied `customer_id` is ignored; ownership is taken from the JWT.","operationId":"CustomerAccountServiceBookingsController_listMine","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"staff_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"customer_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["PENDING_ADVANCE","SCHEDULED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW"]}},{"name":"date","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":200,"default":50,"type":"number"}},{"name":"expand","required":false,"in":"query","description":"Comma-separated expand keys: staff, customer, product","schema":{"example":"staff,customer,product","type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBookingListDto"}}}},"401":{"description":"Missing or invalid customer JWT."},"403":{"description":"Not a customer token, or restaurant mismatch."}},"security":[{"Bearer":[]}],"summary":"List my service bookings","tags":["Customer Account"]}},"/staff":{"get":{"description":"**Access:** ![Permission: read:staff:restaurant](https://img.shields.io/badge/Permission-read%3Astaff%3Arestaurant-green)\n\nPaginated list of memberships in the active restaurant. Supports search (`q`), multi-select role and status filters, and contact-only search. Requires `read:staff:restaurant` (RESTAURANT_ADMIN bypasses).","operationId":"StaffController_listMembers","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"role","required":false,"in":"query","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["RESTAURANT_ADMIN","BRANCH_MANAGER","CASHIER","WAITER","KITCHEN","SERVICE_PROVIDER"]}}},{"name":"q","required":false,"in":"query","schema":{"maxLength":120,"type":"string"}},{"name":"contact","required":false,"in":"query","schema":{"maxLength":120,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["active","inactive"]}}},{"name":"branch_id","required":false,"in":"query","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","format":"uuid"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffListResponseDto"}}}}},"summary":"List staff members","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:staff:restaurant"]}},"post":{"description":"**Access:** ![Permission: manage:staff:restaurant](https://img.shields.io/badge/Permission-manage%3Astaff%3Arestaurant-green)\n\nAttaches an existing user to the restaurant with the given role. Default permissions for the role are seeded automatically; admins can refine them via `PUT /memberships/:userId/permissions`. Requires `manage:staff:restaurant`.","operationId":"StaffController_addMember","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMembershipDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffMemberDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffMemberDto"}}}}},"summary":"Add a staff member","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:staff:restaurant"]}}},"/staff/{userId}/role":{"put":{"description":"**Access:** ![Permission: manage:staff:restaurant](https://img.shields.io/badge/Permission-manage%3Astaff%3Arestaurant-green)\n\nAssigns a new `MembershipRole` to the user. Resets `permissions` to the role’s defaults and bumps `permissionsVersion`, which immediately revokes any active session for this membership. Requires `manage:staff:restaurant`.","operationId":"StaffController_updateMemberRole","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMembershipRoleDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffMemberDto"}}}}},"summary":"Change a staff member’s role","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:staff:restaurant"]}}},"/staff/{userId}":{"put":{"description":"**Access:** ![Permission: manage:staff:restaurant](https://img.shields.io/badge/Permission-manage%3Astaff%3Arestaurant-green)\n\nPartial update of the underlying `User` row: `name`, `nameAr`, `email`, `phone`, `password`, `isActive`. Only sent fields are updated; `null` clears nullable fields, omitting leaves them unchanged. Returns 409 on duplicate email/phone. Requires `manage:staff:restaurant`.","operationId":"StaffController_updateStaffUser","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStaffUserDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffMemberDto"}}}}},"summary":"Edit a staff member’s user data","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:staff:restaurant"]}},"delete":{"description":"**Access:** ![Permission: manage:staff:restaurant](https://img.shields.io/badge/Permission-manage%3Astaff%3Arestaurant-green)\n\nDeletes the membership; the underlying `User` row stays intact (the user can still belong to other restaurants). Active sessions for this membership are revoked immediately because `JwtStrategy` rejects tokens whose membership no longer exists. Requires `manage:staff:restaurant`.","operationId":"StaffController_removeMember","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Membership removed."}},"summary":"Remove a staff member","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:staff:restaurant"]}}},"/staff/{userId}/branches":{"get":{"description":"**Access:** ![Permission: read:staff:restaurant](https://img.shields.io/badge/Permission-read%3Astaff%3Arestaurant-green)\n\nReturns every `BranchAssignment` for `userId` within the active restaurant. The user must already have a membership here. Requires `read:staff:restaurant`.","operationId":"StaffController_listMemberBranches","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchAssignmentDto"}}}}}},"summary":"List a staff member’s branch assignments","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:staff:restaurant"]}}},"/staff/branch-assignments":{"get":{"description":"**Access:** ![Permission: read:staff:restaurant](https://img.shields.io/badge/Permission-read%3Astaff%3Arestaurant-green)\n\nReturns every `BranchAssignment` row for the branch identified by `x-branch-id`. Requires `read:staff:restaurant`.","operationId":"StaffController_listBranchAssignments","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchAssignmentDto"}}}}}},"summary":"List staff assigned to a branch","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:staff:restaurant"]}},"post":{"description":"**Access:** ![Permission: manage:staff:restaurant](https://img.shields.io/badge/Permission-manage%3Astaff%3Arestaurant-green)\n\nCreates a `BranchAssignment` for `userId` on the branch identified by `x-branch-id`. The user must already have a membership in the active restaurant. Requires `manage:staff:restaurant`.","operationId":"StaffController_assignBranch","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Target branch id (UUID).","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignBranchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchAssignmentDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchAssignmentDto"}}}}},"summary":"Assign a staff member to a branch","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:staff:restaurant"]}}},"/staff/branch-assignments/{userId}":{"delete":{"description":"**Access:** ![Permission: manage:staff:restaurant](https://img.shields.io/badge/Permission-manage%3Astaff%3Arestaurant-green)\n\nRemoves the `BranchAssignment` row for `userId` on the branch identified by `x-branch-id`. The underlying membership and user are unaffected. Requires `manage:staff:restaurant`.","operationId":"StaffController_unassignBranch","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Target branch id (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Assignment removed."}},"summary":"Unassign a staff member from a branch","tags":["Staff"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:staff:restaurant"]}}},"/restaurants/{restaurantId}/staff/{staffId}/availability":{"get":{"operationId":"StaffAvailabilityController_getSchedules","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"staffId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StaffAvailabilityScheduleDto"}}}}},"404":{"description":"Staff member not found in this restaurant"}},"summary":"Get availability schedules for a staff member","tags":["Staff Availability"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"put":{"operationId":"StaffAvailabilityController_replaceSchedules","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"staffId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceStaffAvailabilityDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StaffAvailabilityScheduleDto"}}}}},"404":{"description":"Staff member or branch not found"}},"summary":"Replace all availability schedules for a staff member at a branch","tags":["Staff Availability"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/staff/{staffId}/availability/{scheduleId}":{"delete":{"operationId":"StaffAvailabilityController_deleteSchedule","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"staffId","required":true,"in":"path","schema":{"type":"string"}},{"name":"scheduleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Schedule deleted"},"404":{"description":"Schedule not found"}},"summary":"Delete a specific availability schedule entry","tags":["Staff Availability"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/staff/{staffId}/service-assignments":{"get":{"operationId":"StaffAvailabilityController_getServiceAssignments","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"staffId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StaffServiceAssignmentDto"}}}}},"404":{"description":"Staff member not found in this restaurant"}},"summary":"List services this staff member can perform","tags":["Staff Availability"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"post":{"operationId":"StaffAvailabilityController_createServiceAssignment","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"staffId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStaffServiceAssignmentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffServiceAssignmentDto"}}}},"404":{"description":"Staff member, branch, or SERVICE product not found"}},"summary":"Assign a staff member to a SERVICE product at a branch","tags":["Staff Availability"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/staff/{staffId}/service-assignments/{assignmentId}":{"delete":{"operationId":"StaffAvailabilityController_deleteServiceAssignment","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"staffId","required":true,"in":"path","schema":{"type":"string"}},{"name":"assignmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Assignment removed"},"404":{"description":"Assignment not found"}},"summary":"Remove a staff service assignment","tags":["Staff Availability"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}/services/{productId}/staff":{"get":{"operationId":"BranchServiceStaffController_getStaffForService","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StaffForServiceDto"}}}}},"404":{"description":"Branch not found"}},"summary":"List staff who can perform a given SERVICE product at a branch","tags":["Staff Availability"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/branches/{branchId}/delivery-zones":{"get":{"operationId":"DeliveryZonesController_listZones","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZoneResponseDto"}}}}}},"summary":"List delivery zones for a branch","tags":["Delivery Zones"],"description":"**Access:** ![Permission: manage:delivery_zones:branch](https://img.shields.io/badge/Permission-manage%3Adelivery__zones%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:delivery_zones:branch"]}},"post":{"operationId":"DeliveryZonesController_createZone","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDeliveryZoneDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryZoneResponseDto"}}}}},"summary":"Create a delivery zone for a branch","tags":["Delivery Zones"],"description":"**Access:** ![Permission: manage:delivery_zones:branch](https://img.shields.io/badge/Permission-manage%3Adelivery__zones%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:delivery_zones:branch"]}}},"/branches/{branchId}/delivery-zones/{zoneId}":{"patch":{"operationId":"DeliveryZonesController_updateZone","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"zoneId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDeliveryZoneDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryZoneResponseDto"}}}}},"summary":"Update a delivery zone","tags":["Delivery Zones"],"description":"**Access:** ![Permission: manage:delivery_zones:branch](https://img.shields.io/badge/Permission-manage%3Adelivery__zones%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:delivery_zones:branch"]}},"delete":{"operationId":"DeliveryZonesController_deleteZone","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"zoneId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Delete a delivery zone","tags":["Delivery Zones"],"description":"**Access:** ![Permission: manage:delivery_zones:branch](https://img.shields.io/badge/Permission-manage%3Adelivery__zones%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:delivery_zones:branch"]}}},"/branches/{branchId}/delivery-zones/settings":{"get":{"operationId":"DeliveryZonesController_getSettings","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverySettingsResponseDto"}}}}},"summary":"Get delivery fee settings for a branch","tags":["Delivery Zones"],"description":"**Access:** ![Permission: manage:delivery_zones:branch](https://img.shields.io/badge/Permission-manage%3Adelivery__zones%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:delivery_zones:branch"]}},"put":{"operationId":"DeliveryZonesController_updateSettings","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertDeliverySettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverySettingsResponseDto"}}}}},"summary":"Update delivery fee settings for a branch (full replace)","tags":["Delivery Zones"],"description":"**Access:** ![Permission: manage:delivery_zones:branch](https://img.shields.io/badge/Permission-manage%3Adelivery__zones%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:delivery_zones:branch"]}},"patch":{"operationId":"DeliveryZonesController_patchSettings","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDeliverySettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverySettingsResponseDto"}}}}},"summary":"Partially update delivery fee settings for a branch","tags":["Delivery Zones"],"description":"**Access:** ![Permission: manage:delivery_zones:branch](https://img.shields.io/badge/Permission-manage%3Adelivery__zones%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:delivery_zones:branch"]}}},"/public/restaurants/{restaurantId}/branches/{branchId}/delivery-zones/check":{"post":{"operationId":"DeliveryZonesPublicController_checkLocation","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckDeliveryLocationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckDeliveryLocationResponseDto"}}}}},"summary":"Check if a customer location falls within a delivery zone","tags":["Delivery Zones (Public)"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/scale-barcode-formats":{"get":{"description":"**Access:** ![Permission: read:products:restaurant](https://img.shields.io/badge/Permission-read%3Aproducts%3Arestaurant-green)\n\nPlain array. The POS loads `?branch_id=<its branch>&is_active=true` and parses scans with it.","operationId":"ScaleBarcodeFormatsController_list","parameters":[{"name":"branch_id","required":false,"in":"query","description":"Only formats that cover this branch.","schema":{"format":"uuid","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScaleBarcodeFormatResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List scale label formats","tags":["Scale Barcode Formats"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:products:restaurant"]}},"post":{"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)\n\nRefused with SCALE_FORMAT_OVERLAP (409) when an active format with the same code length and a prefix that starts with this one covers a shared branch. The response carries `collisions`.","operationId":"ScaleBarcodeFormatsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScaleBarcodeFormatDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodeFormatResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodeFormatResponseDto"}}}},"409":{"description":"SCALE_FORMAT_OVERLAP"}},"security":[{"Bearer":[]}],"summary":"Create a scale label format","tags":["Scale Barcode Formats"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/scale-barcode-formats/presets":{"get":{"operationId":"ScaleBarcodeFormatsController_listPresets","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScaleBarcodePresetResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List the platform presets a format can be created from","tags":["Scale Barcode Formats"],"description":"**Access:** ![Permission: read:products:restaurant](https://img.shields.io/badge/Permission-read%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:products:restaurant"]}}},"/restaurants/{restaurantId}/scale-barcode-formats/from-preset/{presetId}":{"post":{"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)\n\nEvery body field is optional and overrides the preset (e.g. prefix \"21\").","operationId":"ScaleBarcodeFormatsController_createFromPreset","parameters":[{"name":"presetId","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScaleBarcodeFormatFromPresetDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodeFormatResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodeFormatResponseDto"}}}},"409":{"description":"SCALE_FORMAT_OVERLAP"}},"security":[{"Bearer":[]}],"summary":"Create a format from a platform preset","tags":["Scale Barcode Formats"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/scale-barcode-formats/{id}":{"get":{"operationId":"ScaleBarcodeFormatsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodeFormatResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a scale label format","tags":["Scale Barcode Formats"],"description":"**Access:** ![Permission: read:products:restaurant](https://img.shields.io/badge/Permission-read%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:products:restaurant"]}},"patch":{"operationId":"ScaleBarcodeFormatsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScaleBarcodeFormatDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodeFormatResponseDto"}}}},"409":{"description":"SCALE_FORMAT_OVERLAP"}},"security":[{"Bearer":[]}],"summary":"Update a scale label format","tags":["Scale Barcode Formats"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}},"delete":{"operationId":"ScaleBarcodeFormatsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete a scale label format","tags":["Scale Barcode Formats"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/scale-barcode-formats/{id}/collisions":{"get":{"description":"**Access:** ![Permission: read:products:restaurant](https://img.shields.io/badge/Permission-read%3Aproducts%3Arestaurant-green)\n\nProducts and variants whose barcode has this format’s length and prefix.","operationId":"ScaleBarcodeFormatsController_collisions","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScaleBarcodeCollisionResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"Product barcodes this format would read as scale labels","tags":["Scale Barcode Formats"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:products:restaurant"]}}},"/super-admin/scale-barcode-presets":{"get":{"operationId":"ScaleBarcodePresetsSuperAdminController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScaleBarcodePresetResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List every scale label preset, inactive ones too","tags":["Super Admin — Scale Barcode Presets"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_settings:platform"]}},"post":{"operationId":"ScaleBarcodePresetsSuperAdminController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScaleBarcodePresetDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodePresetResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodePresetResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create a scale label preset","tags":["Super Admin — Scale Barcode Presets"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_settings:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__settings%3Aplatform-green) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_settings:platform","read:platform_settings:platform"]}}},"/super-admin/scale-barcode-presets/{id}":{"get":{"operationId":"ScaleBarcodePresetsSuperAdminController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodePresetResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a scale label preset","tags":["Super Admin — Scale Barcode Presets"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_settings:platform"]}},"patch":{"operationId":"ScaleBarcodePresetsSuperAdminController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScaleBarcodePresetDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaleBarcodePresetResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a scale label preset","tags":["Super Admin — Scale Barcode Presets"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_settings:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__settings%3Aplatform-green) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_settings:platform","read:platform_settings:platform"]}},"delete":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_settings:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__settings%3Aplatform-green) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)\n\nFormats businesses already copied from it are not affected.","operationId":"ScaleBarcodePresetsSuperAdminController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete a scale label preset","tags":["Super Admin — Scale Barcode Presets"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_settings:platform","read:platform_settings:platform"]}}},"/restaurants/{restaurantId}/emenu/pages":{"get":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nReturns HOME, CHECKOUT, and CUSTOM pages for the restaurant (metadata + section counts).","operationId":"PageBuilderPagesController_listPages","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"Page list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageListResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"List all e-menu pages","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nCreates a CUSTOM page with title + slug. Reserved slugs: `home`, `checkout`. Limited to 10 custom pages per restaurant (configurable). Same section types as HOME.","operationId":"PageBuilderPagesController_createCustomPage","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmenuCustomPageDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"201":{"description":"Custom page created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"400":{"description":"Validation failed, reserved slug, or custom page limit reached."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"409":{"description":"Slug already in use for this restaurant."}},"security":[{"Bearer":[]}],"summary":"Create a custom e-menu page","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/id/{pageId}":{"get":{"operationId":"PageBuilderPagesController_getPageById","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"Page with sections.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Page not found."}},"security":[{"Bearer":[]}],"summary":"Get page by id (admin)","tags":["E-menu Page Builder"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"patch":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nCUSTOM pages may change title, title_ar, slug, publish, sort_order. HOME/CHECKOUT may only change is_published and sort_order.","operationId":"PageBuilderPagesController_updatePageById","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmenuCustomPageDto"}}}},"responses":{"200":{"description":"Updated page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"400":{"description":"Immutable system field or reserved slug."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Page not found."},"409":{"description":"Slug already in use."}},"security":[{"Bearer":[]}],"summary":"Update page metadata","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"delete":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nHOME and CHECKOUT cannot be deleted.","operationId":"PageBuilderPagesController_deletePageById","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}}],"responses":{"204":{"description":"Page deleted."},"400":{"description":"Attempted to delete a system page."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Page not found."}},"security":[{"Bearer":[]}],"summary":"Delete a custom page","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/id/{pageId}/sections":{"post":{"operationId":"PageBuilderPagesController_addSectionByPageId","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","content"],"properties":{"type":{"enum":["HERO","PRODUCT_GRID","SLIDER","FEATURED_SLIDER","REVIEWS","FAQ","QUICK_LINKS","ENHANCED_FEATURES","CATEGORIES_GRID","PROMO_BANNER","TEXT_BLOCK","ANNOUNCEMENT","FEATURED_ITEM","IMAGE_BANNER","DIVIDER","ORDER_TYPE","PLACE_ORDER"]},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"content":{"oneOf":[{"$ref":"#/components/schemas/HeroSectionContentDto"},{"$ref":"#/components/schemas/ProductGridSectionContentDto"},{"$ref":"#/components/schemas/SliderSectionContent"},{"$ref":"#/components/schemas/FeaturedSliderSectionContent"},{"$ref":"#/components/schemas/ReviewsSectionContentDto"},{"$ref":"#/components/schemas/FaqSectionContentDto"},{"$ref":"#/components/schemas/QuickLinksSectionContentDto"},{"$ref":"#/components/schemas/EnhancedFeaturesSectionContentDto"},{"$ref":"#/components/schemas/CategoriesGridSectionContentDto"},{"$ref":"#/components/schemas/PromoBannerSectionContent"},{"$ref":"#/components/schemas/OrderTypeSectionContentDto"},{"$ref":"#/components/schemas/PlaceOrderSectionContentDto"},{"type":"object","additionalProperties":{},"description":"Content for other section types (TEXT_BLOCK, ANNOUNCEMENT, etc.)."}]}}},"examples":{"HERO":{"summary":"HERO","value":{"type":"HERO","sort_order":0,"is_active":true,"content":{"layout":1,"title":"Welcome","title_ar":"مرحباً","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","social_icons":[],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"24px"}}},"content_wrapper":{"show_branding":true,"style":{"mobile":{}}},"slider":{"show":true,"autoplay":{"enabled":true,"duration":5000},"slider_motion":{"animation_effect":"slide"},"slides":[{"type":"product","id":"00000000-0000-0000-0000-000000000001"}]}}}},"HERO_LAYOUT_2":{"summary":"HERO layout 2 (no slider)","value":{"type":"HERO","sort_order":0,"is_active":true,"content":{"layout":2,"title":"Welcome","title_ar":"مرحباً","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","social_icons":[{"icon":{"name":"InstagramLogo","filled":false},"label":"Instagram","label_ar":"انستقرام","link":"myrestaurant","type":"url"}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"24px"}}},"content_wrapper":{"show_branding":true,"style":{"mobile":{}}}}}},"PRODUCT_GRID":{"summary":"PRODUCT_GRID","value":{"type":"PRODUCT_GRID","sort_order":1,"is_active":true,"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","content_wrapper":{"style":{"mobile":{}}},"include_categories":["00000000-0000-0000-0000-000000000001"],"show_list_button":false,"default_layout":"grid","display_type":"grid","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"categories":{"show":true,"button":{"style":{"mobile":{"border_radius":"9999px"}}},"style":{"position":"sticky","mobile":{"top":"0px"}}}}}},"SLIDER":{"summary":"SLIDER","value":{"type":"SLIDER","sort_order":2,"is_active":true,"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","image":"https://cdn.example.com/slider-fallback.webp","slider_arrows":{"enabled":true},"slider_autoplay":{"enabled":true,"duration":5000},"slider_aspect_ratio":{"mobile":"16/9","desktop":"21/9"},"slider_motion":{"animation_effect":"slide"},"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"slides":[{"image":"https://cdn.example.com/banner.webp","title":"Summer Sale","title_ar":"تخفيضات الصيف","subtitle":"Limited time","subtitle_ar":"لفترة محدودة","button":{"text":"Shop now","text_ar":"تسوق الآن","link":"/menu","type":"link"},"text_style":{"mobile":{"color":"#ffffff"}},"content_style":{"mobile":{"padding":"16px"}}}]}}},"FEATURED_SLIDER":{"summary":"FEATURED_SLIDER","value":{"type":"FEATURED_SLIDER","sort_order":3,"is_active":true,"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"content_wrapper":{"style":{"mobile":{}}},"autoplay":{"enabled":true,"duration":5000},"slider_motion":{"animation_effect":"slide"},"slides":[{"type":"product","id":"00000000-0000-0000-0000-000000000001"}]}}},"REVIEWS":{"summary":"REVIEWS","value":{"type":"REVIEWS","sort_order":4,"is_active":true,"content":{"title":"What our guests say","title_ar":"ماذا يقول ضيوفنا","subtitle":"Real reviews from real customers","subtitle_ar":"تقييمات حقيقية من عملائنا","content_wrapper":{"style":{"mobile":{}}},"source":"google","data":{"google":{"place_id":"ChIJN1t_tDeuEmsRUsoyG83frY4","exclude_less_than_stars":4}},"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"review_button":{"show":true,"text":"Leave a review","text_ar":"اترك تقييماً","link":"https://g.page/r/example/review","style":{"mobile":{}}},"review_card":{"type":"vertical","wrapper":{"style":{"mobile":{}},"content":{"style":{"mobile":{}}}},"sequence":{"content":[{"show":true,"name":"author_name"},{"show":true,"name":"rating"},{"show":true,"name":"relative_time_description"},{"show":true,"name":"text"}],"image":[{"show":true,"name":"image","position":"top"}]},"style":{"mobile":{}}}}}},"FAQ":{"summary":"FAQ","value":{"type":"FAQ","sort_order":5,"is_active":true,"content":{"title":"Frequently asked questions","title_ar":"الأسئلة الشائعة","subtitle":"Everything you need to know","subtitle_ar":"كل ما تحتاج معرفته","description":"Browse common questions about our menu and services.","description_ar":"تصفح الأسئلة الشائعة حول قائمتنا وخدماتنا.","questions":[{"question":"Do you offer delivery?","question_ar":"هل تقدمون خدمة التوصيل؟","answer":"Yes, we deliver within a 5 km radius.","answer_ar":"نعم، نوصل ضمن نطاق 5 كم."}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"faq_card":{"wrapper":{"style":{"mobile":{}}}}}}},"QUICK_LINKS":{"summary":"QUICK_LINKS","value":{"type":"QUICK_LINKS","sort_order":6,"is_active":true,"content":{"title":"Quick links","title_ar":"روابط سريعة","subtitle":"Jump to a page","subtitle_ar":"انتقل إلى صفحة","content_wrapper":{"style":{"mobile":{}}},"links":[{"icon":{"name":"List","filled":false},"label":"Menu","label_ar":"القائمة","link":"https://example.com/menu","type":"url"},{"icon":{"name":"Phone","filled":false},"label":"Call us","label_ar":"اتصل بنا","link":"+966500000000","type":"phone"}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{}}},"links_wrapper":{"style":{"mobile":{}}},"button":{"style":{"mobile":{}}}}}},"ENHANCED_FEATURES":{"summary":"ENHANCED_FEATURES","value":{"type":"ENHANCED_FEATURES","sort_order":7,"is_active":true,"content":{"title":"Why choose us","title_ar":"لماذا نحن","subtitle":"Everything you need","subtitle_ar":"كل ما تحتاجه","description":"Highlights of our service.","description_ar":"أبرز ما نقدمه.","content_wrapper":{"style":{"mobile":{}}},"features":[{"title":"Fast delivery","title_ar":"توصيل سريع","secondary_title":"Under 30 minutes","secondary_title_ar":"خلال 30 دقيقة","icon":{"name":"Truck","filled":false}}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{}}},"feature_card":{"wrapper":{"style":{"mobile":{}}}}}}},"CATEGORIES_GRID":{"summary":"CATEGORIES_GRID","value":{"type":"CATEGORIES_GRID","sort_order":8,"is_active":true,"content":{"title":"Browse categories","title_ar":"تصفح الفئات","subtitle":"Shop by category","subtitle_ar":"تسوق حسب الفئة","description":"Explore our menu categories.","description_ar":"استكشف فئات قائمتنا.","content_wrapper":{"style":{"mobile":{"text_align":"center"}}},"include_categories":["00000000-0000-0000-0000-000000000001"],"display_type":"all","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px","border_radius":"12px"}}}}}},"PROMO_BANNER":{"summary":"PROMO_BANNER","value":{"type":"PROMO_BANNER","sort_order":9,"is_active":true,"content":{"title":"20% off everything","title_ar":"خصم 20٪ على كل شيء","image_url":"https://cdn.example.com/promo.webp","link_url":"/promo/summer","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":false},"style":{"mobile":{}}}}}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSectionResponseDto"}}}},"201":{"description":"Section created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSectionResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Add a section to a page by id","tags":["E-menu Page Builder"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/id/{pageId}/sections/{sectionId}":{"patch":{"operationId":"PageBuilderPagesController_updateSectionByPageId","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}},{"name":"sectionId","required":true,"in":"path","description":"Section UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"content":{"oneOf":[{"$ref":"#/components/schemas/UpdateHeroSectionContent"},{"$ref":"#/components/schemas/UpdateProductGridSectionContent"},{"$ref":"#/components/schemas/UpdateSliderSectionContent"},{"$ref":"#/components/schemas/UpdateFeaturedSliderSectionContent"},{"$ref":"#/components/schemas/UpdateReviewsSectionContent"},{"$ref":"#/components/schemas/UpdateFaqSectionContent"},{"$ref":"#/components/schemas/UpdateQuickLinksSectionContent"},{"$ref":"#/components/schemas/UpdateEnhancedFeaturesSectionContent"},{"$ref":"#/components/schemas/UpdateCategoriesGridSectionContent"},{"$ref":"#/components/schemas/UpdatePromoBannerSectionContent"},{"$ref":"#/components/schemas/UpdateOrderTypeSectionContent"},{"$ref":"#/components/schemas/UpdatePlaceOrderSectionContent"},{"type":"object","additionalProperties":{},"description":"Partial content for other section types (TEXT_BLOCK, etc.)."}]}}},"examples":{"SORT_ORDER":{"summary":"Reorder section","value":{"sort_order":2}},"DEACTIVATE":{"summary":"Deactivate section","value":{"is_active":false}},"HERO_CONTENT":{"summary":"HERO content patch","value":{"content":{"layout":1,"social_icons":[],"title":"Welcome back","title_ar":"مرحباً بعودتك","slider":{"show":true,"autoplay":{"enabled":true,"duration":4000}}}}},"HERO_LAYOUT_2_CONTENT":{"summary":"HERO layout 2 content patch","value":{"content":{"layout":2,"title":"Welcome","title_ar":"مرحباً","social_icons":[{"icon":{"name":"InstagramLogo","filled":false},"label":"Instagram","link":"https://instagram.com/myrestaurant","type":"url"}]}}},"PRODUCT_GRID_CONTENT":{"summary":"PRODUCT_GRID content patch","value":{"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","content_wrapper":{"style":{"mobile":{"text_align":"center","text_decoration":"underline"}}},"default_layout":"list","display_type":"list","categories":{"show":true,"style":{"position":"sticky"}}}}},"SLIDER_CONTENT":{"summary":"SLIDER content patch","value":{"content":{"title":"Featured picks","slider_autoplay":{"enabled":true,"duration":4000},"slider_motion":{"animation_effect":"fade"},"slides":[{"image":"https://cdn.example.com/banner.webp","title":"New arrivals","button":{"text":"Browse","link":"/menu","type":"link"}}]}}},"FEATURED_SLIDER_CONTENT":{"summary":"FEATURED_SLIDER content patch","value":{"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","content_wrapper":{"style":{"mobile":{"text_align":"start"}}},"autoplay":{"enabled":true,"duration":4000},"slider_motion":{"animation_effect":"fade"},"slides":[{"type":"category","id":"00000000-0000-0000-0000-000000000002"}]}}},"REVIEWS_CONTENT":{"summary":"REVIEWS content patch","value":{"content":{"title":"What our guests say","title_ar":"ماذا يقول ضيوفنا","subtitle":"Real reviews from real customers","subtitle_ar":"تقييمات حقيقية من عملائنا","content_wrapper":{"style":{"mobile":{"text_align":"center"}}},"source":"custom","data":{"custom":{"reviews":[{"author_name":"Sarah M.","rating":5,"relative_time_description":"2 weeks ago","text":"Amazing food and fast service!","gender":"female"}]}},"review_button":{"show":true,"text":"Leave a review"}}}},"FAQ_CONTENT":{"summary":"FAQ content patch","value":{"content":{"title":"Frequently asked questions","title_ar":"الأسئلة الشائعة","subtitle":"Everything you need to know","subtitle_ar":"كل ما تحتاج معرفته","questions":[{"question":"Do you offer delivery?","question_ar":"هل تقدمون خدمة التوصيل؟","answer":"Yes, we deliver within a 5 km radius.","answer_ar":"نعم، نوصل ضمن نطاق 5 كم."}]}}},"QUICK_LINKS_CONTENT":{"summary":"QUICK_LINKS content patch","value":{"content":{"title":"Quick links","title_ar":"روابط سريعة","links":[{"icon":{"name":"List","filled":false},"label":"Menu","label_ar":"القائمة","link":"https://example.com/menu","type":"url"}],"button":{"style":{"mobile":{"border_radius":"12px"}}}}}},"ENHANCED_FEATURES_CONTENT":{"summary":"ENHANCED_FEATURES content patch","value":{"content":{"title":"Why choose us","features":[{"title":"Fast delivery","title_ar":"توصيل سريع","secondary_title":"Under 30 minutes","icon":{"name":"Truck","filled":false}}]}}},"CATEGORIES_GRID_CONTENT":{"summary":"CATEGORIES_GRID content patch","value":{"content":{"title":"Browse categories","title_ar":"تصفح الفئات","subtitle":"Shop by category","subtitle_ar":"تسوق حسب الفئة","content_wrapper":{"style":{"mobile":{"text_align":"center","text_decoration":"underline"}}},"include_categories":["00000000-0000-0000-0000-000000000001"],"display_type":"slide"}}}}}}},"responses":{"200":{"description":"Section updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSectionResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Update a section on a page by id","tags":["E-menu Page Builder"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"delete":{"operationId":"PageBuilderPagesController_removeSectionByPageId","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}},{"name":"sectionId","required":true,"in":"path","description":"Section UUID","schema":{"type":"string"}}],"responses":{"204":{"description":"Section deleted."},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Remove a section from a page by id","tags":["E-menu Page Builder"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/id/{pageId}/sections/reorder":{"post":{"operationId":"PageBuilderPagesController_reorderSectionsByPageId","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderEmenuSectionsDto"}}}},"responses":{"204":{"description":"Sort orders updated."},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Reorder sections on a page by id","tags":["E-menu Page Builder"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/id/{pageId}/sections/batch":{"post":{"operationId":"PageBuilderPagesController_batchApplySectionsByPageId","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageId","required":true,"in":"path","description":"Page UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchApplySectionsDto"}}}},"responses":{"200":{"description":"Page with new sections.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Replace all sections on a page by id","tags":["E-menu Page Builder"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/{pageType}":{"get":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nReturns the full page record with all sections (published and unpublished). Admin view. For HOME, if the restaurant has no sections yet, the platform gallery default theme is returned as a live fallback (not saved to the restaurant) when configured.","operationId":"PageBuilderController_getPage","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageType","required":true,"in":"path","description":"HOME or CHECKOUT","schema":{"enum":["HOME","CHECKOUT"],"type":"string"}}],"responses":{"200":{"description":"Page with sections. Returns `null` if the page has never been configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Get page config","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"put":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nUpserts the page record for this restaurant + pageType. Use `is_published: true` to make the page visible to customers.","operationId":"PageBuilderController_upsertPage","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageType","required":true,"in":"path","description":"HOME or CHECKOUT","schema":{"enum":["HOME","CHECKOUT"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertEmenuPageDto"}}}},"responses":{"200":{"description":"Updated page with sections.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Create or update page settings","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/{pageType}/sections":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nCreates a new section on the page. The page is auto-created if it does not exist yet. Pick a section `type` in the request body — the docs UI shows the matching `content` schema.","operationId":"PageBuilderController_addSection","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageType","required":true,"in":"path","description":"HOME or CHECKOUT","schema":{"enum":["HOME","CHECKOUT"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","content"],"properties":{"type":{"enum":["HERO","PRODUCT_GRID","SLIDER","FEATURED_SLIDER","REVIEWS","FAQ","QUICK_LINKS","ENHANCED_FEATURES","CATEGORIES_GRID","PROMO_BANNER","TEXT_BLOCK","ANNOUNCEMENT","FEATURED_ITEM","IMAGE_BANNER","DIVIDER","ORDER_TYPE","PLACE_ORDER"]},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"content":{"oneOf":[{"$ref":"#/components/schemas/HeroSectionContentDto"},{"$ref":"#/components/schemas/ProductGridSectionContentDto"},{"$ref":"#/components/schemas/SliderSectionContent"},{"$ref":"#/components/schemas/FeaturedSliderSectionContent"},{"$ref":"#/components/schemas/ReviewsSectionContentDto"},{"$ref":"#/components/schemas/FaqSectionContentDto"},{"$ref":"#/components/schemas/QuickLinksSectionContentDto"},{"$ref":"#/components/schemas/EnhancedFeaturesSectionContentDto"},{"$ref":"#/components/schemas/CategoriesGridSectionContentDto"},{"$ref":"#/components/schemas/PromoBannerSectionContent"},{"$ref":"#/components/schemas/OrderTypeSectionContentDto"},{"$ref":"#/components/schemas/PlaceOrderSectionContentDto"},{"type":"object","additionalProperties":{},"description":"Content for other section types (TEXT_BLOCK, ANNOUNCEMENT, etc.)."}]}}},"examples":{"HERO":{"summary":"HERO","value":{"type":"HERO","sort_order":0,"is_active":true,"content":{"layout":1,"title":"Welcome","title_ar":"مرحباً","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","social_icons":[],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"24px"}}},"content_wrapper":{"show_branding":true,"style":{"mobile":{}}},"slider":{"show":true,"autoplay":{"enabled":true,"duration":5000},"slider_motion":{"animation_effect":"slide"},"slides":[{"type":"product","id":"00000000-0000-0000-0000-000000000001"}]}}}},"HERO_LAYOUT_2":{"summary":"HERO layout 2 (no slider)","value":{"type":"HERO","sort_order":0,"is_active":true,"content":{"layout":2,"title":"Welcome","title_ar":"مرحباً","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","social_icons":[{"icon":{"name":"InstagramLogo","filled":false},"label":"Instagram","label_ar":"انستقرام","link":"myrestaurant","type":"url"}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"24px"}}},"content_wrapper":{"show_branding":true,"style":{"mobile":{}}}}}},"PRODUCT_GRID":{"summary":"PRODUCT_GRID","value":{"type":"PRODUCT_GRID","sort_order":1,"is_active":true,"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","content_wrapper":{"style":{"mobile":{}}},"include_categories":["00000000-0000-0000-0000-000000000001"],"show_list_button":false,"default_layout":"grid","display_type":"grid","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"categories":{"show":true,"button":{"style":{"mobile":{"border_radius":"9999px"}}},"style":{"position":"sticky","mobile":{"top":"0px"}}}}}},"SLIDER":{"summary":"SLIDER","value":{"type":"SLIDER","sort_order":2,"is_active":true,"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","image":"https://cdn.example.com/slider-fallback.webp","slider_arrows":{"enabled":true},"slider_autoplay":{"enabled":true,"duration":5000},"slider_aspect_ratio":{"mobile":"16/9","desktop":"21/9"},"slider_motion":{"animation_effect":"slide"},"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"slides":[{"image":"https://cdn.example.com/banner.webp","title":"Summer Sale","title_ar":"تخفيضات الصيف","subtitle":"Limited time","subtitle_ar":"لفترة محدودة","button":{"text":"Shop now","text_ar":"تسوق الآن","link":"/menu","type":"link"},"text_style":{"mobile":{"color":"#ffffff"}},"content_style":{"mobile":{"padding":"16px"}}}]}}},"FEATURED_SLIDER":{"summary":"FEATURED_SLIDER","value":{"type":"FEATURED_SLIDER","sort_order":3,"is_active":true,"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"content_wrapper":{"style":{"mobile":{}}},"autoplay":{"enabled":true,"duration":5000},"slider_motion":{"animation_effect":"slide"},"slides":[{"type":"product","id":"00000000-0000-0000-0000-000000000001"}]}}},"REVIEWS":{"summary":"REVIEWS","value":{"type":"REVIEWS","sort_order":4,"is_active":true,"content":{"title":"What our guests say","title_ar":"ماذا يقول ضيوفنا","subtitle":"Real reviews from real customers","subtitle_ar":"تقييمات حقيقية من عملائنا","content_wrapper":{"style":{"mobile":{}}},"source":"google","data":{"google":{"place_id":"ChIJN1t_tDeuEmsRUsoyG83frY4","exclude_less_than_stars":4}},"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"review_button":{"show":true,"text":"Leave a review","text_ar":"اترك تقييماً","link":"https://g.page/r/example/review","style":{"mobile":{}}},"review_card":{"type":"vertical","wrapper":{"style":{"mobile":{}},"content":{"style":{"mobile":{}}}},"sequence":{"content":[{"show":true,"name":"author_name"},{"show":true,"name":"rating"},{"show":true,"name":"relative_time_description"},{"show":true,"name":"text"}],"image":[{"show":true,"name":"image","position":"top"}]},"style":{"mobile":{}}}}}},"FAQ":{"summary":"FAQ","value":{"type":"FAQ","sort_order":5,"is_active":true,"content":{"title":"Frequently asked questions","title_ar":"الأسئلة الشائعة","subtitle":"Everything you need to know","subtitle_ar":"كل ما تحتاج معرفته","description":"Browse common questions about our menu and services.","description_ar":"تصفح الأسئلة الشائعة حول قائمتنا وخدماتنا.","questions":[{"question":"Do you offer delivery?","question_ar":"هل تقدمون خدمة التوصيل؟","answer":"Yes, we deliver within a 5 km radius.","answer_ar":"نعم، نوصل ضمن نطاق 5 كم."}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px"}}},"faq_card":{"wrapper":{"style":{"mobile":{}}}}}}},"QUICK_LINKS":{"summary":"QUICK_LINKS","value":{"type":"QUICK_LINKS","sort_order":6,"is_active":true,"content":{"title":"Quick links","title_ar":"روابط سريعة","subtitle":"Jump to a page","subtitle_ar":"انتقل إلى صفحة","content_wrapper":{"style":{"mobile":{}}},"links":[{"icon":{"name":"List","filled":false},"label":"Menu","label_ar":"القائمة","link":"https://example.com/menu","type":"url"},{"icon":{"name":"Phone","filled":false},"label":"Call us","label_ar":"اتصل بنا","link":"+966500000000","type":"phone"}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{}}},"links_wrapper":{"style":{"mobile":{}}},"button":{"style":{"mobile":{}}}}}},"ENHANCED_FEATURES":{"summary":"ENHANCED_FEATURES","value":{"type":"ENHANCED_FEATURES","sort_order":7,"is_active":true,"content":{"title":"Why choose us","title_ar":"لماذا نحن","subtitle":"Everything you need","subtitle_ar":"كل ما تحتاجه","description":"Highlights of our service.","description_ar":"أبرز ما نقدمه.","content_wrapper":{"style":{"mobile":{}}},"features":[{"title":"Fast delivery","title_ar":"توصيل سريع","secondary_title":"Under 30 minutes","secondary_title_ar":"خلال 30 دقيقة","icon":{"name":"Truck","filled":false}}],"wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{}}},"feature_card":{"wrapper":{"style":{"mobile":{}}}}}}},"CATEGORIES_GRID":{"summary":"CATEGORIES_GRID","value":{"type":"CATEGORIES_GRID","sort_order":8,"is_active":true,"content":{"title":"Browse categories","title_ar":"تصفح الفئات","subtitle":"Shop by category","subtitle_ar":"تسوق حسب الفئة","description":"Explore our menu categories.","description_ar":"استكشف فئات قائمتنا.","content_wrapper":{"style":{"mobile":{"text_align":"center"}}},"include_categories":["00000000-0000-0000-0000-000000000001"],"display_type":"all","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":true},"style":{"mobile":{"padding":"16px","border_radius":"12px"}}}}}},"PROMO_BANNER":{"summary":"PROMO_BANNER","value":{"type":"PROMO_BANNER","sort_order":9,"is_active":true,"content":{"title":"20% off everything","title_ar":"خصم 20٪ على كل شيء","image_url":"https://cdn.example.com/promo.webp","link_url":"/promo/summer","wrapper":{"props":{"padding_y":"sm","padding_x":"sm","margin_y":"none","container":false},"style":{"mobile":{}}}}}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSectionResponseDto"}}}},"201":{"description":"Section created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSectionResponseDto"}}}},"400":{"description":"Invalid section type or malformed content."},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Add a section","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/{pageType}/sections/{sectionId}":{"patch":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nPartial update. `content` is **merged** with the existing content JSON (shallow merge) — you only need to send the keys you want to change.","operationId":"PageBuilderController_updateSection","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageType","required":true,"in":"path","description":"HOME or CHECKOUT","schema":{"enum":["HOME","CHECKOUT"],"type":"string"}},{"name":"sectionId","required":true,"in":"path","description":"Section UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"content":{"oneOf":[{"$ref":"#/components/schemas/UpdateHeroSectionContent"},{"$ref":"#/components/schemas/UpdateProductGridSectionContent"},{"$ref":"#/components/schemas/UpdateSliderSectionContent"},{"$ref":"#/components/schemas/UpdateFeaturedSliderSectionContent"},{"$ref":"#/components/schemas/UpdateReviewsSectionContent"},{"$ref":"#/components/schemas/UpdateFaqSectionContent"},{"$ref":"#/components/schemas/UpdateQuickLinksSectionContent"},{"$ref":"#/components/schemas/UpdateEnhancedFeaturesSectionContent"},{"$ref":"#/components/schemas/UpdateCategoriesGridSectionContent"},{"$ref":"#/components/schemas/UpdatePromoBannerSectionContent"},{"$ref":"#/components/schemas/UpdateOrderTypeSectionContent"},{"$ref":"#/components/schemas/UpdatePlaceOrderSectionContent"},{"type":"object","additionalProperties":{},"description":"Partial content for other section types (TEXT_BLOCK, etc.)."}]}}},"examples":{"SORT_ORDER":{"summary":"Reorder section","value":{"sort_order":2}},"DEACTIVATE":{"summary":"Deactivate section","value":{"is_active":false}},"HERO_CONTENT":{"summary":"HERO content patch","value":{"content":{"layout":1,"social_icons":[],"title":"Welcome back","title_ar":"مرحباً بعودتك","slider":{"show":true,"autoplay":{"enabled":true,"duration":4000}}}}},"HERO_LAYOUT_2_CONTENT":{"summary":"HERO layout 2 content patch","value":{"content":{"layout":2,"title":"Welcome","title_ar":"مرحباً","social_icons":[{"icon":{"name":"InstagramLogo","filled":false},"label":"Instagram","link":"https://instagram.com/myrestaurant","type":"url"}]}}},"PRODUCT_GRID_CONTENT":{"summary":"PRODUCT_GRID content patch","value":{"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","content_wrapper":{"style":{"mobile":{"text_align":"center","text_decoration":"underline"}}},"default_layout":"list","display_type":"list","categories":{"show":true,"style":{"position":"sticky"}}}}},"SLIDER_CONTENT":{"summary":"SLIDER content patch","value":{"content":{"title":"Featured picks","slider_autoplay":{"enabled":true,"duration":4000},"slider_motion":{"animation_effect":"fade"},"slides":[{"image":"https://cdn.example.com/banner.webp","title":"New arrivals","button":{"text":"Browse","link":"/menu","type":"link"}}]}}},"FEATURED_SLIDER_CONTENT":{"summary":"FEATURED_SLIDER content patch","value":{"content":{"title":"Featured","title_ar":"المميزة","subtitle":"Order online","subtitle_ar":"اطلب أونلاين","content_wrapper":{"style":{"mobile":{"text_align":"start"}}},"autoplay":{"enabled":true,"duration":4000},"slider_motion":{"animation_effect":"fade"},"slides":[{"type":"category","id":"00000000-0000-0000-0000-000000000002"}]}}},"REVIEWS_CONTENT":{"summary":"REVIEWS content patch","value":{"content":{"title":"What our guests say","title_ar":"ماذا يقول ضيوفنا","subtitle":"Real reviews from real customers","subtitle_ar":"تقييمات حقيقية من عملائنا","content_wrapper":{"style":{"mobile":{"text_align":"center"}}},"source":"custom","data":{"custom":{"reviews":[{"author_name":"Sarah M.","rating":5,"relative_time_description":"2 weeks ago","text":"Amazing food and fast service!","gender":"female"}]}},"review_button":{"show":true,"text":"Leave a review"}}}},"FAQ_CONTENT":{"summary":"FAQ content patch","value":{"content":{"title":"Frequently asked questions","title_ar":"الأسئلة الشائعة","subtitle":"Everything you need to know","subtitle_ar":"كل ما تحتاج معرفته","questions":[{"question":"Do you offer delivery?","question_ar":"هل تقدمون خدمة التوصيل؟","answer":"Yes, we deliver within a 5 km radius.","answer_ar":"نعم، نوصل ضمن نطاق 5 كم."}]}}},"QUICK_LINKS_CONTENT":{"summary":"QUICK_LINKS content patch","value":{"content":{"title":"Quick links","title_ar":"روابط سريعة","links":[{"icon":{"name":"List","filled":false},"label":"Menu","label_ar":"القائمة","link":"https://example.com/menu","type":"url"}],"button":{"style":{"mobile":{"border_radius":"12px"}}}}}},"ENHANCED_FEATURES_CONTENT":{"summary":"ENHANCED_FEATURES content patch","value":{"content":{"title":"Why choose us","features":[{"title":"Fast delivery","title_ar":"توصيل سريع","secondary_title":"Under 30 minutes","icon":{"name":"Truck","filled":false}}]}}},"CATEGORIES_GRID_CONTENT":{"summary":"CATEGORIES_GRID content patch","value":{"content":{"title":"Browse categories","title_ar":"تصفح الفئات","subtitle":"Shop by category","subtitle_ar":"تسوق حسب الفئة","content_wrapper":{"style":{"mobile":{"text_align":"center","text_decoration":"underline"}}},"include_categories":["00000000-0000-0000-0000-000000000001"],"display_type":"slide"}}}}}}},"responses":{"200":{"description":"Section updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSectionResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Section not found on this page."}},"security":[{"Bearer":[]}],"summary":"Update a section","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"delete":{"operationId":"PageBuilderController_removeSection","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageType","required":true,"in":"path","description":"HOME or CHECKOUT","schema":{"enum":["HOME","CHECKOUT"],"type":"string"}},{"name":"sectionId","required":true,"in":"path","description":"Section UUID","schema":{"type":"string"}}],"responses":{"204":{"description":"Section deleted."},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Section not found on this page."}},"security":[{"Bearer":[]}],"summary":"Remove a section from the page","tags":["E-menu Page Builder"],"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/{pageType}/sections/reorder":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nBulk-updates `sort_order` for each section ID in the array. Send all section IDs that belong to this page.","operationId":"PageBuilderController_reorderSections","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageType","required":true,"in":"path","description":"HOME or CHECKOUT","schema":{"enum":["HOME","CHECKOUT"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderEmenuSectionsDto"}}}},"responses":{"204":{"description":"Sort orders updated."},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Reorder sections","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/pages/{pageType}/sections/batch":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nDeletes all existing sections on this page and creates the provided list in a single transaction. Use this to apply a preset template or to sync the full page state from the builder canvas. `sort_order` defaults to the array index if omitted.","operationId":"PageBuilderController_batchApplySections","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"pageType","required":true,"in":"path","description":"HOME or CHECKOUT","schema":{"enum":["HOME","CHECKOUT"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchApplySectionsDto"}}}},"responses":{"200":{"description":"Page with the new sections applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Apply a template — atomically replace all sections","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/emenu/{restaurantId}/pages":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns published CUSTOM pages (slug + titles) for storefront navigation. No authentication required. HOME/CHECKOUT are omitted — use dedicated routes.","operationId":"PageBuilderPublicController_listPublishedPages","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"Published custom pages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageListResponseDto"}}}}},"summary":"List published custom pages (public nav)","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/emenu/{restaurantId}/pages/home":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns the published HOME page with all **active** sections, ordered by `sort_order`. No authentication required. If HOME is missing, unpublished, or has no active sections, the platform gallery default theme is returned as a live fallback (not saved to the restaurant) when configured. Returns 404 only when neither published restaurant content nor a default theme is available. Each section `content` is discriminated by `type` — see per-type section response schemas.","operationId":"PageBuilderPublicController_getHomePage","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"Published HOME page with active sections. Sections are discriminated by `type`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"404":{"description":"No published HOME content and no platform default theme configured."}},"summary":"Get published HOME page (public)","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/emenu/{restaurantId}/pages/checkout":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns the CHECKOUT page. ORDER_TYPE and PLACE_ORDER chrome always ship (even when the page is unpublished). Extra marketing sections require publish + isActive. Includes `emenu_order_types` (accept AND show_on_emenu). No authentication required. Each section `content` is discriminated by `type` — see per-type section response schemas.","operationId":"PageBuilderPublicController_getCheckoutPage","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","description":"When set, `emenu_order_types` is resolved for this branch.","schema":{"type":"string"}}],"responses":{"200":{"description":"CHECKOUT page. ORDER_TYPE and PLACE_ORDER always included; extras only when published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"404":{"description":"Page not found or not published."}},"summary":"Get published CHECKOUT page (public)","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/emenu/{restaurantId}/pages/by-slug/{slug}":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns a published page (CUSTOM or system) with **active** sections by slug. No authentication required. For `home`, falls back to the live default theme when needed. Returns 404 if the page does not exist or is not published.","operationId":"PageBuilderPublicController_getPageBySlug","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"slug","required":true,"in":"path","description":"Page slug (e.g. about-us)","schema":{"type":"string"}}],"responses":{"200":{"description":"Published page with active sections.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuPageResponseDto"}}}},"404":{"description":"Page not found or not published."}},"summary":"Get published page by slug (public)","tags":["E-menu Page Builder"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurant-settings":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nReturns the active restaurant's settings (general, workingHours, orders, payments). Defaults are filled in for any key not yet persisted. `payments.providers` reports gateway connection status only — credentials are never returned.","operationId":"RestaurantSettingsController_get","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantSettingsDto"}}}}},"summary":"Get restaurant settings","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}},"patch":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nPartial update — each top-level category is shallow-merged independently in the database, so untouched categories are never rewritten. Unknown keys are rejected by the DTO. `workingHours.monday` (a sub-object) is replaced as a whole when present. `payments.providers` is read-only here: manage gateway credentials through /restaurant-settings/payments/providers/{provider}.","operationId":"RestaurantSettingsController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantSettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantSettingsDto"}}}}},"summary":"Update restaurant settings","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/restaurant-settings/invoice-numbering":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nFor each branch: the effective start/cap/reset (restaurant default or branch override), the raw override, the live counter value, and when it last reset.","operationId":"RestaurantSettingsController_getInvoiceNumbering","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceNumberingResponseDto"}}}}},"summary":"Per-branch fatora numbering status","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}}},"/restaurant-settings/invoice-numbering/{branchId}/reset":{"post":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nRestarts the branch's counter so the next order carries the effective start number, independent of the shift/day reset. Does not touch the ZATCA ICV.","operationId":"RestaurantSettingsController_resetInvoiceCounter","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Reset a branch fatora counter now","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/restaurant-settings/payments/providers":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nReturns every supported gateway with its connection state. Credentials are never included — `configured` reports whether the gateway has everything it needs, and `secret_hint` shows the last 4 characters of the stored key.","operationId":"PaymentProvidersController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentProviderConnectionDto"}}}}}},"summary":"List payment gateway connections","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}}},"/restaurant-settings/payments/providers/{provider}":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nConnection state for a single gateway. Credentials are never included.","operationId":"PaymentProvidersController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"provider","required":true,"in":"path","schema":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProviderConnectionDto"}}}}},"summary":"Get one payment gateway connection","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}},"put":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nReplaces the gateway configuration wholesale — any field the body omits is cleared. Send the full credential set on every call. Enabling a gateway before all of its credentials are present is rejected.","operationId":"PaymentProvidersController_replace","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"provider","required":true,"in":"path","schema":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HyperPayProviderConfigDto"},{"$ref":"#/components/schemas/TamaraProviderConfigDto"},{"$ref":"#/components/schemas/PaymobProviderConfigDto"},{"$ref":"#/components/schemas/MyfatoorahProviderConfigDto"},{"$ref":"#/components/schemas/AfsPayProviderConfigDto"},{"$ref":"#/components/schemas/NeoleapProviderConfigDto"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProviderConnectionDto"}}}}},"summary":"Connect or replace a payment gateway","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}},"patch":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nTurns a configured gateway on/off or switches its environment. Carries no credentials, so stored secrets are untouched.","operationId":"PaymentProvidersController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"provider","required":true,"in":"path","schema":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentProviderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProviderConnectionDto"}}}}},"summary":"Toggle a payment gateway","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}},"delete":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nRemoves the gateway configuration and its stored credentials. This is the only way to clear a secret.","operationId":"PaymentProvidersController_remove","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"provider","required":true,"in":"path","schema":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Disconnect a payment gateway","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/restaurant-settings/integrations/food-zone":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nConnection state. The API token is never included — `secret_hint` shows its last 4 characters.","operationId":"FoodZoneIntegrationController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneIntegrationDto"}}}}},"summary":"Get the Foodizone connection","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}},"put":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nSets the API token. `enabled` is kept when omitted (off for a new connection). The branch mapping is untouched.","operationId":"FoodZoneIntegrationController_replace","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceFoodZoneIntegrationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneIntegrationDto"}}}}},"summary":"Connect Foodizone or replace its API token","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}},"patch":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nCarries no credentials, so the stored token is untouched.","operationId":"FoodZoneIntegrationController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFoodZoneIntegrationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneIntegrationDto"}}}}},"summary":"Turn the Foodizone connection on or off","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}},"delete":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nRemoves the connection: its stored token and branch mapping.","operationId":"FoodZoneIntegrationController_remove","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Disconnect Foodizone","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/restaurant-settings/integrations/food-zone/branches":{"put":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nReplaces the whole mapping. Foodizone's `store_id` is a branch: each webhook goes to the branch mapped to its store id. A branch left out stops receiving Foodizone orders.","operationId":"FoodZoneIntegrationController_replaceBranches","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceFoodZoneBranchesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneIntegrationDto"}}}},"404":{"description":"Foodizone is not connected yet — PUT the API token first."},"409":{"description":"`FOOD_ZONE_STORE_IN_USE` — another restaurant has one of the store ids."}},"summary":"Map branches to Foodizone stores","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/restaurant-settings/integrations/food-zone/channels":{"put":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nReplaces the whole mapping. A paired channel's product prices are sent to that delivery app, and its orders land on that channel.","operationId":"FoodZoneIntegrationController_replaceChannels","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceFoodZoneChannelsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneIntegrationDto"}}}},"404":{"description":"Foodizone is not connected yet — PUT the API token first."}},"summary":"Pair ordering channels with delivery apps","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/restaurant-settings/ui":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nFree-form preferences object owned by the frontend. `{}` when nothing has been saved — there are no server-side defaults. Deliberately not bundled into GET /restaurant-settings: that payload is shared with other roles and clients, and must not change shape whenever the dashboard adds a preference.","operationId":"UiPreferencesController_get","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}}},"summary":"Get UI preferences","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}},"put":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nReplaces the object wholesale — any key the body omits is deleted. Limits, enforced on the merged result: 8192 bytes serialized, 50 keys per object, 3 levels deep, 1024-character strings, 50-item arrays of scalars. Keys must match ^[a-z][a-z0-9_]{0,63}$ — camelCase is rejected because the response pipeline renames camelCase keys to snake_case, which would split one key into two across a read/write round-trip.","operationId":"UiPreferencesController_replace","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}}},"summary":"Replace UI preferences","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}},"patch":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nShallow merge at the top level — keys the body does not mention are untouched, and a `null` value deletes that key. `null` is therefore not a storable value. Limits, enforced on the merged result: 8192 bytes serialized, 50 keys per object, 3 levels deep, 1024-character strings, 50-item arrays of scalars. Keys must match ^[a-z][a-z0-9_]{0,63}$ — camelCase is rejected because the response pipeline renames camelCase keys to snake_case, which would split one key into two across a read/write round-trip.","operationId":"UiPreferencesController_merge","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}}},"summary":"Merge UI preferences","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/me/ui-preferences":{"get":{"description":"**Access:** ![Membership: SERVICE_PROVIDER](https://img.shields.io/badge/Membership-SERVICE__PROVIDER-blueviolet)\n\nThe signed-in member's own preferences object in this restaurant; `{}` when nothing has been saved. Any member of the restaurant the session is signed into — every role, no permission — reads and writes their own object only; nobody else’s is reachable. Customer tokens get 403, and so does a session with no membership here (a super admin).","operationId":"MemberUiPreferencesController_get","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}}},"summary":"Get my UI preferences","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":"SERVICE_PROVIDER","feature":null,"permissions":[]}},"put":{"description":"**Access:** ![Membership: SERVICE_PROVIDER](https://img.shields.io/badge/Membership-SERVICE__PROVIDER-blueviolet)\n\nReplaces the object wholesale — any key the body omits is deleted. Any member of the restaurant the session is signed into — every role, no permission — reads and writes their own object only; nobody else’s is reachable. Customer tokens get 403, and so does a session with no membership here (a super admin). Limits, enforced on the merged result: 8192 bytes serialized, 50 keys per object, 3 levels deep, 1024-character strings, 50-item arrays of scalars. Keys must match ^[a-z][a-z0-9_]{0,63}$ — camelCase is rejected because the response pipeline renames camelCase keys to snake_case, which would split one key into two across a read/write round-trip.","operationId":"MemberUiPreferencesController_replace","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}}},"summary":"Replace my UI preferences","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":"SERVICE_PROVIDER","feature":null,"permissions":[]}},"patch":{"description":"**Access:** ![Membership: SERVICE_PROVIDER](https://img.shields.io/badge/Membership-SERVICE__PROVIDER-blueviolet)\n\nShallow merge at the top level — keys the body does not mention are untouched, and a `null` value deletes that key. Any member of the restaurant the session is signed into — every role, no permission — reads and writes their own object only; nobody else’s is reachable. Customer tokens get 403, and so does a session with no membership here (a super admin). Limits, enforced on the merged result: 8192 bytes serialized, 50 keys per object, 3 levels deep, 1024-character strings, 50-item arrays of scalars. Keys must match ^[a-z][a-z0-9_]{0,63}$ — camelCase is rejected because the response pipeline renames camelCase keys to snake_case, which would split one key into two across a read/write round-trip.","operationId":"MemberUiPreferencesController_merge","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"experience_template_id":"compact-pos"}}}}}},"summary":"Merge my UI preferences","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":"SERVICE_PROVIDER","feature":null,"permissions":[]}}},"/super-admin/emenu-builder-themes":{"get":{"operationId":"EmenuBuilderThemesSuperAdminController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmenuBuilderThemeListItemResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"List all e-menu builder themes (super admin)","tags":["Super Admin — E-menu Builder Themes"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:emenu_themes:platform](https://img.shields.io/badge/Permission-read%3Aemenu__themes%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:emenu_themes:platform"]}},"post":{"operationId":"EmenuBuilderThemesSuperAdminController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmenuBuilderThemeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuBuilderThemeResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuBuilderThemeResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create an e-menu builder theme","tags":["Super Admin — E-menu Builder Themes"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:emenu_themes:platform](https://img.shields.io/badge/Permission-manage%3Aemenu__themes%3Aplatform-green) ![Permission: read:emenu_themes:platform](https://img.shields.io/badge/Permission-read%3Aemenu__themes%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:emenu_themes:platform","read:emenu_themes:platform"]}}},"/super-admin/emenu-builder-themes/{id}":{"get":{"operationId":"EmenuBuilderThemesSuperAdminController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuBuilderThemeResponseDto"}}}},"404":{"description":"Theme not found."}},"security":[{"Bearer":[]}],"summary":"Get an e-menu builder theme by ID","tags":["Super Admin — E-menu Builder Themes"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:emenu_themes:platform](https://img.shields.io/badge/Permission-read%3Aemenu__themes%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:emenu_themes:platform"]}},"put":{"operationId":"EmenuBuilderThemesSuperAdminController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmenuBuilderThemeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuBuilderThemeResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update an e-menu builder theme","tags":["Super Admin — E-menu Builder Themes"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:emenu_themes:platform](https://img.shields.io/badge/Permission-manage%3Aemenu__themes%3Aplatform-green) ![Permission: read:emenu_themes:platform](https://img.shields.io/badge/Permission-read%3Aemenu__themes%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:emenu_themes:platform","read:emenu_themes:platform"]}},"delete":{"operationId":"EmenuBuilderThemesSuperAdminController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"Theme not found."}},"security":[{"Bearer":[]}],"summary":"Delete an e-menu builder theme","tags":["Super Admin — E-menu Builder Themes"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:emenu_themes:platform](https://img.shields.io/badge/Permission-manage%3Aemenu__themes%3Aplatform-green) ![Permission: read:emenu_themes:platform](https://img.shields.io/badge/Permission-read%3Aemenu__themes%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:emenu_themes:platform","read:emenu_themes:platform"]}}},"/super-admin/emenu-builder-gallery-default":{"get":{"operationId":"EmenuBuilderGalleryDefaultSuperAdminController_get","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuBuilderGalleryDefaultNullableResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get the platform gallery default theme","tags":["Super Admin — E-menu Builder Gallery Default"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:emenu_themes:platform](https://img.shields.io/badge/Permission-read%3Aemenu__themes%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:emenu_themes:platform"]}},"put":{"operationId":"EmenuBuilderGalleryDefaultSuperAdminController_upsert","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertEmenuBuilderGalleryDefaultDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuBuilderGalleryDefaultResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Set the platform gallery default theme","tags":["Super Admin — E-menu Builder Gallery Default"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:emenu_themes:platform](https://img.shields.io/badge/Permission-manage%3Aemenu__themes%3Aplatform-green) ![Permission: read:emenu_themes:platform](https://img.shields.io/badge/Permission-read%3Aemenu__themes%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:emenu_themes:platform","read:emenu_themes:platform"]}}},"/restaurants/{restaurantId}/emenu/builder-themes":{"get":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nReturns platform themes available in the page builder. Marks the gallery default theme when configured.","operationId":"EmenuBuilderThemesRestaurantController_listGallery","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmenuBuilderThemeGalleryItemResponseDto"}}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"List active builder themes for the gallery","tags":["E-menu Builder Themes"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/builder-themes/{themeId}/apply":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nMerges theme shell settings into this restaurant’s e-menu settings and replaces all HOME page sections.","operationId":"EmenuBuilderThemesRestaurantController_apply","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuBuilderThemeApplyResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Theme or restaurant not found."}},"security":[{"Bearer":[]}],"summary":"Apply a builder theme","tags":["E-menu Builder Themes"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/google-reviews":{"get":{"operationId":"GoogleReviewsController_getReviews","parameters":[{"name":"place_id","required":true,"in":"query","description":"Google Place ID","schema":{"example":"ChIJN1t_tDeuEmsRUsoyG83frY4","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlaceReviewsResponseDto"}}}},"400":{"description":"Missing or blank place_id query parameter"}},"summary":"Fetch Google Place reviews by Place ID (public)","tags":["Google Reviews"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/emenu/settings":{"get":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nReturns header, footer, product card, category card, theme, social_links, and custom_scripts. Unsaved surfaces fall back live to the platform default theme (not written to the restaurant), same idea as the public HOME page fallback.","operationId":"EmenuSettingsController_getSettings","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"E-menu settings including header, footer, card configurations, theme, social_links, and custom_scripts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSettingsResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."},"404":{"description":"Restaurant not found."}},"security":[{"Bearer":[]}],"summary":"Get e-menu layout settings","tags":["E-menu Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}},"put":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nDeep-merges `header`, `footer`, and card settings (`product_card`, `category_card`, `theme` stored in `config`) — only send the keys you want to change. Nested header keys (`wrapper`, `navigation`, `branding`), footer keys (`wrapper`, `social_icons`, `branding`, `app_buttons`, `title`, `subtitle`, `description`, `bottom_bar`), and theme `style` breakpoints (`mobile`, `tablet`, `desktop`) are merged recursively. `social_links` and `custom_scripts` replace the stored arrays when sent.","operationId":"EmenuSettingsController_updateSettings","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmenuSettingsDto"}}}},"responses":{"200":{"description":"Updated e-menu settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSettingsResponseDto"}}}},"403":{"description":"Requires BRANCH_MANAGER role or above."}},"security":[{"Bearer":[]}],"summary":"Update e-menu layout settings","tags":["E-menu Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/emenu/{restaurantId}/settings":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns header, footer, card configuration, theme, social_links, custom_scripts, and `emenu_order_types` for the requested branch. Surfaces the restaurant has not saved fall back live to the platform default theme (not written to the restaurant). No authentication required.","operationId":"EmenuSettingsPublicController_getSettings","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","description":"When set, `emenu_order_types` is resolved for this branch.","schema":{"type":"string"}}],"responses":{"200":{"description":"E-menu layout settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmenuSettingsResponseDto"}}}},"404":{"description":"Restaurant not found."}},"summary":"Get published e-menu layout settings (public)","tags":["E-menu Settings"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/offline-sync/batches":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nArchives the raw batch, registers the installation, and stores every action in the branch's inbox; actions are applied afterwards, in `occurred_at` order, and their results read from `GET offline-sync/results`. Each action is stored once per restaurant: a resend with the same payload is `duplicate`, the same `action_id` with another payload is `rejected` with `ACTION_ID_REUSED`, and an invalid action is `rejected` (stored as failed when its `action_id` is a UUID, so a resend fails the same way). `results` carries the results of the batch that are already settled. After a failure on an order, later actions on it in the same batch fail `BLOCKED_BY_PREVIOUS_FAILURE`.","operationId":"OfflineSyncController_syncBatch","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID), validated exactly as for `POST /orders`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineSyncBatchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineSyncBatchResponseDto"}}}},"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineSyncBatchResponseDto"}}}},"413":{"description":"More than 200 actions in the batch."}},"security":[{"Bearer":[]}],"summary":"Send actions a POS recorded while offline","tags":["Offline Sync"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/offline-sync/results":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nBy `action_ids` (at most 200; unknown ids are left out), or the results feed of an installation by `installation_id`, `after` the last `next_cursor`, at most `limit` (200). In the order the actions settled; pending ones come last (by `action_ids` only). Views are read at request time.","operationId":"OfflineSyncController_results","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"action_ids","required":false,"in":"query","description":"Comma-separated action ids, at most 200. Unknown ids are left out.","schema":{"minItems":1,"maxItems":200,"format":"uuid","example":"6f1c…,9a2e…","type":"string"}},{"name":"installation_id","required":false,"in":"query","description":"The installation's results feed, in the order actions settled.","schema":{"format":"uuid","type":"string"}},{"name":"after","required":false,"in":"query","description":"With `installation_id`: the `next_cursor` of the previous page.","schema":{"pattern":"^\\d{1,18}$","example":"1042","type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":200,"default":200,"type":"number"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID), validated exactly as for `POST /orders`.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineSyncResultsResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Results of actions sent offline","tags":["Offline Sync"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/offline-sync/devices":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nReturns the installation's letter code (A … Z, then AA, AB, …) for offline receipt numbers, registering it on first call. Idempotent: an installation keeps its code.","operationId":"OfflineSyncController_registerDevice","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"x-branch-id","in":"header","description":"Active branch id (UUID), validated exactly as for `POST /orders`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterOfflineDeviceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineSyncDeviceDto"}}}}},"security":[{"Bearer":[]}],"summary":"Register a POS installation for offline mode","tags":["Offline Sync"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/branches/{branchId}/offline-cashiers":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nReturns the active staff assigned to this branch whose role is CASHIER, each with a bcrypt `password_hash` and the same `user` object `POST /auth/login` returns, so a shared POS can verify email + password (+ account number) offline. The caller must be assigned to this exact branch. Rate limited to 10 requests a minute per user; every call is logged.","operationId":"OfflineCashiersController_list","parameters":[{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineCashiersResponseDto"}}}},"403":{"description":"The caller is not assigned to this branch."},"429":{"description":"More than 10 requests a minute."}},"security":[{"Bearer":[]}],"summary":"The branch's cashiers, with password hashes, for offline sign-in","tags":["Offline Sync"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/offline-sync/issues":{"get":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nRejected offline actions, price discrepancies, shifts amended after close and device clock drift, newest first. Scoped to the branches you are assigned to (every branch for a restaurant admin); `branch_id` narrows to one of them.","operationId":"OfflineSyncIssuesController_list","parameters":[{"name":"x-branch-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"branch_id","required":false,"in":"query","description":"One branch; default every branch you can reach.","schema":{"format":"uuid","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["open","retried","discarded","acknowledged"]}},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["rejected_action","price_discrepancy","shift_amended","clock_drift","table_conflict","booking_conflict","stale_action","time_adjusted","negative_stock","credit_limit_exceeded"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineSyncIssueListDto"}}}}},"security":[{"Bearer":[]}],"summary":"Sync issues in your branches","tags":["Offline Sync"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/offline-sync/issues/{id}/resolve":{"post":{"description":"**Access:** ![Permission: resolve:offline_sync_issues:branch](https://img.shields.io/badge/Permission-resolve%3Aoffline__sync__issues%3Abranch-green)\n\nRequires `resolve:offline_sync_issues:branch`. `retry` (rejected actions only) re-applies the stored action with its original `occurred_at` and actor: success marks the issue `retried` with the resulting order or shift in `details`; failure leaves it `open` with the new error. `discard` requires a `reason`.","operationId":"OfflineSyncIssuesController_resolve","parameters":[{"name":"x-branch-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveOfflineSyncIssueDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineSyncIssueDto"}}}}},"security":[{"Bearer":[]}],"summary":"Retry, discard or acknowledge a sync issue","tags":["Offline Sync"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["resolve:offline_sync_issues:branch"]}}},"/restaurants/{restaurantId}/offline-sync/customers":{"get":{"description":"**Access:** ![Permission: read:customers:restaurant](https://img.shields.io/badge/Permission-read%3Acustomers%3Arestaurant-green)\n\nCompact customers (contact, loyalty balance, credit limit, stamp passes), ordered by `updated_at`. Without `cursor` it lists every active customer; with the last `next_cursor` it lists only what changed since, deleted customers included so the device can drop them. Same permission as `GET /customers`.","operationId":"OfflineCustomersController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page or download. Without it the whole active directory is listed; with it, customers changed after it, deleted ones included.","schema":{"maxLength":200,"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":1000,"default":500,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineCustomersResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"The restaurant's customers, for a POS to search offline","tags":["Offline Sync"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:restaurant"]}}},"/customers":{"post":{"description":"**Access:** ![Permission: manage:customers:branch](https://img.shields.io/badge/Permission-manage%3Acustomers%3Abranch-green)\n\nManually create a customer record scoped to the active restaurant. `phone` is required and must be unique within the restaurant. Requires `manage:customers:restaurant`.","operationId":"CustomersController_create","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerProfileDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerProfileDto"}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Create a customer","tags":["Customers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customers:branch"]}},"get":{"description":"**Access:** ![Permission: read:customers:restaurant](https://img.shields.io/badge/Permission-read%3Acustomers%3Arestaurant-green)\n\nPaginated list of all customers in the active restaurant (not limited to the caller’s branch assignment). Supports search (`q`) and multi-select status filters. Requires `read:customers:branch` (restaurant scope satisfies via matcher).","operationId":"CustomersController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"q","required":false,"in":"query","description":"Search name, Arabic name, phone, or email. An exact 7-character gift card code (e.g. `GC1A2B3`) or loyalty pass serial (e.g. `AB1-CD2`) also matches the owning customer in the active restaurant.","schema":{"maxLength":120,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["active","blocked"]}}},{"name":"expand","required":false,"in":"query","description":"Relations to include. Comma-separated or repeated. Valid: loyalty, loyalty_passes, loyalty_passes_theme, loyalty_transactions, gift_cards. loyalty_passes_theme also implies loyalty_passes.","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["loyalty","loyalty_passes","loyalty_passes_theme","loyalty_transactions","gift_cards"]}}},{"name":"locale","required":false,"in":"query","description":"Locale for exported column headers.","schema":{"type":"string","enum":["ar","en"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListResponseDto"}}}},"400":{"description":"Invalid query params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"List customers","tags":["Customers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:restaurant"]}}},"/customers/export":{"get":{"description":"**Access:** ![Permission: read:customers:restaurant](https://img.shields.io/badge/Permission-read%3Acustomers%3Arestaurant-green)\n\nStreams a CSV of every customer matching the current search/status filters (not paginated). Pass `locale=ar|en` to localize the column headers.","operationId":"CustomersController_export","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"q","required":false,"in":"query","description":"Search name, Arabic name, phone, or email. An exact 7-character gift card code (e.g. `GC1A2B3`) or loyalty pass serial (e.g. `AB1-CD2`) also matches the owning customer in the active restaurant.","schema":{"maxLength":120,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["active","blocked"]}}},{"name":"expand","required":false,"in":"query","description":"Relations to include. Comma-separated or repeated. Valid: loyalty, loyalty_passes, loyalty_passes_theme, loyalty_transactions, gift_cards. loyalty_passes_theme also implies loyalty_passes.","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["loyalty","loyalty_passes","loyalty_passes_theme","loyalty_transactions","gift_cards"]}}},{"name":"locale","required":false,"in":"query","description":"Locale for exported column headers.","schema":{"type":"string","enum":["ar","en"]}}],"responses":{"200":{"description":"CSV file","content":{"text/csv; charset=utf-8":{"schema":{"type":"string","format":"binary"}}}}},"summary":"Export customers to CSV","tags":["Customers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:restaurant"]}}},"/customers/{id}":{"get":{"description":"**Access:** ![Permission: read:customers:restaurant](https://img.shields.io/badge/Permission-read%3Acustomers%3Arestaurant-green)\n\nContact details, loyalty balance, block status, and lifetime stats. Use `expand` to include loyalty_passes, loyalty_transactions, or gift_cards. Requires `read:customers:branch` (restaurant scope satisfies via matcher).","operationId":"CustomersController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to include. Comma-separated or repeated. Valid: loyalty_passes, loyalty_passes_theme, loyalty_transactions, gift_cards. loyalty_passes_theme also implies loyalty_passes.","schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["loyalty","loyalty_passes","loyalty_passes_theme","loyalty_transactions","gift_cards"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerProfileDto"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Get customer profile","tags":["Customers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:restaurant"]}},"patch":{"description":"**Access:** ![Permission: manage:customers:branch](https://img.shields.io/badge/Permission-manage%3Acustomers%3Abranch-green)\n\nUpdate contact fields and block/unblock via `status` or `isActive`. Requires `manage:customers:restaurant`.","operationId":"CustomersController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerProfileDto"}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Update customer profile","tags":["Customers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customers:branch"]}},"delete":{"description":"**Access:** ![Permission: manage:customers:restaurant](https://img.shields.io/badge/Permission-manage%3Acustomers%3Arestaurant-green)\n\nErases personal data, tombstones the phone so it can register again, and retains the row for historical order data. The customer disappears from listings. Requires `manage:customers:restaurant`.","operationId":"CustomersController_delete","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Customer deleted"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Delete a customer","tags":["Customers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customers:restaurant"]}}},"/customers/{id}/orders":{"get":{"description":"**Access:** ![Permission: read:customers:restaurant](https://img.shields.io/badge/Permission-read%3Acustomers%3Arestaurant-green)\n\nPaginated order history for a customer, scoped to the caller’s branch access. Returns filter-scoped stats (totals, paid/unpaid counts, unpaid amount, average order value) alongside the order list. Supports branch, date range, and payment status filters.","operationId":"CustomersController_listOrders","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"example":"COMPLETED,READY","type":"array","items":{"type":"string","enum":["PENDING","ACCEPTED","PREPARING","READY","COMPLETED","CANCELLED","VOIDED","REJECTED"]}}},{"name":"order_type","required":false,"in":"query","schema":{"example":"DINE_IN,DELIVERY","type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]}}},{"name":"start_date","required":false,"in":"query","description":"ISO date string (start inclusive)","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date string (end inclusive)","schema":{"type":"string"}},{"name":"branch_ids","required":false,"in":"query","description":"Optional branch filter (CSV list of branch ids)","schema":{"type":"array","items":{"type":"string"}}},{"name":"payment_status","required":false,"in":"query","description":"Filter by payment status","schema":{"example":"PAID,UNPAID,PARTIAL","type":"array","items":{"type":"string","enum":["PAID","PARTIAL","UNPAID","DEFERRED"]}}},{"name":"expand","required":false,"in":"query","description":"Comma-separated expand keys: channel,branch,staff,items.product,items.variant,items.options. Customer is always included.","schema":{"example":"channel,branch","type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOrdersListResponseDto"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"List customer orders with filtered stats","tags":["Customers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:restaurant"]}}},"/customers/{id}/notes":{"get":{"operationId":"CustomersController_listNotes","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerNoteDto"}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"List internal notes for a customer (newest first)","tags":["Customers"],"description":"**Access:** ![Permission: read:customers:restaurant](https://img.shields.io/badge/Permission-read%3Acustomers%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:restaurant"]}},"post":{"operationId":"CustomersController_createNote","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerNoteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerNoteDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerNoteDto"}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Add an internal note to a customer","tags":["Customers"],"description":"**Access:** ![Permission: manage:customers:branch](https://img.shields.io/badge/Permission-manage%3Acustomers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customers:branch"]}}},"/customers/{id}/notes/{noteId}":{"delete":{"operationId":"CustomersController_deleteNote","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"noteId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Note deleted"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer or note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Delete an internal customer note","tags":["Customers"],"description":"**Access:** ![Permission: manage:customers:branch](https://img.shields.io/badge/Permission-manage%3Acustomers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:customers:branch"]}}},"/customers/credit":{"get":{"description":"**Access:** ![Permission: read:customers:branch](https://img.shields.io/badge/Permission-read%3Acustomers%3Abranch-green)\n\nEvery customer carrying an outstanding deferred balance, sorted by how much they owe. Balances are derived from their open deferred orders (total − paid − net return credit), never stored, so the book cannot drift from the orders it summarizes.","operationId":"CustomerCreditController_creditBook","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Customer name / phone.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBookResponseDto"}}}},"401":{"description":"Not authenticated"},"403":{"description":"Insufficient permissions"}},"summary":"Credit book — customers with money on account (آجل)","tags":["Customer Credit"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:branch"]}}},"/customers/{id}/credit/statement":{"get":{"description":"**Access:** ![Permission: read:customers:branch](https://img.shields.io/badge/Permission-read%3Acustomers%3Abranch-green)\n\nChronological account activity: each deferred sale as a debit, each payment as a credit, with a running balance folded oldest-first over the FULL history — the date window only trims which entries are shown, so the first visible balance is already correct. Settled tabs stay listed; the statement is a complete history, not just open debt.","operationId":"CustomerCreditController_statement","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","description":"ISO date string — trims shown entries, not the balance.","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","description":"ISO date string (end inclusive).","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditStatementResponseDto"}}}},"401":{"description":"Not authenticated"},"403":{"description":"Insufficient permissions"},"404":{"description":"Customer not found"}},"summary":"Customer account statement","tags":["Customer Credit"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:customers:branch"]}}},"/customers/{id}/credit/payments":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nTakes one amount on one tender and allocates it oldest-first across the customer’s open deferred orders, each allocation landing as a normal order payment attributed to the shift that received it. Orders that become fully paid fire their normal post-payment effects. The amount must not exceed the customer’s outstanding balance.","operationId":"CustomerCreditController_settle","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettleCustomerAccountDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResultDto"}}}},"400":{"description":"Unknown or inactive payment method / invalid amount"},"404":{"description":"Customer not found"},"422":{"description":"No outstanding balance, or amount exceeds it"}},"summary":"Settle a customer account (آجل)","tags":["Customer Credit"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/customers/{id}/credit/payment-link":{"post":{"description":"**Access:** ![Membership: CASHIER](https://img.shields.io/badge/Membership-CASHIER-blueviolet)\n\nCreates a hosted gateway link (the restaurant’s configured online gateway) for the amount — or the full outstanding balance when omitted. Manual tenders never carry ONLINE; a link is the only way online money enters the credit book. When the gateway confirms payment, the captured amount is allocated oldest-first across the customer’s open deferred orders on the ONLINE method, exactly as a cashier settlement would allocate it — no further action needed.","operationId":"CustomerCreditController_createPaymentLink","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditPaymentLinkDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPaymentLinkResponseDto"}}}},"400":{"description":"No outstanding balance, amount exceeds it, or no gateway configured"},"404":{"description":"Customer not found"}},"summary":"Create a payment link that settles a customer account (آجل)","tags":["Customer Credit"],"x-authorization":{"isPublic":false,"roles":[],"membership":"CASHIER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/customer/me":{"get":{"description":"Customer-only. Returns the authenticated customer profile for this restaurant (name, phone, email, address, loyalty points, stats). Does not include loyalty passes or notes.","operationId":"CustomerMeController_me","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerProfileDto"}}}},"401":{"description":"Missing or invalid customer JWT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Not a customer token, or restaurant mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get my customer profile","tags":["Customer Account"]},"delete":{"description":"Customer-only. Permanently deletes this restaurant account: personal data is erased, sessions are revoked, and the phone number can register again. Order history is kept for restaurant records without identifying details.","operationId":"CustomerMeController_deleteMe","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant UUID","schema":{"type":"string"}}],"responses":{"204":{"description":"Account deleted"},"401":{"description":"Missing or invalid customer JWT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"Not a customer token, or restaurant mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Delete my customer account","tags":["Customer Account"]}},"/subscription/pay":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nReturns the gateway widget config to pay for a plan on a branch. On successful payment the provider calls `POST /subscription/callback`, which creates the branch subscription.","operationId":"PlatformPaymentsController_createPayment","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionPaymentDto"}}}},"responses":{"201":{"description":"Gateway payment initiation result. For redirect gateways (e.g. MyFatoorah) contains `checkoutUrl` to send the customer to.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Branch or plan not found / inactive, or payment not configured."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires RESTAURANT_ADMIN; branch must belong to the caller."}},"security":[{"Bearer":[]}],"summary":"Pay to onboard a NEW subscription for a branch (RESTAURANT_ADMIN)","tags":["Platform Payments"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/subscription/purchase":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nPrices the change server-side, records a PENDING charge and returns the gateway widget. The change is applied only once `POST /subscription/callback` confirms the payment.","operationId":"PlatformPaymentsController_purchaseChange","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseSubscriptionChangeDto"}}}},"responses":{"201":{"description":"Gateway payment initiation result. For redirect gateways (e.g. MyFatoorah) contains `checkoutUrl` to send the customer to.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"No active subscription, unknown/boolean feature, or feature not self-purchasable."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Branch does not belong to the caller."}},"security":[{"Bearer":[]}],"summary":"Pay to change an EXISTING subscription — add-on, plan change or renewal (RESTAURANT_ADMIN or SUPER_ADMIN)","tags":["Platform Payments"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/subscription/webhook":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nServer-to-server webhook. The signature is verified and the payment re-checked with the provider before any subscription change is applied. Always returns `{ ok: true }` to prevent retries.","operationId":"PlatformPaymentsController_webhook","parameters":[{"name":"myfatoorah-signature","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}},"summary":"Subscription payment webhook (provider → server)","tags":["Platform Payments"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/subscription/callback":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe provider redirects the customer here. Re-verifies the payment (URL params are not trusted), applies the change, then 302-redirects to the frontend result page.","operationId":"PlatformPaymentsController_redirect","parameters":[{"name":"message","required":false,"in":"query","schema":{}},{"name":"status","required":false,"in":"query","schema":{}},{"name":"id","required":false,"in":"query","description":"Provider payment id.","schema":{}},{"name":"payment_id","required":false,"in":"query","description":"MyFatoorah payment id.","schema":{}}],"responses":{"200":{"description":""}},"summary":"Browser return URL after subscription payment","tags":["Platform Payments"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/payment-providers":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)\n\nOne entry per provider, stored or not. Secrets appear only as `{ set, last4 }` under `secrets`.","operationId":"PlatformPaymentProvidersController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPaymentProviderResponseDto"}}}}},"403":{"description":"Not a super admin (writes) or platform admin (reads)."}},"security":[{"Bearer":[]}],"summary":"Every platform payment provider, credentials masked","tags":["Payment providers (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_settings:platform"]}}},"/super-admin/payment-providers/{provider}":{"get":{"operationId":"PlatformPaymentProvidersController_get","parameters":[{"name":"provider","required":true,"in":"path","schema":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPaymentProviderResponseDto"}}}},"403":{"description":"Not a super admin (writes) or platform admin (reads)."},"404":{"description":"PAYMENT_PROVIDER_UNKNOWN"}},"security":[{"Bearer":[]}],"summary":"One platform payment provider, credentials masked","tags":["Payment providers (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_settings:platform"]}},"patch":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_settings:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__settings%3Aplatform-green) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)\n\nChecked on the merged result:\n- **PAYMENT_PROVIDER_CONFIG_INVALID** (400, per-field `details`): a Moyasar key of the wrong kind or mode (`sk_test_`/`pk_test_` in sandbox, `sk_live_`/`pk_live_` in production; a `pk_` key in `secret_key` or the reverse); a base URL off the gateway's API hosts, or a MyFatoorah sandbox host in production (and the reverse); Moyasar enabled in production without `webhook_secret`.\n- **PAYMENT_PROVIDER_NOT_CONFIGURED** (400): `enabled: true` while a required credential is missing.\n\nChanging anything but `enabled` clears the provider's `last_check`.","operationId":"PlatformPaymentProvidersController_update","parameters":[{"name":"provider","required":true,"in":"path","schema":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"}}],"requestBody":{"required":true,"description":"The provider's config DTO, every field optional. Omitted fields keep their value; `null` clears an optional field; an empty string in a secret field is ignored (the stored secret stays). `environment` is the mode: `sandbox` = test, `production` = live.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HyperPayProviderConfigDto"},{"$ref":"#/components/schemas/TamaraProviderConfigDto"},{"$ref":"#/components/schemas/PaymobProviderConfigDto"},{"$ref":"#/components/schemas/MyfatoorahProviderConfigDto"},{"$ref":"#/components/schemas/AfsPayProviderConfigDto"},{"$ref":"#/components/schemas/NeoleapProviderConfigDto"},{"$ref":"#/components/schemas/MoyasarProviderConfigDto"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPaymentProviderResponseDto"}}}},"400":{"description":"PAYMENT_PROVIDER_CONFIG_INVALID, PAYMENT_PROVIDER_NOT_CONFIGURED or a field validation error"},"403":{"description":"Not a super admin (writes) or platform admin (reads)."},"404":{"description":"PAYMENT_PROVIDER_UNKNOWN"}},"security":[{"Bearer":[]}],"summary":"Update one platform payment provider's settings","tags":["Payment providers (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_settings:platform","read:platform_settings:platform"]}}},"/super-admin/payment-providers/{provider}/test":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_settings:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__settings%3Aplatform-green) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)\n\nOne cheap, read-only call with the **saved** settings; nothing is charged or created. The outcome is stored and returned as the provider's `last_check`. A refusal or a timeout (10 s) is `ok: false` with the reason in `message`, not an error.\n\n- MyFatoorah: `POST /v2/InitiatePayment` (lists the account's payment methods; MyFatoorah stores nothing).\n- Moyasar: the SDK's `ping()` (`GET /v1/webhooks/available_events`, secret key only), after checking the key prefixes against the mode.\n- Others: **PAYMENT_PROVIDER_CHECK_UNSUPPORTED** (400); `check_supported` is false for them.","operationId":"PlatformPaymentProvidersController_test","parameters":[{"name":"provider","required":true,"in":"path","schema":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProviderCheckDto"}}}},"400":{"description":"PAYMENT_PROVIDER_CHECK_UNSUPPORTED, or PAYMENT_PROVIDER_NOT_CONFIGURED before the credentials are saved"},"403":{"description":"Not a super admin (writes) or platform admin (reads)."},"404":{"description":"PAYMENT_PROVIDER_UNKNOWN"}},"security":[{"Bearer":[]}],"summary":"Check the stored credentials against the gateway","tags":["Payment providers (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_settings:platform","read:platform_settings:platform"]}}},"/restaurant-payments/pay":{"post":{"description":"Prices the checkout, opens a pending gateway transaction, and returns the hosted checkout URL to redirect the customer to. The order is created only once the gateway confirms payment (via webhook or return URL).","operationId":"RestaurantPaymentsController_createOrderPayment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderPaymentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPaymentUrlResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPaymentUrlResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Initiate an online payment for an e-menu checkout (customer)","tags":["Restaurant Payments"]}},"/restaurant-payments/confirm":{"post":{"description":"Called when the embedded card form finishes. Re-verifies with the gateway, creates the order exactly once, and returns where to send the customer.","operationId":"RestaurantPaymentsController_confirm","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmOrderPaymentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmOrderPaymentResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Confirm an in-page (embedded) card payment (customer)","tags":["Restaurant Payments"]}},"/restaurant-payments/options":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nTells the e-menu whether online payment can be offered. Online payment is only available while the restaurant has an enabled payment gateway.","operationId":"RestaurantPaymentsController_getOptions","parameters":[{"name":"restaurant_id","required":true,"in":"query","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"online_payment_enabled":{"type":"boolean"},"gateway":{"type":"string","nullable":true},"checkout_mode":{"type":"string","enum":["EMBEDDED","HOSTED"]},"card_networks":{"type":"array","items":{"type":"string"},"description":"Networks the restaurant accepts (empty = every network on the account)."},"gateways":{"type":"array","description":"Every enabled gateway the customer may pick, default first.","items":{"type":"object","properties":{"gateway":{"type":"string","enum":["myfatoorah","tamara"]},"checkout_mode":{"type":"string","enum":["EMBEDDED","HOSTED"]},"card_networks":{"type":"array","items":{"type":"string"}}}}}}}}}}},"summary":"Get available checkout payment options for a restaurant (public)","tags":["Restaurant Payments"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurant-payments/webhook":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nServer-to-server webhook. The payment is re-verified with the gateway before the order is created. Always returns `{ ok: true }` to prevent retries.","operationId":"RestaurantPaymentsController_webhook","parameters":[{"name":"myfatoorah-signature","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}},"summary":"Restaurant order payment webhook (gateway → server)","tags":["Restaurant Payments"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurant-payments/webhook/tamara":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nRegister this URL in the restaurant's Tamara partner portal (Order events, Approved at least). The `tamaraToken` JWT is checked against the notification token and the order is re-read with Tamara before it is created. Always returns `{ ok: true }`.","operationId":"RestaurantPaymentsController_tamaraWebhook","parameters":[{"name":"tamara_token","required":false,"in":"query","schema":{"type":"string"}},{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}},"summary":"Tamara order webhook (gateway → server)","tags":["Restaurant Payments"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurant-payments/callback":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe gateway redirects the customer here. Re-verifies the payment (URL params are not trusted), creates the order if paid, then 302-redirects to the frontend result page.","operationId":"RestaurantPaymentsController_redirect","parameters":[{"name":"status","required":false,"in":"query","schema":{}},{"name":"payment_id","required":false,"in":"query","schema":{}}],"responses":{"200":{"description":""}},"summary":"Browser return URL after an order payment","tags":["Restaurant Payments"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{orderId}/online-payment/refund":{"post":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nSends the money back to the customer via the gateway that took it (MyFatoorah, Moyasar, Tamara). Partial refunds add up and are capped at the captured amount. MyFatoorah queues refunds: the answer is PENDING until its finance team executes it, which needs enough refund balance on the account; follow it with GET …/refunds. A gateway refusal answers 400 with its reason. This only moves money: record the return or void on the order as usual.","operationId":"OnlineRefundsController_refund","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundOnlinePaymentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnlineRefundResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Refund an order's online payment through its gateway (staff)","tags":["Restaurant Payments"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/orders/{orderId}/online-payment/refunds":{"get":{"description":"**Access:** ![Membership: BRANCH_MANAGER](https://img.shields.io/badge/Membership-BRANCH__MANAGER-blueviolet)\n\nNewest first. Refunds the gateway has not settled are looked up with it first, so a missed webhook does not leave them pending.","operationId":"OnlineRefundsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentRefundDto"}}}}}},"security":[{"Bearer":[]}],"summary":"An order's online-payment refunds and where each stands (staff)","tags":["Restaurant Payments"],"x-authorization":{"isPublic":false,"roles":[],"membership":"BRANCH_MANAGER","feature":null,"permissions":[]}}},"/billing/plan-features":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe fixed catalog of billable features that plans are composed from. Each feature has a stable `key` (slug) and a `value_type` of BOOLEAN (capability) or LIMIT (max count; `0` = disabled, `-1` = unlimited). Public read.","operationId":"PlanFeaturesController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"value_type","required":false,"in":"query","schema":{"type":"string","enum":["BOOLEAN","LIMIT"]}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanFeatureListResponseDto"}}}}},"summary":"List the predefined feature catalog","tags":["Plan Features"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/plan-features/{id}":{"get":{"operationId":"PlanFeaturesController_findOne","parameters":[{"name":"id","required":true,"in":"path","description":"Plan feature ID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanFeatureResponseDto"}}}},"404":{"description":"Plan feature not found."}},"summary":"Get a predefined feature by ID","tags":["Plan Features"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/subscription-plans":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nSellable plans, each with its composed feature values (bool / limit). Public read.","operationId":"SubscriptionPlansController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"billing_cycle","required":false,"in":"query","schema":{"type":"string","enum":["MONTHLY","YEARLY"]}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanListResponseDto"}}}}},"summary":"List subscription plans","tags":["Subscription Plans"],"x-authorization":{"isPublic":true,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}},"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscription_plans:platform](https://img.shields.io/badge/Permission-manage%3Asubscription__plans%3Aplatform-green)\n\nCreates a plan and its `features[]`. Each entry references a catalog `feature_key` and supplies the value matching its type (bool_value / limit_value).","operationId":"SubscriptionPlansController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionPlanDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanResponseDto"}}}},"201":{"description":"Plan created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanResponseDto"}}}},"400":{"description":"Unknown feature key or value not matching its value type."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."}},"security":[{"Bearer":[]}],"summary":"Create a subscription plan (platform)","tags":["Subscription Plans"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscription_plans:platform"]}}},"/subscription-plans/{id}":{"get":{"operationId":"SubscriptionPlansController_findOne","parameters":[{"name":"id","required":true,"in":"path","description":"Subscription plan ID (seeded plans use slugs)","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanResponseDto"}}}},"404":{"description":"Subscription plan not found."}},"summary":"Get a subscription plan by ID","tags":["Subscription Plans"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}},"put":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscription_plans:platform](https://img.shields.io/badge/Permission-manage%3Asubscription__plans%3Aplatform-green)\n\nEdits plan terms; when `features[]` is provided it fully replaces the plan values. Subscribers keep their snapshot (price and features) until their next renewal.","operationId":"SubscriptionPlansController_update","parameters":[{"name":"id","required":true,"in":"path","description":"Subscription plan ID (seeded plans use slugs)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubscriptionPlanDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanResponseDto"}}}},"400":{"description":"Unknown feature key or value not matching its value type."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Subscription plan not found."}},"security":[{"Bearer":[]}],"summary":"Update a subscription plan (platform)","tags":["Subscription Plans"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscription_plans:platform"]}},"delete":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscription_plans:platform](https://img.shields.io/badge/Permission-manage%3Asubscription__plans%3Aplatform-green)\n\nRefused (409 BILLING_PLAN_HAS_SUBSCRIBERS) while restaurants are on it or scheduled for it, or legacy branch subscriptions use it: deactivate it (is_active = false) instead.","operationId":"SubscriptionPlansController_remove","parameters":[{"name":"id","required":true,"in":"path","description":"Subscription plan ID","schema":{"type":"string"}}],"responses":{"204":{"description":"Plan deleted."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Subscription plan not found."}},"security":[{"Bearer":[]}],"summary":"Delete a subscription plan (platform)","tags":["Subscription Plans"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscription_plans:platform"]}}},"/subscription-plans/{id}/prices/{country}":{"put":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscription_plans:platform](https://img.shields.io/badge/Permission-manage%3Asubscription__plans%3Aplatform-green)\n\nCreates or replaces the plan price for one country. The currency is the country’s display currency. `periods: []` keeps the row but stops selling the plan there. Setting SA also rewrites the plan-level (deprecated) price fields.","operationId":"SubscriptionPlansController_setPrice","parameters":[{"name":"id","required":true,"in":"path","description":"Subscription plan ID","schema":{"type":"string"}},{"name":"country","required":true,"in":"path","description":"Country code (SA, EG)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPlanPriceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanResponseDto"}}}},"404":{"description":"Plan or country not found."}},"security":[{"Bearer":[]}],"summary":"Set a plan price in a country (super-admin)","tags":["Subscription Plans"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscription_plans:platform"]}},"delete":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscription_plans:platform](https://img.shields.io/badge/Permission-manage%3Asubscription__plans%3Aplatform-green)\n\nRemoves the country price. Existing subscribers keep their snapshot. SA cannot be removed (400): set its periods to [] instead.","operationId":"SubscriptionPlansController_removePrice","parameters":[{"name":"id","required":true,"in":"path","description":"Subscription plan ID","schema":{"type":"string"}},{"name":"country","required":true,"in":"path","description":"Country code","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Stop selling a plan in a country (super-admin)","tags":["Subscription Plans"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscription_plans:platform"]}}},"/branches/{branchId}/subscription":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nSnapshots the plan (price, billing cycle, feature values) onto a new active subscription for the branch. Fails if the branch already has an active subscription.","operationId":"BranchSubscriptionsController_create","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBranchSubscriptionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"201":{"description":"Subscription created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Branch or plan not found."},"409":{"description":"Branch already has an active subscription."}},"security":[{"Bearer":[]}],"summary":"Create a branch subscription from a plan (SUPER_ADMIN)","tags":["Branch Subscriptions"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}},"get":{"operationId":"BranchSubscriptionsController_getStatus","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchBillingStatusResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Branch not found."}},"security":[{"Bearer":[]}],"summary":"Get a branch billing status (SUPER_ADMIN)","tags":["Branch Subscriptions"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/branches/{branchId}/subscription/change-plan":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nCancels the current subscription and creates a fresh one snapshotted from the target plan. Existing subscriptions are never mutated in place.","operationId":"BranchSubscriptionsController_changePlan","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePlanDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"201":{"description":"Plan changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Branch or plan not found."}},"security":[{"Bearer":[]}],"summary":"Change a branch to another plan (SUPER_ADMIN)","tags":["Branch Subscriptions"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/branches/{branchId}/subscription/renew":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nExtends the latest (active or expired) subscription by its billing cycle and re-snapshots entitlements + price from the plan. Reactivates a lapsed branch.","operationId":"BranchSubscriptionsController_renew","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewSubscriptionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"201":{"description":"Subscription renewed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Branch has no subscription to renew."}},"security":[{"Bearer":[]}],"summary":"Renew the branch subscription (SUPER_ADMIN)","tags":["Branch Subscriptions"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/branches/{branchId}/subscription/cancel":{"patch":{"operationId":"BranchSubscriptionsController_cancel","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionDto"}}}},"responses":{"200":{"description":"Subscription cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Branch has no active subscription."}},"security":[{"Bearer":[]}],"summary":"Cancel the active branch subscription (SUPER_ADMIN)","tags":["Branch Subscriptions"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/branches/{branchId}/subscription/overrides":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nApplies a bool/limit delta on top of the active subscription (e.g. +5 staff seats), co-terminus with the subscription. Records a priced ledger entry.","operationId":"BranchSubscriptionsController_addOverride","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOverrideDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"201":{"description":"Override added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}}}},"400":{"description":"Unknown feature key or delta not matching its value type."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Branch has no active subscription."}},"security":[{"Bearer":[]}],"summary":"Add a mid-cycle feature override / add-on (SUPER_ADMIN)","tags":["Branch Subscriptions"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/branches/{branchId}/subscription/ledger":{"get":{"operationId":"BranchSubscriptionsController_getLedger","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BillingLedgerEntryResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."},"404":{"description":"Branch not found."}},"security":[{"Bearer":[]}],"summary":"Get a branch billing ledger (SUPER_ADMIN)","tags":["Branch Subscriptions"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/restaurants/{restaurantId}/subscriptions":{"get":{"operationId":"BranchSubscriptionsController_listForRestaurant","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant ID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchBillingStatusResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."}},"security":[{"Bearer":[]}],"summary":"List every branch billing status for a restaurant (SUPER_ADMIN)","tags":["Branch Subscriptions"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/branches/{branchId}/subscription/usage":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nBranch-scoped features with effective limit (snapshot + overrides), live `used` count and `remaining`.","operationId":"BranchSubscriptionsController_getBranchUsage","parameters":[{"name":"branchId","required":true,"in":"path","description":"Branch ID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureUsageResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."}},"security":[{"Bearer":[]}],"summary":"Branch feature usage / consumption (SUPER_ADMIN)","tags":["Branch Subscriptions"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/restaurants/{restaurantId}/subscription/usage":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nPooled restaurant-wide features (e.g. CUSTOMERS) with limit, used and remaining.","operationId":"BranchSubscriptionsController_getRestaurantUsage","parameters":[{"name":"restaurantId","required":true,"in":"path","description":"Restaurant ID","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureUsageResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN."}},"security":[{"Bearer":[]}],"summary":"Restaurant-scoped (pooled) feature usage / consumption (SUPER_ADMIN)","tags":["Branch Subscriptions"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/subscription":{"get":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nRESTAURANT_ADMIN self-service. The restaurant is resolved from the JWT, so a caller can only ever see their own tenant.","operationId":"SubscriptionSelfController_getMySubscriptions","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant ID — SUPER_ADMIN only; ignored for STAFF (resolved from the JWT).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchBillingStatusResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires RESTAURANT_ADMIN membership."}},"security":[{"Bearer":[]}],"summary":"Get every branch's billing status for the current restaurant","tags":["Restaurant Subscriptions"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/subscription/usage":{"get":{"description":"**Access:** ![Membership: SERVICE_PROVIDER](https://img.shields.io/badge/Membership-SERVICE__PROVIDER-blueviolet)\n\nOne-call full picture: restaurant-scoped (pooled) features + each branch's branch-scoped usage, with effective limits, live `used` counts and `remaining`. Readable by any member of the restaurant.","operationId":"SubscriptionSelfController_getMyUsage","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantUsageResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires a membership in the restaurant."}},"security":[{"Bearer":[]}],"summary":"Feature usage / consumption for the current restaurant","tags":["Restaurant Subscriptions"],"x-authorization":{"isPublic":false,"roles":[],"membership":"SERVICE_PROVIDER","feature":null,"permissions":[]}}},"/subscription/access":{"get":{"description":"**Access:** ![Membership: SERVICE_PROVIDER](https://img.shields.io/badge/Membership-SERVICE__PROVIDER-blueviolet)\n\nThe server's verdict behind the subscription lock: `locked` is what every other staff route enforces (403 `AUTH_BRANCH_SUBSCRIPTION_EXPIRED`). `access_ends_at` with `server_time` lets a client lock at the exact moment without trusting its own clock, and unlock as soon as a renewal is confirmed.","operationId":"SubscriptionSelfController_getMyAccess","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionAccessResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires a membership in the restaurant."}},"security":[{"Bearer":[]}],"summary":"Whether the restaurant may use the system right now","tags":["Restaurant Subscriptions"],"x-authorization":{"isPublic":false,"roles":[],"membership":"SERVICE_PROVIDER","feature":null,"permissions":[]}}},"/subscription/standing":{"get":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nTotal sales (the sales report’s definition, all time), completed orders, customers and the start date. Totals only; readable while the subscription lock is on.","operationId":"SubscriptionSelfController_getMyStanding","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountStandingResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires RESTAURANT_ADMIN membership."}},"security":[{"Bearer":[]}],"summary":"Lifetime figures of the restaurant (RESTAURANT_ADMIN)","tags":["Restaurant Subscriptions"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/super-admin/countries":{"get":{"operationId":"CountriesAdminController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CountryResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"All countries, enabled or not, with usage counts","tags":["Countries (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}},"post":{"operationId":"CountriesAdminController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCountryDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountryResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Add a country (disabled unless `enabled: true`)","tags":["Countries (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/countries/backfill-exceptions":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nEvery restaurant was backfilled from `settings.general.country`, falling back to SA. This lists the ones where that was a guess or where billing state disagrees with the country (see `reasons`). Fix one with `PUT /super-admin/restaurants/{id}/country`. `POS_CURRENCY_DIFFERS` alone is informational.","operationId":"CountriesAdminController_exceptions","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BackfillExceptionResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"Restaurants whose billing country needs a look","tags":["Countries (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/countries/{code}":{"get":{"operationId":"CountriesAdminController_get","parameters":[{"name":"code","required":true,"in":"path","schema":{"example":"EG","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountryResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"One country with its usage counts","tags":["Countries (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}},"patch":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nChanging `gateway` affects new card payments only; saved cards keep charging through the gateway that issued them. Changing `charge_currency` affects invoices created afterwards.","operationId":"CountriesAdminController_update","parameters":[{"name":"code","required":true,"in":"path","schema":{"example":"EG","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCountryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountryResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Edit a country","tags":["Countries (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}},"delete":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\n409 COUNTRY_IN_USE when restaurants, sign-ups or plan prices use it (and always for SA).","operationId":"CountriesAdminController_remove","parameters":[{"name":"code","required":true,"in":"path","schema":{"example":"AE","type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete an unused country","tags":["Countries (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/restaurants/{restaurantId}/products":{"get":{"operationId":"ProductsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"source","required":false,"in":"query","description":"Which surface is asking, for automatic-promotion scoping. Inferred from the caller (staff token = pos, otherwise emenu) when omitted, so existing clients need no change.","schema":{"type":"string","enum":["pos","emenu","table_session","service_booking","delivery_app"]}},{"name":"order_type","required":false,"in":"query","description":"How the order will be fulfilled, for automatic promotions scoped to order types. Omit to price as if every order type qualified (the menu card view).","schema":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]}},{"name":"type","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["PRODUCT","SERVICE"]}}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["ACTIVE","INACTIVE","ARCHIVED"]}},{"name":"category_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"show_in_menu","required":false,"in":"query","description":"Filter by e-menu visibility. Pass true to return only menu-visible products.","schema":{"type":"boolean"}},{"name":"sort_by","required":false,"in":"query","schema":{"type":"string","enum":["name","base_price","sort_order","created_at"]}},{"name":"sort_dir","required":false,"in":"query","description":"Sort direction. Ignored when sort_by is omitted. Defaults to asc.","schema":{"type":"string","enum":["asc","desc"]}},{"name":"branch_id","required":false,"in":"query","description":"Branch ID for effective price resolution","schema":{"format":"uuid","type":"string"}},{"name":"channel_id","required":false,"in":"query","description":"Channel ID for effective price resolution","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductListResponseDto"}}}}},"summary":"List products with filters and pagination","tags":["Products"]},"post":{"operationId":"ProductsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}}},"summary":"Create a product with optional inline variants and option groups","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/legacy-variants/summary":{"get":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nCheap aggregate for the products-page callout. Counts only the products that are actually safe to clean up.","operationId":"ProductsController_legacyVariantsSummary","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyVariantSummaryResponseDto"}}}}},"summary":"Count products left with only the migrator placeholder variant","tags":["Products"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/products/legacy-variants":{"get":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nDeletable products sort first, so the head of the list matches the count in the callout. The rest follow with the reasons they were left out.","operationId":"ProductsController_listLegacyVariants","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"eligible_only","required":false,"in":"query","description":"Return only the products that can actually be cleaned up. Omit to also receive the ones left out, each carrying the reasons why.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyVariantListResponseDto"}}}}},"summary":"List products left with only the migrator placeholder variant","tags":["Products"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/products/legacy-variants/cleanup":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nEvery id is re-validated against the predicate before deletion. Products that stopped matching are reported under `skipped` instead of failing the whole request.","operationId":"ProductsController_cleanupLegacyVariants","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupLegacyVariantsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyVariantCleanupResponseDto"}}}}},"summary":"Delete the migrator placeholder variants","tags":["Products"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/products/{productId}":{"get":{"operationId":"ProductsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","description":"Which surface is asking, for automatic-promotion scoping. Inferred from the caller (staff token = pos, otherwise emenu) when omitted, so existing clients need no change.","schema":{"type":"string","enum":["pos","emenu","table_session","service_booking","delivery_app"]}},{"name":"order_type","required":false,"in":"query","description":"How the order will be fulfilled, for automatic promotions scoped to order types. Omit to price as if every order type qualified (the menu card view).","schema":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]}},{"name":"branch_id","required":false,"in":"query","description":"Branch ID for effective price resolution","schema":{"format":"uuid","type":"string"}},{"name":"channel_id","required":false,"in":"query","description":"Channel ID for effective price resolution","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}}},"summary":"Get a product including variants, option groups, and branch availabilities","tags":["Products"]},"put":{"operationId":"ProductsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}}},"summary":"Full update of a product (replaces variants and option groups when provided)","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}},"delete":{"operationId":"ProductsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Product soft-deleted."}},"summary":"Soft delete a product (isActive=false, status=INACTIVE)","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/price-adjustments/preview":{"post":{"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)\n\nReturns every price the adjustment would change, with its before and after, plus a `confirm_token`. Writes nothing. The token must be passed to the apply endpoint, so an adjustment cannot be applied without first being previewed — there is no undo.","operationId":"ProductsController_previewPriceAdjustment","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceAdjustmentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceAdjustmentPreviewDto"}}}}},"summary":"Preview a bulk price adjustment","tags":["Products"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/price-adjustments":{"post":{"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)\n\nApplies a previewed adjustment in a single transaction. Rejects if prices have moved since the preview, so the figures the user approved are the figures that land.","operationId":"ProductsController_applyPriceAdjustment","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyPriceAdjustmentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceAdjustmentPreviewDto"}}}}},"summary":"Apply a bulk price adjustment","tags":["Products"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/bulk-update-prices":{"post":{"operationId":"ProductsController_bulkUpdatePrices","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPriceUpdateDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPriceUpdateResponseDto"}}}}},"summary":"Bulk update basePrice for multiple products in a single transaction","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/bulk-delete":{"post":{"operationId":"ProductsController_bulkRemove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteProductsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteProductsResponseDto"}}}}},"summary":"Soft delete multiple products in a single transaction","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/{productId}/variants":{"post":{"operationId":"ProductsController_addVariant","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductVariantDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantResponseDto"}}}}},"summary":"Add a variant to a product","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/{productId}/variants/{variantId}":{"put":{"operationId":"ProductsController_updateVariant","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"variantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductVariantDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantResponseDto"}}}}},"summary":"Update a variant","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}},"delete":{"operationId":"ProductsController_deleteVariant","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"variantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Variant deleted."}},"summary":"Delete a variant from a product","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/{productId}/option-groups":{"post":{"operationId":"ProductsController_linkOptionGroups","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkOptionGroupsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}}},"summary":"Link option groups to a product (skips already-linked)","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/{productId}/option-groups/reorder":{"patch":{"operationId":"ProductsController_reorderOptionGroups","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderProductOptionGroupsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}}},"summary":"Reorder the option groups attached to a product","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/{productId}/option-groups/{optionGroupId}":{"delete":{"operationId":"ProductsController_unlinkOptionGroup","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"optionGroupId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Option group unlinked from product."}},"summary":"Unlink an option group from a product","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/products/{productId}/branch-availability":{"put":{"operationId":"ProductsController_upsertBranchAvailability","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertBranchAvailabilityDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}}},"summary":"Upsert branch availability override for a product","tags":["Products"],"description":"**Access:** ![Permission: manage:products:branch](https://img.shields.io/badge/Permission-manage%3Aproducts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:branch"]}}},"/restaurants/{restaurantId}/products/{productId}/branch-availability/{branchId}":{"delete":{"operationId":"ProductsController_removeBranchAvailability","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Branch availability override removed."}},"summary":"Remove branch availability override for a product","tags":["Products"],"description":"**Access:** ![Permission: manage:products:branch](https://img.shields.io/badge/Permission-manage%3Aproducts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:branch"]}}},"/restaurants/{restaurantId}/products/{productId}/variants/{variantId}/branch-availability":{"put":{"operationId":"ProductsController_upsertVariantBranchAvailability","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"variantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertBranchAvailabilityDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}}},"summary":"Upsert branch availability override for a variant","tags":["Products"],"description":"**Access:** ![Permission: manage:products:branch](https://img.shields.io/badge/Permission-manage%3Aproducts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:branch"]}}},"/restaurants/{restaurantId}/products/{productId}/variants/{variantId}/branch-availability/{branchId}":{"delete":{"operationId":"ProductsController_removeVariantBranchAvailability","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"variantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Variant branch availability override removed."}},"summary":"Remove branch availability override for a variant","tags":["Products"],"description":"**Access:** ![Permission: manage:products:branch](https://img.shields.io/badge/Permission-manage%3Aproducts%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:branch"]}}},"/restaurants/{restaurantId}/products/import":{"post":{"operationId":"ProductsController_importXlsx","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImportResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImportResponseDto"}}}}},"summary":"Import products from xlsx. Validates all rows first, then bulk inserts.","tags":["Products"],"description":"**Access:** ![Permission: manage:products:restaurant](https://img.shields.io/badge/Permission-manage%3Aproducts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:products:restaurant"]}}},"/restaurants/{restaurantId}/option-groups":{"get":{"operationId":"OptionGroupsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"selection_type","required":false,"in":"query","schema":{"type":"string","enum":["SINGLE","MULTI"]}},{"name":"expand","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["recipe_effects"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionGroupResponseDto"}}}}},"summary":"List option groups for a restaurant","tags":["Option Groups"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":["read:option_groups:restaurant"]}},"post":{"operationId":"OptionGroupsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOptionGroupDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionGroupResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Create an option group","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}}},"/restaurants/{restaurantId}/option-groups/{groupId}":{"get":{"operationId":"OptionGroupsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["recipe_effects"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionGroupResponseDto"}}}}},"summary":"Get a single option group with its values","tags":["Option Groups"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":["read:option_groups:restaurant"]}},"put":{"operationId":"OptionGroupsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOptionGroupDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionGroupResponseDto"}}}}},"summary":"Full update of an option group (replaces values if provided)","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}},"delete":{"operationId":"OptionGroupsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Soft-delete an option group (sets isActive=false)","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}}},"/restaurants/{restaurantId}/option-groups/{groupId}/snooze":{"patch":{"operationId":"OptionGroupsController_toggleSnooze","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionGroupResponseDto"}}}}},"summary":"Toggle isSnoozed on an option group","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}}},"/restaurants/{restaurantId}/option-groups/{groupId}/sort":{"patch":{"operationId":"OptionGroupsController_updateSortOrder","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSortOrderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionGroupResponseDto"}}}}},"summary":"Update the sort order of an option group","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}}},"/restaurants/{restaurantId}/option-groups/{groupId}/values":{"post":{"operationId":"OptionValuesController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOptionValueDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionValueResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Add a value to an option group","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}}},"/restaurants/{restaurantId}/option-groups/{groupId}/values/reorder":{"patch":{"operationId":"OptionValuesController_reorder","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderOptionValuesDto"}}}},"responses":{"204":{"description":"Reordered successfully."}},"summary":"Batch-update sortOrder for values within an option group","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}}},"/restaurants/{restaurantId}/option-groups/{groupId}/values/{valueId}":{"put":{"operationId":"OptionValuesController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}},{"name":"valueId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOptionValueDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionValueResponseDto"}}}}},"summary":"Update a value in an option group","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}},"delete":{"operationId":"OptionValuesController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"groupId","required":true,"in":"path","schema":{"type":"string"}},{"name":"valueId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Delete a value from an option group","tags":["Option Groups"],"description":"**Access:** ![Permission: manage:option_groups:restaurant](https://img.shields.io/badge/Permission-manage%3Aoption__groups%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:option_groups:restaurant"]}}},"/restaurants/{restaurantId}/categories":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nWhen the `x-branch-id` header is sent, only categories available at that branch are returned (subcategories follow their root). Pass `all_branches=true` to skip the scoping.","operationId":"CategoriesController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"show_in_menu","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"root_only","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"parent_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"all_branches","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"x-branch-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryListResponseDto"}}}}},"summary":"List categories (supports rootOnly filter for tree root)","tags":["Categories"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}},"post":{"operationId":"CategoriesController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponseDto"}}}}},"summary":"Create a category (set parentId for subcategory)","tags":["Categories"],"description":"**Access:** ![Permission: manage:categories:restaurant](https://img.shields.io/badge/Permission-manage%3Acategories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:categories:restaurant"]}}},"/restaurants/{restaurantId}/categories/reorder":{"patch":{"operationId":"CategoriesController_reorder","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderCategoriesDto"}}}},"responses":{"204":{"description":"Reordered successfully."}},"summary":"Batch-update sortOrder (and optionally parentId) for categories","tags":["Categories"],"description":"**Access:** ![Permission: manage:categories:restaurant](https://img.shields.io/badge/Permission-manage%3Acategories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:categories:restaurant"]}}},"/restaurants/{restaurantId}/categories/{categoryId}":{"get":{"operationId":"CategoriesController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponseDto"}}}}},"summary":"Get a category with its children","tags":["Categories"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}},"put":{"operationId":"CategoriesController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponseDto"}}}}},"summary":"Update a category","tags":["Categories"],"description":"**Access:** ![Permission: manage:categories:restaurant](https://img.shields.io/badge/Permission-manage%3Acategories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:categories:restaurant"]}},"delete":{"operationId":"CategoriesController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Category deleted."}},"summary":"Delete a category (children become root-level)","tags":["Categories"],"description":"**Access:** ![Permission: manage:categories:restaurant](https://img.shields.io/badge/Permission-manage%3Acategories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:categories:restaurant"]}}},"/restaurants/{restaurantId}/categories/{categoryId}/branch-availability":{"put":{"description":"**Access:** ![Permission: manage:categories:restaurant](https://img.shields.io/badge/Permission-manage%3Acategories%3Arestaurant-green)\n\nWhen availableAllBranches=false the category is only shown on branches added here.","operationId":"CategoriesController_addBranch","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCategoryBranchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponseDto"}}}}},"summary":"Add a branch to the category listing (root categories only)","tags":["Categories"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:categories:restaurant"]}}},"/restaurants/{restaurantId}/categories/{categoryId}/branch-availability/{branchId}":{"delete":{"operationId":"CategoriesController_removeBranch","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Branch removed from category listing."}},"summary":"Remove a branch from the category listing","tags":["Categories"],"description":"**Access:** ![Permission: manage:categories:restaurant](https://img.shields.io/badge/Permission-manage%3Acategories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:categories:restaurant"]}}},"/restaurants/{restaurantId}/discounts":{"get":{"operationId":"DiscountsController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"applies_to","required":false,"in":"query","schema":{"type":"string","enum":["ORDERS","PRODUCTS","BOTH"]}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"branch_id","required":false,"in":"query","description":"Filter discounts available to a specific branch","schema":{"format":"uuid","type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated list of discounts"}},"security":[{"Bearer":[]}],"summary":"List discounts with filters and pagination","tags":["Discounts"],"description":"**Access:** ![Permission: read:discounts:restaurant](https://img.shields.io/badge/Permission-read%3Adiscounts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:discounts:restaurant"]}},"post":{"operationId":"DiscountsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDiscountDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountResponseDto"}}}},"201":{"description":"Discount created"}},"security":[{"Bearer":[]}],"summary":"Create a discount","tags":["Discounts"],"description":"**Access:** ![Permission: manage:discounts:restaurant](https://img.shields.io/badge/Permission-manage%3Adiscounts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:discounts:restaurant"]}}},"/restaurants/{restaurantId}/discounts/validate":{"get":{"operationId":"DiscountsController_validateCode","parameters":[{"name":"code","required":true,"in":"query","description":"Discount reference code","schema":{"example":"SUMMER2026","type":"string"}},{"name":"branch_id","required":false,"in":"query","description":"Branch ID to validate scope against","schema":{"format":"uuid","type":"string"}},{"name":"branch_id","required":false,"in":"query","description":"Branch ID to validate scope","schema":{}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Discount is valid and applicable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Validate a discount code and return the resolved discount","tags":["Discounts"],"description":"**Access:** ![Permission: read:discounts:restaurant](https://img.shields.io/badge/Permission-read%3Adiscounts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:discounts:restaurant"]}}},"/restaurants/{restaurantId}/discounts/{id}":{"get":{"operationId":"DiscountsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Discount detail"}},"security":[{"Bearer":[]}],"summary":"Get a single discount","tags":["Discounts"],"description":"**Access:** ![Permission: read:discounts:restaurant](https://img.shields.io/badge/Permission-read%3Adiscounts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:discounts:restaurant"]}},"patch":{"operationId":"DiscountsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDiscountDto"}}}},"responses":{"200":{"description":"Discount updated"}},"security":[{"Bearer":[]}],"summary":"Update a discount","tags":["Discounts"],"description":"**Access:** ![Permission: manage:discounts:restaurant](https://img.shields.io/badge/Permission-manage%3Adiscounts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:discounts:restaurant"]}},"delete":{"operationId":"DiscountsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete a discount","tags":["Discounts"],"description":"**Access:** ![Permission: manage:discounts:restaurant](https://img.shields.io/badge/Permission-manage%3Adiscounts%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:discounts:restaurant"]}}},"/restaurants":{"get":{"operationId":"RestaurantsController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"tag_ids","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"tag_match","required":false,"in":"query","schema":{"type":"string","enum":["any","all"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantResponseDto"}}}}},"summary":"List all restaurants (platform)","tags":["Restaurants"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:restaurants:platform](https://img.shields.io/badge/Permission-read%3Arestaurants%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:restaurants:platform"]}},"post":{"operationId":"RestaurantsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestaurantDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Create a restaurant (platform)","tags":["Restaurants"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:restaurants:platform](https://img.shields.io/badge/Permission-manage%3Arestaurants%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:restaurants:platform"]}}},"/restaurants/{restaurantId}":{"get":{"operationId":"RestaurantsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantResponseDto"}}}}},"summary":"Get a restaurant by ID","tags":["Restaurants"],"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)","x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}},"put":{"operationId":"RestaurantsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestaurantDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantResponseDto"}}}}},"summary":"Update a restaurant (platform)","tags":["Restaurants"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:restaurants:platform](https://img.shields.io/badge/Permission-manage%3Arestaurants%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:restaurants:platform"]}},"delete":{"operationId":"RestaurantsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Delete a restaurant (platform)","tags":["Restaurants"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:restaurants:platform](https://img.shields.io/badge/Permission-manage%3Arestaurants%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:restaurants:platform"]}}},"/super-admin/tags":{"get":{"operationId":"TagsController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TagResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"List tags (paginated, searchable by name/slug)","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:tags:platform"]}},"post":{"operationId":"TagsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"Create a tag","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:tags:platform](https://img.shields.io/badge/Permission-manage%3Atags%3Aplatform-green) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:tags:platform","read:tags:platform"]}}},"/super-admin/tags/entities":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)\n\nCore lookup, e.g. \"all restaurants tagged VIP Clients\". Pass `entity_type`, one or more `tag_ids`, and `match=any|all`. Returns each matching entity with all its tags.","operationId":"TagsController_entitiesByTags","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"entity_type","required":true,"in":"query","schema":{"type":"string","enum":["RESTAURANT","CUSTOMER","BRANCH","STAFF"]}},{"name":"tag_ids","required":true,"in":"query","description":"Tag ids (comma-separated or repeated).","schema":{"minItems":1,"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"match","required":false,"in":"query","description":"`any` = has at least one tag; `all` = has every tag.","schema":{"default":"any","type":"string","enum":["any","all"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TaggedEntityResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"List entities carrying the given tags","tags":["Super Admin Tags"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:tags:platform"]}}},"/super-admin/tags/lookup":{"get":{"operationId":"TagsController_entityTags","parameters":[{"name":"entity_type","required":true,"in":"query","schema":{"type":"string","enum":["RESTAURANT","CUSTOMER","BRANCH","STAFF"]}},{"name":"entity_id","required":true,"in":"query","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TagSummaryResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"List every tag attached to one specific entity","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:tags:platform"]}}},"/super-admin/tags/{id}":{"get":{"operationId":"TagsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"Get a single tag","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:tags:platform"]}},"patch":{"operationId":"TagsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"Update a tag","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:tags:platform](https://img.shields.io/badge/Permission-manage%3Atags%3Aplatform-green) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:tags:platform","read:tags:platform"]}},"delete":{"operationId":"TagsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Tag deleted."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"Delete a tag and all its assignments","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:tags:platform](https://img.shields.io/badge/Permission-manage%3Atags%3Aplatform-green) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:tags:platform","read:tags:platform"]}}},"/super-admin/tags/{id}/assign":{"post":{"operationId":"TagsController_assign","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignTagDto"}}}},"responses":{"200":{"description":"Number of new assignments created."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"Attach a tag to a set of entities (idempotent)","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:tags:platform](https://img.shields.io/badge/Permission-manage%3Atags%3Aplatform-green) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:tags:platform","read:tags:platform"]}}},"/super-admin/tags/{id}/unassign":{"post":{"operationId":"TagsController_unassign","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignTagDto"}}}},"responses":{"200":{"description":"Number of assignments removed."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"Detach a tag from a set of entities","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:tags:platform](https://img.shields.io/badge/Permission-manage%3Atags%3Aplatform-green) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:tags:platform","read:tags:platform"]}}},"/super-admin/tags/{id}/entities":{"get":{"operationId":"TagsController_tagEntities","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"entity_type","required":false,"in":"query","description":"Filter to one entity kind.","schema":{"type":"string","enum":["RESTAURANT","CUSTOMER","BRANCH","STAFF"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TaggedEntityResponseDto"}}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:tags:platform` permission."}},"security":[{"Bearer":[]}],"summary":"List the entities a single tag is attached to","tags":["Super Admin Tags"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:tags:platform](https://img.shields.io/badge/Permission-read%3Atags%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:tags:platform"]}}},"/super-admin/restaurants/{restaurantId}/reset/preview":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nReports the rows a reset would delete, keyed by table, without deleting anything. Also returns the account number the caller must echo to confirm.","operationId":"RestaurantResetController_preview","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantResetPreviewResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Preview a restaurant reset","tags":["Super Admin - Restaurant Reset"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/restaurants/{restaurantId}/reset":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nIrreversibly deletes the restaurant's transactional data — orders, shifts, stock movements, loyalty points and passes, gift cards, carts, expenses, bookings, billing entries and customers — while preserving all configuration: catalog, stock items, recipes, suppliers, branches, staff, tables, printers, e-menu and subscription. Requires the restaurant's `account_number` as confirmation.","operationId":"RestaurantResetController_reset","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetRestaurantDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantResetSummaryResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Reset a restaurant to zero balances","tags":["Super Admin - Restaurant Reset"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/restaurants/{restaurantId}/delete":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nIrreversibly deletes the restaurant with its orders, customers, catalog, inventory, branches, subscriptions and settings, and its staff accounts that belong to no other restaurant. For stores made to test or demo. Requires the restaurant's `account_number` as confirmation; refused (409) when ZATCA production has accepted any of its invoices.","operationId":"RestaurantResetController_delete","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRestaurantDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantDeletionSummaryResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Delete a restaurant and everything it owns","tags":["Super Admin - Restaurant Reset"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/restaurants/{restaurantId}/migrated-order-vat":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nCounts orders that record no VAT, month by month next to orders that do, so a window can be chosen. Also returns the currency; the tool applies to SAR only.","operationId":"MigratedOrderVatController_summary","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigratedOrderVatSummaryResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Summarize orders with no recorded VAT","tags":["Super Admin - Migrated Order VAT"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}},"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nSets `tax_amount` to the 15% VAT contained in each order net and `tax_rate` to 0.15, for orders in the window that record no VAT and carry no ZATCA invoice. Totals do not change. SAR restaurants only. Requires the restaurant's `account_number`.","operationId":"MigratedOrderVatController_apply","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyMigratedOrderVatDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigratedOrderVatResultResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Record the VAT inside orders in a window","tags":["Super Admin - Migrated Order VAT"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/restaurants/{restaurantId}/migrated-order-vat/preview":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple)\n\nReports what an apply over the window would change, without changing anything.","operationId":"MigratedOrderVatController_preview","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","description":"First day, inclusive (Asia/Riyadh).","schema":{"example":"2026-01-01","type":"string"}},{"name":"to","required":true,"in":"query","description":"Last day, inclusive (Asia/Riyadh).","schema":{"example":"2026-09-02","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigratedOrderVatPreviewResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Preview a VAT backfill over a window","tags":["Super Admin - Migrated Order VAT"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/branches":{"get":{"description":"**Access:** ![Permission: read:branches:restaurant](https://img.shields.io/badge/Permission-read%3Abranches%3Arestaurant-green)\n\nPaginated list of branches in the active restaurant. Supports `search` over name / nameAr / city and `isActive` filter. Requires `read:branches:restaurant` (RESTAURANT_ADMIN bypasses; BRANCH_MANAGER has it seeded).","operationId":"BranchesController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchListResponseDto"}}}}},"summary":"List branches","tags":["Branches"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:branches:restaurant"]}},"post":{"description":"**Access:** ![Permission: manage:branches:restaurant](https://img.shields.io/badge/Permission-manage%3Abranches%3Arestaurant-green)\n\nCreates a new branch under the active restaurant. Requires `manage:branches:restaurant`.","operationId":"BranchesController_create","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBranchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDto"}}}}},"summary":"Create a branch","tags":["Branches"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:branches:restaurant"]}}},"/branches/{branchId}":{"get":{"description":"**Access:** ![Permission: read:branches:restaurant](https://img.shields.io/badge/Permission-read%3Abranches%3Arestaurant-green)\n\nReturns a single branch in the active restaurant. Returns 404 if the branch belongs to another tenant. Requires `read:branches:restaurant`.","operationId":"BranchesController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDto"}}}}},"summary":"Get a branch by id","tags":["Branches"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:branches:restaurant"]}},"put":{"description":"**Access:** ![Permission: manage:branches:restaurant](https://img.shields.io/badge/Permission-manage%3Abranches%3Arestaurant-green)\n\nPartial update of branch fields. Only provided fields are written; omit to leave unchanged. Requires `manage:branches:restaurant`.","operationId":"BranchesController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBranchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDto"}}}}},"summary":"Update a branch","tags":["Branches"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:branches:restaurant"]}},"delete":{"description":"**Access:** ![Permission: manage:branches:restaurant](https://img.shields.io/badge/Permission-manage%3Abranches%3Arestaurant-green)\n\nRemoves the branch. Cascades on `BranchAssignment` rows; orders and other dependents are preserved by FK constraints — delete will fail with 409 if blocking rows exist. Requires `manage:branches:restaurant`.","operationId":"BranchesController_remove","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Branch removed."}},"summary":"Delete a branch","tags":["Branches"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:branches:restaurant"]}}},"/restaurants/{restaurantId}/branches":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nReturns active branches for the e-menu picker. Anyone can call — typically used by the QR-code flow before the customer authenticates.","operationId":"BranchesPublicController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchListResponseDto"}}}}},"summary":"List branches for a restaurant (public)","tags":["Branches (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/branches/{branchId}":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nUsed by the e-menu landing page and QR redirect targets.","operationId":"BranchesPublicController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDto"}}}}},"summary":"Get a branch by id (public)","tags":["Branches (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/branches/{branchId}/order-fields":{"post":{"operationId":"BranchOrderFieldsController_create","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBranchOrderFieldDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchOrderFieldResponseDto"}}}}},"summary":"Create a custom order field for a branch","tags":["Branch Order Fields"],"description":"**Access:** ![Permission: manage:branch_order_fields:restaurant](https://img.shields.io/badge/Permission-manage%3Abranch__order__fields%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:branch_order_fields:restaurant"]}},"get":{"operationId":"BranchOrderFieldsController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchOrderFieldResponseDto"}}}}}},"summary":"List active custom order fields for a branch","tags":["Branch Order Fields"],"description":"**Access:** ![Permission: read:branch_order_fields:restaurant](https://img.shields.io/badge/Permission-read%3Abranch__order__fields%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:branch_order_fields:restaurant"]}}},"/branches/{branchId}/order-fields/{fieldId}":{"get":{"operationId":"BranchOrderFieldsController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"fieldId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchOrderFieldResponseDto"}}}}},"summary":"Get a single custom order field","tags":["Branch Order Fields"],"description":"**Access:** ![Permission: read:branch_order_fields:restaurant](https://img.shields.io/badge/Permission-read%3Abranch__order__fields%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:branch_order_fields:restaurant"]}},"patch":{"operationId":"BranchOrderFieldsController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"fieldId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBranchOrderFieldDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchOrderFieldResponseDto"}}}}},"summary":"Update a custom order field","tags":["Branch Order Fields"],"description":"**Access:** ![Permission: manage:branch_order_fields:restaurant](https://img.shields.io/badge/Permission-manage%3Abranch__order__fields%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:branch_order_fields:restaurant"]}},"delete":{"operationId":"BranchOrderFieldsController_deactivate","parameters":[{"name":"x-restaurant-id","in":"header","description":"Restaurant context. Ignored for STAFF (JWT is authoritative); honored for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"fieldId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Deactivate (soft-delete) a custom order field","tags":["Branch Order Fields"],"description":"**Access:** ![Permission: manage:branch_order_fields:restaurant](https://img.shields.io/badge/Permission-manage%3Abranch__order__fields%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:branch_order_fields:restaurant"]}}},"/billing/plans":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nPublic, active plans with a price in `country` (default SA) that offers at least one period, priced in that country’s currency. A plan without a price there is not listed.","operationId":"BillingPublicController_listPlans","parameters":[{"name":"country","required":false,"in":"query","description":"Only plans with a price in this country are returned, priced in its currency. An unknown or disabled country returns an empty list.","schema":{"pattern":"^[A-Z]{2}$","default":"SA","example":"EG","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicPlanResponseDto"}}}}}},"summary":"Public plan catalogue for one country (landing page and dashboard plan picker)","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/quote":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nWhat the landing page and /subscribe show before sign-up. Changes nothing. `charge` (amount, currency, fx_rate, fx_source, fx_rate_at; same shape as `invoice.charge`) is present only when the card is charged in another currency than the price: show \"≈ 50.67 USD will be charged\". The rate is the one an invoice would snapshot now.","operationId":"BillingPublicController_quote","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicQuoteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"summary":"Price a plan for a number of branches and a period","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/requests":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nRecords the visitor (name, phone, business name, plan, branches, period) before any payment, and returns the invoice pay-link token to pay by card or bank transfer. A repeat sign-up from the same phone within 24h reuses the request.","operationId":"BillingPublicController_createRequest","parameters":[{"name":"user-agent","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"summary":"Start a sign-up (subscription request)","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/pay/{token}":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\n`gateway` is the card gateway this invoice is paid through (its country's: MYFATOORAH or MOYASAR). `checkout_mode` is MyFatoorah's embedded/hosted setting and only applies when `gateway` is MYFATOORAH; Moyasar always uses its in-page form. `invoice.charge` appears when the card is charged in another currency (amount, currency, fx_rate, fx_source, fx_rate_at).","operationId":"BillingPublicController_getPayLink","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"summary":"Pay-link page data: the invoice, who it is for, and how to pay","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/pay/{token}/checkout":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe gateway follows the invoice’s country (SA → MyFatoorah, others → Moyasar). MyFatoorah: `{ mode: \"EMBEDDED\", session_id, script_url }` or `{ mode: \"HOSTED\", checkout_url }`, whichever the platform checkout mode says. Moyasar: `{ mode: \"MOYASAR\", moyasar: {…} }` — post the card from the browser straight to Moyasar. Then call `confirm` with `transaction_id`.","operationId":"BillingPublicController_startCheckout","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCheckoutDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutStartResponseDto"}}}}},"summary":"Start a card payment for an invoice","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/pay/{token}/confirm":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nRe-verifies with the gateway (the client is never trusted) and settles the invoice.","operationId":"BillingPublicController_confirm","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmCheckoutDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"summary":"Confirm a card attempt after the in-page form finishes","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/pay/{token}/bank-transfer":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nPuts the invoice in review. Staff approve (activates) or reject (reopens) it.","operationId":"BillingPublicController_submitTransfer","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Receipt: PDF or image, ≤ 10 MB."},"payer_name":{"type":"string"},"bank_name":{"type":"string"},"transfer_reference":{"type":"string"},"transferred_at":{"type":"string","format":"date"},"amount":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"summary":"Upload a bank-transfer receipt for an invoice","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/webhook":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nSignature-checked, then re-verified with the gateway. Always 200.","operationId":"BillingPublicController_webhook","parameters":[{"name":"myfatoorah-signature","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}},"summary":"Platform billing webhook (gateway → server)","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/webhook/moyasar":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nRegister this URL in the Moyasar dashboard (events: payment_paid, payment_failed, payment_voided, payment_refunded) with the shared secret from the platform settings. The secret is only a hint: the payment is always re-fetched from Moyasar before anything is settled. 200 for everything handled or permanently refused; 503 only for a transient failure, so Moyasar retries.","operationId":"BillingPublicController_moyasarWebhook","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}},"summary":"Moyasar webhook (gateway → server)","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/callback":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nRe-verifies, settles, then 302s to the pay link or the dashboard billing page.","operationId":"BillingPublicController_callback","parameters":[],"responses":{"200":{"description":""}},"summary":"Browser return after a hosted card payment","tags":["Billing (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/billing/me":{"get":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nSubscription and its branches, notices, open invoices, cards, branch coverage, how to pay.","operationId":"BillingSelfController_overview","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Billing overview","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/notices":{"get":{"operationId":"BillingSelfController_notices","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Billing warnings for the dashboard banner","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/invoices":{"get":{"operationId":"BillingSelfController_invoices","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Invoice history","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/quote":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nSUBSCRIBE, ADD_BRANCHES, CHANGE (plan / period) or RENEW. Changes nothing.","operationId":"BillingSelfController_quote","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Price a change before making it","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/subscribe":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nReturns the invoice to pay; the subscription starts when it is paid.","operationId":"BillingSelfController_subscribe","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Buy a subscription (none live)","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/branches":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nUnused paid slots are used first (free, applied now); the rest is invoiced (prorated to the period end when ALIGNED, a full period each when OWN_DATES).","operationId":"BillingSelfController_addBranches","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddBranchesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Add branches to the subscription","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/branches/{branchId}/assign":{"post":{"operationId":"BillingSelfController_assignSlot","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Put a branch on an unused paid slot (no charge)","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/branches/{branchId}":{"patch":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nA stopped branch runs to its paid date. Refused below the plan minimum.","operationId":"BillingSelfController_setBranchRenewing","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchRenewalDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Stop or resume renewing a branch","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/change":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nA dearer plan applies now against the prorated difference (returns the invoice). A cheaper plan or another period is scheduled for the next renewal (invoice null).","operationId":"BillingSelfController_change","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeSubscriptionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Change plan and/or period","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/pending-change":{"delete":{"operationId":"BillingSelfController_dropPendingChange","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Drop the change scheduled for the next renewal","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/renew":{"post":{"operationId":"BillingSelfController_renew","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"The next renewal invoice, to pay early or by hand","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/subscription":{"patch":{"operationId":"BillingSelfController_updateSubscription","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMySubscriptionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Turn automatic renewal (saved card) on or off","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/subscription/cancel":{"post":{"operationId":"BillingSelfController_cancel","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Cancel at the end of the paid period (undo with resume)","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/subscription/resume":{"post":{"operationId":"BillingSelfController_resume","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Undo a scheduled cancellation","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/invoices/{invoiceId}/checkout":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nBranch on `mode`: EMBEDDED / HOSTED (MyFatoorah, Saudi restaurants) or MOYASAR (everyone else: post the card to Moyasar with `moyasar`). Confirm with `POST /billing/me/checkout/confirm`.","operationId":"BillingSelfController_startCheckout","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"invoiceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCheckoutDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutStartResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Start a card payment for one of your invoices","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/invoices/{invoiceId}/pay-with-saved-card":{"post":{"operationId":"BillingSelfController_payWithSavedCard","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"invoiceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayWithSavedCardDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Charge a saved card for an invoice now","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/invoices/{invoiceId}/bank-transfer":{"post":{"operationId":"BillingSelfController_submitTransfer","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"invoiceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Receipt: PDF or image, ≤ 10 MB."},"payer_name":{"type":"string"},"bank_name":{"type":"string"},"transfer_reference":{"type":"string"},"transferred_at":{"type":"string","format":"date"},"amount":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Upload a bank-transfer receipt for one of your invoices","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/checkout/confirm":{"post":{"operationId":"BillingSelfController_confirm","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmCheckoutDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Confirm a card attempt (invoice payment or card verification)","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/cards":{"get":{"operationId":"BillingSelfController_listCards","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Saved cards (brand, last four, expiry)","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/cards/session":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nMyFatoorah: embedded card-verification session (unavailable while checkout is HOSTED). Moyasar: `mode: \"MOYASAR\"` with `moyasar.manual: true` — the browser authorises a small amount that the server voids after confirm. Limited to 3 per day and 5 per 30 days per restaurant (`429 BILLING_CARD_VERIFICATION_LIMIT`; see `GET /billing/me/cards/verification-usage`).","operationId":"BillingSelfController_cardSession","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardSessionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutStartResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Start adding a card (no charge)","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/cards/verification-usage":{"get":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nShow it next to \"Add card\"; disable the button while `next_allowed_at` is set.","operationId":"BillingSelfController_verificationUsage","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardVerificationUsageDto"}}}}},"security":[{"Bearer":[]}],"summary":"How many card updates are left","tags":["Billing (restaurant)"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/cards/{cardId}/default":{"patch":{"operationId":"BillingSelfController_setDefault","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"cardId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Use this card for automatic renewals","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/billing/me/cards/{cardId}":{"delete":{"operationId":"BillingSelfController_removeCard","parameters":[{"name":"x-restaurant-id","in":"header","required":false,"schema":{"type":"string"}},{"name":"cardId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Remove a saved card","tags":["Billing (restaurant)"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/super-admin/billing/attention":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nPaid sign-ups waiting for an account, receipts waiting for review, past-due subscriptions, captured payments to refund, subscribers on an inactive plan.","operationId":"BillingAdminController_attention","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"What needs a human now","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/requests":{"get":{"operationId":"BillingAdminController_listRequests","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["STARTED","AWAITING_TRANSFER_REVIEW","PAID","FULFILLED","CANCELLED"]}},{"name":"q","required":false,"in":"query","description":"Name, phone, restaurant or reference.","schema":{"maxLength":100,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Sign-up requests (paid first)","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/requests/{id}":{"get":{"operationId":"BillingAdminController_getRequest","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}},"patch":{"operationId":"BillingAdminController_updateRequest","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/requests/{id}/fulfill":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nStarts the package now on the chosen branches and moves the saved card over. The restaurant is moved to the country the sign-up was paid in (mirrored into `settings.general.country`) when it is billed elsewhere; 409 BILLING_REQUEST_COUNTRY_MISMATCH when it already has a subscription, saved cards on another gateway or open invoices there.","operationId":"BillingAdminController_fulfill","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Link a paid sign-up to the restaurant created for it","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/card-verifications":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nEvery add/replace-card attempt, including the ones refused by the limit (3 per restaurant per 24h, 5 per 30 days, Moyasar only). Filter with the optional `restaurant_id`. `release_error` is set while the verification charge could not be voided/refunded; the billing sweep retries it.","operationId":"BillingAdminController_listCardVerifications","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"restaurant_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Card verification attempts (newest first)","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/transfers":{"get":{"operationId":"BillingAdminController_listTransfers","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["PENDING","APPROVED","REJECTED"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Bank-transfer receipts (pending: oldest first)","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/transfers/{id}/file":{"get":{"operationId":"BillingAdminController_transferFile","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"Bearer":[]}],"summary":"Download the receipt file","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/transfers/{id}/approve":{"post":{"operationId":"BillingAdminController_approve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewNoteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Approve a receipt — settles and applies the invoice","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/transfers/{id}/reject":{"post":{"operationId":"BillingAdminController_reject","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectTransferDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Reject a receipt — reopens the invoice; the note is sent to the customer","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/renewals":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nOverdue renewals are always listed, unless `from`/`to` set a custom window. One row per subscription: what falls due next, how it will be paid (AUTO on a saved card, MANUAL, or FAILING after a declined charge), the unpaid renewal invoices or the next renewal as priced now, the automatic charge attempts and the staff follow-ups logged this cycle.","operationId":"BillingAdminController_listRenewals","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"days","required":false,"in":"query","description":"Renewals falling due within this many days. Overdue ones are always listed.","schema":{"minimum":1,"maximum":365,"default":30,"type":"number"}},{"name":"q","required":false,"in":"query","description":"Restaurant name, phone or account number.","schema":{"maxLength":100,"type":"string"}},{"name":"follow_up","required":false,"in":"query","description":"NOT_CONTACTED: no attempt this cycle. CONTACTED: at least one. CALL_BACK_DUE: the latest attempt asked for a call back that is due today or earlier. RENEWED: renewed and paid within the window (the other three leave these out).","schema":{"type":"string","enum":["NOT_CONTACTED","CONTACTED","CALL_BACK_DUE","RENEWED"]}},{"name":"payment","required":false,"in":"query","description":"AUTO: renews on a saved card. MANUAL: no card or auto-renew off. FAILING: the card was charged and declined this cycle.","schema":{"type":"string","enum":["AUTO","MANUAL","FAILING"]}},{"name":"from","required":false,"in":"query","description":"Custom window start, a Riyadh day (YYYY-MM-DD). With `from` or `to`, `days` is ignored and only renewals falling due between the two days (inclusive) are listed, overdue ones included only if they fall in it. A missing `from` is today; a missing `to` is `from`.","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}},{"name":"to","required":false,"in":"query","description":"Custom window end, a Riyadh day (YYYY-MM-DD), inclusive.","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Subscriptions renewing within `days` (default 30) or `from`–`to`, soonest first","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/renewals/summary":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nTakes the window (`days`, or `from`/`to`), `q` and `payment`; not the follow-up filter.","operationId":"BillingAdminController_renewalsSummary","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"days","required":false,"in":"query","description":"Renewals falling due within this many days. Overdue ones are always listed.","schema":{"minimum":1,"maximum":365,"default":30,"type":"number"}},{"name":"q","required":false,"in":"query","description":"Restaurant name, phone or account number.","schema":{"maxLength":100,"type":"string"}},{"name":"follow_up","required":false,"in":"query","description":"NOT_CONTACTED: no attempt this cycle. CONTACTED: at least one. CALL_BACK_DUE: the latest attempt asked for a call back that is due today or earlier. RENEWED: renewed and paid within the window (the other three leave these out).","schema":{"type":"string","enum":["NOT_CONTACTED","CONTACTED","CALL_BACK_DUE","RENEWED"]}},{"name":"payment","required":false,"in":"query","description":"AUTO: renews on a saved card. MANUAL: no card or auto-renew off. FAILING: the card was charged and declined this cycle.","schema":{"type":"string","enum":["AUTO","MANUAL","FAILING"]}},{"name":"from","required":false,"in":"query","description":"Custom window start, a Riyadh day (YYYY-MM-DD). With `from` or `to`, `days` is ignored and only renewals falling due between the two days (inclusive) are listed, overdue ones included only if they fall in it. A missing `from` is today; a missing `to` is `from`.","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}},{"name":"to","required":false,"in":"query","description":"Custom window end, a Riyadh day (YYYY-MM-DD), inclusive.","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Counts for the renewals window: total, overdue, not contacted, call-backs due…","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/renewals/{subscriptionId}/follow-ups":{"get":{"operationId":"BillingAdminController_renewalFollowUps","parameters":[{"name":"subscriptionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"A subscription's renewal follow-ups, newest first (every cycle)","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}},"post":{"operationId":"BillingAdminController_logRenewalFollowUp","parameters":[{"name":"subscriptionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRenewalFollowUpDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Log a renewal follow-up (a call, a message…) against the current cycle","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/invoices":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nFilter by status, restaurant, purpose (NEW_SUBSCRIPTION = a new customer, RENEWAL, ADD_BRANCHES, UPGRADE), payment channel, issue day range (Riyadh days) and a search over the number, restaurant name and sign-up reference.","operationId":"BillingAdminController_listInvoices","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["OPEN","AWAITING_REVIEW","PAID","VOID"]}},{"name":"restaurant_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"purpose","required":false,"in":"query","description":"What the invoice pays for: a new customer, a renewal, added branches, an upgrade.","schema":{"type":"string","enum":["NEW_SUBSCRIPTION","RENEWAL","ADD_BRANCHES","UPGRADE","APP_PURCHASE"]}},{"name":"paid_via","required":false,"in":"query","description":"How a paid invoice was paid.","schema":{"type":"string","enum":["CARD","SAVED_CARD","BANK_TRANSFER","MANUAL"]}},{"name":"from","required":false,"in":"query","description":"Issued on or after this Riyadh day (YYYY-MM-DD).","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}},{"name":"to","required":false,"in":"query","description":"Issued on or before this Riyadh day (YYYY-MM-DD).","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}},{"name":"q","required":false,"in":"query","description":"Invoice number, restaurant name or sign-up reference.","schema":{"maxLength":100,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Invoices, newest first","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/invoices/{id}/void":{"post":{"operationId":"BillingAdminController_voidInvoice","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidInvoiceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/invoices/{id}/mark-paid":{"post":{"operationId":"BillingAdminController_markPaid","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Record an off-platform payment (cash, cheque…) and apply the invoice","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/restaurants/{restaurantId}":{"get":{"operationId":"BillingAdminController_restaurantBilling","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"A restaurant's subscription, notices, invoices and saved cards","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/billing/restaurants/{restaurantId}/subscription":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nAny plan, public or not. Refused while the restaurant has a live subscription.","operationId":"BillingAdminController_activate","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateSubscriptionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Start a subscription without payment (sales deal, migration, goodwill)","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}},"patch":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nBranches due on the old date move with it; a lapsed subscription revives.","operationId":"BillingAdminController_updateSubscription","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateSubscriptionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Extend (move the period end) or switch automatic renewal","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/restaurants/{restaurantId}/subscription/cancel":{"post":{"operationId":"BillingAdminController_cancel","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCancelSubscriptionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Cancel now (access ends now) or at period end","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/settings":{"get":{"operationId":"BillingAdminController_getSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}},"put":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)\n\nGrace days apply to periods granted from now on. `checkout_mode` switches every online payment (subscriptions and e-menus) between the in-page form and the hosted page.","operationId":"BillingAdminController_putSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Update billing settings","tags":["Billing (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/billing/sweep":{"post":{"operationId":"BillingAdminController_sweep","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Run the renewal sweep now (normally every 10 minutes)","tags":["Billing (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/restaurants/{restaurantId}/country":{"put":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green)\n\nSets `restaurants.country` (and mirrors `settings.general.country`). Every saved card is disconnected because it belongs to the old gateway, and the live subscription loses its default card and switches to the new gateway: the next renewal is paid through a pay link until the restaurant saves a new card. The subscription, its dates and its current terms (price and currency) are kept; the new country’s price applies from the next term. 409 COUNTRY_UNCHANGED; 409 COUNTRY_CHANGE_OPEN_INVOICES while the restaurant has open invoices (settle or void them first; the message lists them); 409 BILLING_PLAN_NOT_PRICED when the plan and period the subscription renews on have no price in the new country; 404 COUNTRY_NOT_FOUND / restaurant.","operationId":"RestaurantCountryController_change","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeRestaurantCountryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantCountryChangeResponseDto"}}}},"409":{"description":"COUNTRY_UNCHANGED, COUNTRY_CHANGE_OPEN_INVOICES or BILLING_PLAN_NOT_PRICED"}},"security":[{"Bearer":[]}],"summary":"Change a restaurant's billing country (SUPER_ADMIN only)","tags":["Countries (super-admin)"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform"]}}},"/countries":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nSorted by `sort_order`. `path` is the landing path (\"/\" for SA, \"/eg\" for Egypt); use `seo_locale` for hreflang / og:locale and the contacts for the WhatsApp button. `fx_rate` (display → charge currency, current) is present only when the two differ.","operationId":"PublicCountriesController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicCountryResponseDto"}}}}}},"summary":"Enabled countries (landing page, sign-up country picker, Cloudflare Worker)","tags":["Countries"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/marketplace/apps":{"get":{"operationId":"MarketplaceController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppListingResponseDto"}}}}}},"summary":"Published apps, with the price and each branch’s access","tags":["Marketplace"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/marketplace/apps/{key}":{"get":{"operationId":"MarketplaceController_get","parameters":[{"name":"key","required":true,"in":"path","schema":{"example":"CUSTOMER_PAGER","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppListingResponseDto"}}}},"404":{"description":"APP_NOT_FOUND — unknown or unpublished app; or a branch is not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"One published app, with the price and each branch’s access","tags":["Marketplace"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/marketplace/apps/{key}/trial":{"post":{"operationId":"MarketplaceController_startTrial","parameters":[{"name":"key","required":true,"in":"path","schema":{"example":"CUSTOMER_PAGER","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAppTrialDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppInstallationResponseDto"}}}},"404":{"description":"APP_NOT_FOUND — unknown or unpublished app; or a branch is not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"409":{"description":"APP_TRIAL_UNAVAILABLE — trial used, app already active, or no trial","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Start an app's free trial on one branch (once per branch)","tags":["Marketplace"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/marketplace/apps/{key}/purchase":{"post":{"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)\n\nPriced on the server. Returns an OPEN invoice (the same one when asked again for the same branches and period); pay it with `POST /billing/me/invoices/:invoiceId/checkout` or `pay-with-saved-card`. Paying it gives each branch the period on top of what it has left.","operationId":"MarketplaceController_purchase","parameters":[{"name":"key","required":true,"in":"path","schema":{"example":"CUSTOMER_PAGER","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseAppDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppPurchaseResponseDto"}}}},"404":{"description":"APP_NOT_FOUND — unknown or unpublished app; or a branch is not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"409":{"description":"APP_NOT_FOR_SALE — no price for this period; APP_REQUIRES_PLAN — a branch has no active plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Issue the invoice for the app on some branches","tags":["Marketplace"],"x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/super-admin/marketplace/apps":{"get":{"operationId":"MarketplaceAdminController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}},"security":[{"Bearer":[]}],"summary":"Every listing (drafts too) with prices and active branch counts","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/marketplace/apps/{key}/overview":{"get":{"operationId":"MarketplaceAdminController_overview","parameters":[{"name":"key","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"One app at a glance: stores and branches by state (paid, trial, granted, lapsed), trials and conversions, revenue per currency, and usage for apps that record it","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/marketplace/apps/{key}/subscribers":{"get":{"operationId":"MarketplaceAdminController_subscribers","parameters":[{"name":"key","required":true,"in":"path","schema":{"type":"string"}},{"name":"state","required":false,"in":"query","description":"A store's state is its best branch's: PAID (paid at least once), GRANTED (has it without paying), TRIAL (on the free trial alone), LAPSED (ran out). ENDING_SOON: has it and a branch runs out within 14 days.","schema":{"type":"string","enum":["PAID","TRIAL","GRANTED","LAPSED","ENDING_SOON"]}},{"name":"q","required":false,"in":"query","description":"Store name or account number.","schema":{"maxLength":100,"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Stores that have or had the app, one row each with its branches, soonest end first","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/marketplace/restaurants/{restaurantId}/apps":{"get":{"operationId":"MarketplaceAdminController_restaurantApps","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}},"security":[{"Bearer":[]}],"summary":"Every app against every branch of a restaurant: each branch's end and trial","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:subscriptions:platform"]}}},"/super-admin/marketplace/apps/{key}":{"patch":{"operationId":"MarketplaceAdminController_update","parameters":[{"name":"key","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAppListingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Edit a listing; `status: PUBLISHED` lists it","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/marketplace/apps/{key}/prices/{country}":{"put":{"operationId":"MarketplaceAdminController_setPrice","parameters":[{"name":"key","required":true,"in":"path","schema":{"type":"string"}},{"name":"country","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAppPriceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"Bearer":[]}],"summary":"Set the per-branch price in one country (ISO alpha-2)","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/marketplace/apps/{key}/grant":{"post":{"operationId":"MarketplaceAdminController_grant","parameters":[{"name":"key","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantAppDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}},"security":[{"Bearer":[]}],"summary":"Comp: give branches the app for N more days, or until an exact date, without an invoice","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/super-admin/marketplace/apps/{key}/revoke":{"post":{"operationId":"MarketplaceAdminController_revoke","parameters":[{"name":"key","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAppDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}},"security":[{"Bearer":[]}],"summary":"End the app on branches now, paid time included","tags":["Marketplace (super-admin)"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:subscriptions:platform](https://img.shields.io/badge/Permission-manage%3Asubscriptions%3Aplatform-green) ![Permission: read:subscriptions:platform](https://img.shields.io/badge/Permission-read%3Asubscriptions%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:subscriptions:platform","read:subscriptions:platform"]}}},"/pager-monitor/snapshot":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nThe source of truth. Load it on every socket (re)connect, when the page becomes visible, and on a slow timer; `pagers:changed` events bring changes forward in between.","operationId":"PagerMonitorController_snapshot","parameters":[{"name":"x-display-token","in":"header","description":"The display token the pager monitor collected when it was paired.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagerMonitorSnapshotResponseDto"}}}},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED — re-pair the monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"CUSTOMER_DISPLAY_WRONG_KIND — paired as a customer display; APP_NOT_ACTIVE — the branch lacks the CUSTOMER_PAGER app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"The monitor's full state: branding and the branch's open pagers, oldest first","tags":["Pager Monitor (device)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/pager-monitor/pagers":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nIt gets the next number for the branch today; its QR shows on the customer display.","operationId":"PagerMonitorController_create","parameters":[{"name":"x-display-token","in":"header","description":"The display token the pager monitor collected when it was paired.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePagerDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagerMonitorItemResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagerMonitorItemResponseDto"}}}},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED — re-pair the monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"CUSTOMER_DISPLAY_WRONG_KIND — paired as a customer display; APP_NOT_ACTIVE — the branch lacks the CUSTOMER_PAGER app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Hand out a pager with no order","tags":["Pager Monitor (device)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/pager-monitor/pagers/{pagerId}/ready":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nAn order pager moves its order from ACCEPTED or PREPARING to READY; a standalone pager becomes ready. Either way every phone following it is alerted. Idempotent.","operationId":"PagerMonitorController_markReady","parameters":[{"name":"x-display-token","in":"header","description":"The display token the pager monitor collected when it was paired.","required":true,"schema":{"type":"string"}},{"name":"pagerId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagerMonitorItemResponseDto"}}}},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED — re-pair the monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"CUSTOMER_DISPLAY_WRONG_KIND — paired as a customer display; APP_NOT_ACTIVE — the branch lacks the CUSTOMER_PAGER app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Unknown or closed pager","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"422":{"description":"PAGER_ORDER_NOT_READYABLE — the order is already ready or past it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Mark a pager ready","tags":["Pager Monitor (device)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/pager-monitor/pagers/{pagerId}/call":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nAlerts every phone following the pager, whatever its status. Once per 30 s.","operationId":"PagerMonitorController_call","parameters":[{"name":"x-display-token","in":"header","description":"The display token the pager monitor collected when it was paired.","required":true,"schema":{"type":"string"}},{"name":"pagerId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagerMonitorItemResponseDto"}}}},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED — re-pair the monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"CUSTOMER_DISPLAY_WRONG_KIND — paired as a customer display; APP_NOT_ACTIVE — the branch lacks the CUSTOMER_PAGER app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Unknown or closed pager","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"PAGER_CALL_TOO_SOON — called less than 30 s ago","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Call the customer again","tags":["Pager Monitor (device)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/pager-monitor/pagers/{pagerId}/collected":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nTakes it off the monitor. Never completes the order. Idempotent.","operationId":"PagerMonitorController_collected","parameters":[{"name":"x-display-token","in":"header","description":"The display token the pager monitor collected when it was paired.","required":true,"schema":{"type":"string"}},{"name":"pagerId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Closed (or already closed)"},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED — re-pair the monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"CUSTOMER_DISPLAY_WRONG_KIND — paired as a customer display; APP_NOT_ACTIVE — the branch lacks the CUSTOMER_PAGER app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Unknown pager","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"The customer collected: close the pager","tags":["Pager Monitor (device)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/pager-monitor/pagers/{pagerId}/cancel":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nTakes it off the monitor. Never cancels the order. Idempotent.","operationId":"PagerMonitorController_cancel","parameters":[{"name":"x-display-token","in":"header","description":"The display token the pager monitor collected when it was paired.","required":true,"schema":{"type":"string"}},{"name":"pagerId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Closed (or already closed)"},"401":{"description":"CUSTOMER_DISPLAY_UNAUTHORIZED — re-pair the monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"403":{"description":"CUSTOMER_DISPLAY_WRONG_KIND — paired as a customer display; APP_NOT_ACTIVE — the branch lacks the CUSTOMER_PAGER app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"404":{"description":"Unknown pager","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Cancel the pager","tags":["Pager Monitor (device)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/payment-methods":{"get":{"operationId":"PaymentMethodsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethodResponseDto"}}}}}},"summary":"List all payment methods for a restaurant","tags":["Payment Methods"],"description":"**Access:** ![Permission: read:payment_methods:restaurant](https://img.shields.io/badge/Permission-read%3Apayment__methods%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:payment_methods:restaurant"]}},"post":{"operationId":"PaymentMethodsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentMethodDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodResponseDto"}}}}},"summary":"Create a payment method","tags":["Payment Methods"],"description":"**Access:** ![Permission: manage:payment_methods:restaurant](https://img.shields.io/badge/Permission-manage%3Apayment__methods%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:payment_methods:restaurant"]}}},"/restaurants/{restaurantId}/payment-methods/{id}":{"get":{"operationId":"PaymentMethodsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodResponseDto"}}}}},"summary":"Get a payment method by id","tags":["Payment Methods"],"description":"**Access:** ![Permission: read:payment_methods:restaurant](https://img.shields.io/badge/Permission-read%3Apayment__methods%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:payment_methods:restaurant"]}},"patch":{"operationId":"PaymentMethodsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentMethodDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodResponseDto"}}}}},"summary":"Update a payment method","tags":["Payment Methods"],"description":"**Access:** ![Permission: manage:payment_methods:restaurant](https://img.shields.io/badge/Permission-manage%3Apayment__methods%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:payment_methods:restaurant"]}},"delete":{"operationId":"PaymentMethodsController_softDelete","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Soft-delete a payment method","tags":["Payment Methods"],"description":"**Access:** ![Permission: manage:payment_methods:restaurant](https://img.shields.io/badge/Permission-manage%3Apayment__methods%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:payment_methods:restaurant"]}}},"/restaurants/{restaurantId}/gift-cards":{"post":{"operationId":"GiftCardsController_issue","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGiftCardDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardResponseDto"}}}}},"summary":"Issue a new gift card","tags":["Gift Cards"],"description":"**Access:** ![Permission: create:gift_cards:restaurant](https://img.shields.io/badge/Permission-create%3Agift__cards%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["create:gift_cards:restaurant"]}},"get":{"operationId":"GiftCardsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"q","required":false,"in":"query","description":"Search by customer name or phone number.","schema":{"maxLength":120,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["ACTIVE","USED","EXPIRED","CANCELLED"]}},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["BALANCE","ITEMS"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardResponseDto"}}}}}},"summary":"List all gift cards for a restaurant","tags":["Gift Cards"],"description":"**Access:** ![Permission: read:gift_cards:restaurant](https://img.shields.io/badge/Permission-read%3Agift__cards%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:gift_cards:restaurant"]}}},"/restaurants/{restaurantId}/gift-cards/{giftCardId}":{"get":{"operationId":"GiftCardsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giftCardId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardResponseDto"}}}}},"summary":"Get gift card details and transaction history","tags":["Gift Cards"],"description":"**Access:** ![Permission: read:gift_cards:restaurant](https://img.shields.io/badge/Permission-read%3Agift__cards%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:gift_cards:restaurant"]}}},"/restaurants/{restaurantId}/gift-cards/{giftCardId}/cancel":{"patch":{"operationId":"GiftCardsController_cancel","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giftCardId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardResponseDto"}}}}},"summary":"Cancel a gift card","tags":["Gift Cards"],"description":"**Access:** ![Permission: manage:gift_cards:restaurant](https://img.shields.io/badge/Permission-manage%3Agift__cards%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:gift_cards:restaurant"]}}},"/restaurants/{restaurantId}/gift-cards/{giftCardId}/expire":{"patch":{"operationId":"GiftCardsController_expire","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giftCardId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardResponseDto"}}}}},"summary":"Manually expire a gift card","tags":["Gift Cards"],"description":"**Access:** ![Permission: manage:gift_cards:restaurant](https://img.shields.io/badge/Permission-manage%3Agift__cards%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:gift_cards:restaurant"]}}},"/restaurants/{restaurantId}/gift-card-themes":{"get":{"operationId":"GiftCardThemesController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardThemeResponseDto"}}}}}},"summary":"List the restaurant’s active voucher themes","tags":["Gift Cards"],"description":"**Access:** ![Permission: read:gift_cards:restaurant](https://img.shields.io/badge/Permission-read%3Agift__cards%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:gift_cards:restaurant"]}},"post":{"operationId":"GiftCardThemesController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGiftCardThemeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardThemeResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardThemeResponseDto"}}}}},"summary":"Create a voucher theme","tags":["Gift Cards"],"description":"**Access:** ![Permission: manage:gift_cards:restaurant](https://img.shields.io/badge/Permission-manage%3Agift__cards%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:gift_cards:restaurant"]}}},"/restaurants/{restaurantId}/gift-card-themes/{themeId}":{"patch":{"description":"**Access:** ![Permission: manage:gift_cards:restaurant](https://img.shields.io/badge/Permission-manage%3Agift__cards%3Arestaurant-green)\n\nA colour change re-pushes every wallet pass issued with this theme.","operationId":"GiftCardThemesController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGiftCardThemeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardThemeResponseDto"}}}}},"summary":"Update a voucher theme","tags":["Gift Cards"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:gift_cards:restaurant"]}},"delete":{"description":"**Access:** ![Permission: manage:gift_cards:restaurant](https://img.shields.io/badge/Permission-manage%3Agift__cards%3Arestaurant-green)\n\nHidden from the picker; cards already issued with it keep its colours.","operationId":"GiftCardThemesController_archive","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"themeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardThemeResponseDto"}}}}},"summary":"Archive a voucher theme","tags":["Gift Cards"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:gift_cards:restaurant"]}}},"/public/gift-cards/{giftCardId}":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nCustomer-facing view for the gift-card share link. Case-insensitive code lookup. Returns balance/items, status, expiry, messages and restaurant branding — never the recipient phone or transaction history. Rate-limited to 30 requests/minute per IP.","operationId":"GiftCardsPublicController_findOne","parameters":[{"name":"giftCardId","required":true,"in":"path","schema":{"example":"Z6AH0J4","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicGiftCardResponseDto"}}}},"404":{"description":"Gift card not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"Too many requests from this IP; try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Get a gift card by its 7-character code (public)","tags":["Gift Cards (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/public/gift-cards/{giftCardId}/apple-wallet":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nSigned `.pkpass` (serial `GC-<code>`) for BALANCE and ITEMS cards. Balance cards show the remaining balance; items cards summarise the products on the front and list them on the back. Labels follow the device language (English or Arabic). Cancelled, expired and fully used cards download as voided passes. The QR payload is the plain code.","operationId":"GiftCardsPublicController_getAppleWalletPass","parameters":[{"name":"giftCardId","required":true,"in":"path","schema":{"example":"Z6AH0J4","type":"string"}}],"responses":{"200":{"description":"The .pkpass file","content":{"application/vnd.apple.pkpass":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Gift card not found","content":{"application/vnd.apple.pkpass":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"Too many requests from this IP; try again later","content":{"application/vnd.apple.pkpass":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Download the gift card as an Apple Wallet pass (public)","tags":["Gift Cards (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/public/gift-cards/{giftCardId}/google-wallet":{"get":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nBALANCE cards only — ITEMS cards answer 422 with error code `GIFT_CARD_GOOGLE_WALLET_UNSUPPORTED` so clients can hide the button.","operationId":"GiftCardsPublicController_getGoogleWalletLink","parameters":[{"name":"giftCardId","required":true,"in":"path","schema":{"example":"Z6AH0J4","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardGoogleWalletLinkDto"}}}},"404":{"description":"Gift card not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"422":{"description":"ITEMS gift cards have no Google Wallet pass (GIFT_CARD_GOOGLE_WALLET_UNSUPPORTED)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}},"429":{"description":"Too many requests from this IP; try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponseDto"}}}}},"summary":"Get the Google Wallet \"Save to Wallet\" link for a balance gift card (public)","tags":["Gift Cards (public)"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/super-admin":{"get":{"operationId":"SuperAdminController_index","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Super admin API index — describes all routes exposed by this module","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/admins":{"get":{"operationId":"SuperAdminController_listAdmins","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"List all super admins (SUPER_ADMIN only)","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}},"post":{"operationId":"SuperAdminController_createAdmin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSuperAdminDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Create a super admin (SUPER_ADMIN only)","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/admins/{id}":{"get":{"operationId":"SuperAdminController_findAdmin","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Get a super admin by ID (SUPER_ADMIN only)","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}},"put":{"operationId":"SuperAdminController_updateAdmin","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSuperAdminDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Update a super admin (SUPER_ADMIN only)","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}},"delete":{"operationId":"SuperAdminController_removeAdmin","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"summary":"Delete a super admin (SUPER_ADMIN only)","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/admins/{id}/password":{"patch":{"operationId":"SuperAdminController_changeAdminPassword","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeSuperAdminPasswordDto"}}}},"responses":{"204":{"description":""}},"summary":"Change a super admin password (SUPER_ADMIN only)","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":[]}}},"/super-admin/platform-settings":{"get":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_settings:platform](https://img.shields.io/badge/Permission-read%3Aplatform__settings%3Aplatform-green)\n\nReturns every stored key/value pair. Sensitive fields (e.g. `secretAccessKey`, `private_key`) are redacted with `[REDACTED]`.","operationId":"SuperAdminController_listPlatformSettings","parameters":[],"responses":{"200":{"description":"All platform settings. Each object shape is determined by its `key`.","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/StorageConfigSettingResponse"},{"$ref":"#/components/schemas/PaymentProvidersSettingResponse"},{"$ref":"#/components/schemas/FirebaseServiceAccountSettingResponse"},{"$ref":"#/components/schemas/GooglePlacesSettingResponse"}],"discriminator":{"propertyName":"key","mapping":{"storage.config":"#/components/schemas/StorageConfigSettingResponse","payment.providers":"#/components/schemas/PaymentProvidersSettingResponse","firebase.serviceAccount":"#/components/schemas/FirebaseServiceAccountSettingResponse","google.places":"#/components/schemas/GooglePlacesSettingResponse"}}}}}}},"401":{"description":"Not authenticated"},"403":{"description":"Requires SUPER_ADMIN role"}},"summary":"List all platform settings","tags":["Super Admin"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_settings:platform"]}}},"/super-admin/platform-settings/{key}":{"put":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_settings:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__settings%3Aplatform-green)\n\nUpserts a key/value entry. The `key` must be one of the known setting keys.\nThe `value` shape depends on the key — pick an example from the request body dropdown.\n\n| Key | Description |\n|-----|-------------|\n| `storage.config` | Media upload storage (S3 / R2) — see `StorageConfigDto` |\n| `payment.providers` | **Refused** (400 `PLATFORM_SETTING_USE_TYPED_ENDPOINT`): use `PATCH /super-admin/payment-providers/{provider}` |\n| `firebase.serviceAccount` | Firebase service account JSON |\n| `google.places` | Google Places API key for e-menu Google Reviews |","operationId":"SuperAdminController_upsertPlatformSetting","parameters":[{"name":"key","required":true,"in":"path","description":"Platform setting key","schema":{"enum":["firebase.serviceAccount","google.places","payment.providers","storage.config","billing.config","payment.checkout"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertPlatformSettingDto"},"examples":{"storage.config — Cloudflare R2":{"summary":"storage.config — Cloudflare R2","value":{"value":{"provider":"r2","endpoint":"https://<account-id>.r2.cloudflarestorage.com","accessKeyId":"your-r2-access-key-id","secretAccessKey":"your-r2-secret-access-key","bucket":"twlm-media","publicBaseUrl":"https://cdn.yourdomain.com"}}},"storage.config — AWS S3":{"summary":"storage.config — AWS S3","value":{"value":{"provider":"s3","region":"eu-north-1","accessKeyId":"AKIAIOSFODNN7EXAMPLE","secretAccessKey":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","bucket":"twlm-media","publicBaseUrl":"https://twlm-media.s3.eu-north-1.amazonaws.com"}}},"payment.providers":{"summary":"payment.providers","value":{"value":{"myfatoorah":{"enabled":true,"environment":"production","apiKey":"your-myfatoorah-api-key","supplierCode":"10"},"hyperpay":{"enabled":false,"environment":"sandbox","accessToken":"your-access-token","entityIdVisa":"entity-id-visa","entityIdMada":"entity-id-mada","entityIdApplePay":"entity-id-applepay","currency":"SAR"}}}},"firebase.serviceAccount":{"summary":"firebase.serviceAccount","value":{"value":{"type":"service_account","project_id":"my-firebase-project","private_key_id":"abc123","private_key":"-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----\n","client_email":"firebase-adminsdk@my-firebase-project.iam.gserviceaccount.com","client_id":"123456789012345678901","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk%40my-firebase-project.iam.gserviceaccount.com"}}},"google.places":{"summary":"google.places","value":{"value":{"apiKey":"your-google-places-api-key"}}}}}}},"responses":{"200":{"description":"Updated setting. Shape is determined by the `key` discriminator.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/StorageConfigSettingResponse"},{"$ref":"#/components/schemas/PaymentProvidersSettingResponse"},{"$ref":"#/components/schemas/FirebaseServiceAccountSettingResponse"},{"$ref":"#/components/schemas/GooglePlacesSettingResponse"}],"discriminator":{"propertyName":"key","mapping":{"storage.config":"#/components/schemas/StorageConfigSettingResponse","payment.providers":"#/components/schemas/PaymentProvidersSettingResponse","firebase.serviceAccount":"#/components/schemas/FirebaseServiceAccountSettingResponse","google.places":"#/components/schemas/GooglePlacesSettingResponse"}}},"examples":{"storage.config — configured":{"summary":"storage.config — configured (secretAccessKey redacted)","value":{"key":"storage.config","value":{"provider":"r2","endpoint":"https://<account-id>.r2.cloudflarestorage.com","region":null,"accessKeyId":"your-r2-access-key-id","secretAccessKey":"[REDACTED]","bucket":"twlm-media","publicBaseUrl":"https://cdn.yourdomain.com"},"updatedAt":"2026-06-03T10:00:00.000Z","updatedBy":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}},"storage.config — not configured":{"summary":"storage.config — not yet configured","value":{"key":"storage.config","value":{"provider":null,"endpoint":null,"region":null,"accessKeyId":null,"secretAccessKey":null,"bucket":null,"publicBaseUrl":null},"updatedAt":null,"updatedBy":null}},"payment.providers — configured":{"summary":"payment.providers — configured (secrets redacted)","value":{"key":"payment.providers","value":{"myfatoorah":{"enabled":true,"environment":"production","apiKey":"[REDACTED]","supplierCode":"10"},"hyperpay":null,"tamara":null,"paymob":null,"afs_pay":null,"neoleap":null},"updatedAt":"2026-06-03T10:00:00.000Z","updatedBy":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}},"payment.providers — not configured":{"summary":"payment.providers — not yet configured","value":{"key":"payment.providers","value":{"hyperpay":null,"tamara":null,"paymob":null,"myfatoorah":null,"afs_pay":null,"neoleap":null},"updatedAt":null,"updatedBy":null}},"firebase.serviceAccount — configured":{"summary":"firebase.serviceAccount — configured (private_key redacted)","value":{"key":"firebase.serviceAccount","value":{"type":"service_account","project_id":"my-firebase-project","private_key_id":"abc123","private_key":"[REDACTED]","client_email":"firebase-adminsdk@my-firebase-project.iam.gserviceaccount.com","client_id":"123456789012345678901","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/...","universe_domain":"googleapis.com"},"updatedAt":"2026-06-03T10:00:00.000Z","updatedBy":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}},"firebase.serviceAccount — not configured":{"summary":"firebase.serviceAccount — not yet configured","value":{"key":"firebase.serviceAccount","value":{"type":null,"project_id":null,"private_key_id":null,"private_key":null,"client_email":null,"client_id":null,"auth_uri":null,"token_uri":null,"auth_provider_x509_cert_url":null,"client_x509_cert_url":null,"universe_domain":null},"updatedAt":null,"updatedBy":null}},"google.places — configured":{"summary":"google.places — configured (apiKey redacted)","value":{"key":"google.places","value":{"apiKey":"[REDACTED]"},"updatedAt":"2026-06-03T10:00:00.000Z","updatedBy":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}},"google.places — not configured":{"summary":"google.places — not yet configured","value":{"key":"google.places","value":{"apiKey":null},"updatedAt":null,"updatedBy":null}}}}}},"401":{"description":"Not authenticated"},"403":{"description":"Requires SUPER_ADMIN role"}},"summary":"Create or update a platform setting","tags":["Super Admin"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_settings:platform"]}},"delete":{"operationId":"SuperAdminController_deletePlatformSetting","parameters":[{"name":"key","required":true,"in":"path","description":"Platform setting key","schema":{"enum":["firebase.serviceAccount","google.places","payment.providers","storage.config","billing.config","payment.checkout"],"type":"string"}}],"responses":{"204":{"description":"Setting deleted"},"401":{"description":"Not authenticated"},"403":{"description":"Requires SUPER_ADMIN role"},"404":{"description":"Setting key not found"}},"summary":"Delete a platform setting by key","tags":["Super Admin"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_settings:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__settings%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_settings:platform"]}}},"/super-admin/notifications/broadcast":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:staff_notifications:platform](https://img.shields.io/badge/Permission-manage%3Astaff__notifications%3Aplatform-green)\n\nSends a custom title/body — plus an optional `data` payload — to every token in `staff_fcm_tokens`, across all restaurants and branches.\n\nDelivery is fan-out over the stored tokens in batches of 500 (FCM's multicast limit), not an FCM topic, so the response carries real per-token counts. Tokens FCM reports as unregistered are counted as `stale_detected` but never deleted — broadcasting does not mutate `staff_fcm_tokens`.\n\nRequires `firebase.serviceAccount` to be configured under platform settings.","operationId":"SuperAdminController_broadcastStaffPush","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastStaffPush"}}}},"responses":{"200":{"description":"Broadcast dispatched. Counts reflect what FCM accepted, not device receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastStaffPushResult"}}}},"401":{"description":"Not authenticated"},"403":{"description":"Requires manage:staff_notifications:platform"}},"summary":"Broadcast a push notification to every staff device","tags":["Super Admin"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:staff_notifications:platform"]}}},"/super-admin/media/upload":{"post":{"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_media:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__media%3Aplatform-green)\n\nStores under platform/emenu-themes/… and returns a public CDN URL.","operationId":"SuperAdminMediaController_upload","parameters":[{"name":"folder","required":true,"in":"query","schema":{"enum":["emenu-themes"],"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponseDto"}}}},"400":{"description":"No file provided or unsupported type"}},"security":[{"Bearer":[]}],"summary":"Upload a platform image (theme gallery, etc.)","tags":["Super Admin — Media"],"x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_media:platform"]}}},"/super-admin/platform-admins/permission-catalog":{"get":{"operationId":"PlatformAdminsController_permissionCatalog","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCatalogResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."}},"security":[{"Bearer":[]}],"summary":"List the platform permissions assignable to a platform admin","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_admins:platform"]}}},"/super-admin/platform-admins":{"get":{"operationId":"PlatformAdminsController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAdminListResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."}},"security":[{"Bearer":[]}],"summary":"List platform admins (paginated, searchable)","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_admins:platform"]}},"post":{"operationId":"PlatformAdminsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlatformAdminDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAdminResponseDto"}}}},"201":{"description":"Platform admin created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAdminResponseDto"}}}},"400":{"description":"Unknown or non-platform permissions supplied."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."},"409":{"description":"Email or phone already in use."}},"security":[{"Bearer":[]}],"summary":"Create a platform admin with an initial permission set","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_admins:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__admins%3Aplatform-green) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_admins:platform","read:platform_admins:platform"]}}},"/super-admin/platform-admins/{id}":{"get":{"operationId":"PlatformAdminsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAdminResponseDto"}}}},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."},"404":{"description":"Platform admin not found."}},"security":[{"Bearer":[]}],"summary":"Get a platform admin by ID","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["read:platform_admins:platform"]}},"put":{"operationId":"PlatformAdminsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlatformAdminDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAdminResponseDto"}}}},"400":{"description":"Invalid payload."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."},"404":{"description":"Platform admin not found."},"409":{"description":"Email or phone already in use."}},"security":[{"Bearer":[]}],"summary":"Update a platform admin profile / activation","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_admins:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__admins%3Aplatform-green) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_admins:platform","read:platform_admins:platform"]}},"delete":{"operationId":"PlatformAdminsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Platform admin deleted."},"400":{"description":"You cannot delete your own account."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."},"404":{"description":"Platform admin not found."}},"security":[{"Bearer":[]}],"summary":"Delete a platform admin","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_admins:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__admins%3Aplatform-green) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_admins:platform","read:platform_admins:platform"]}}},"/super-admin/platform-admins/{id}/permissions":{"put":{"operationId":"PlatformAdminsController_replacePermissions","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplacePlatformAdminPermissionsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAdminResponseDto"}}}},"400":{"description":"Unknown or non-platform permissions supplied."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."},"404":{"description":"Platform admin not found."}},"security":[{"Bearer":[]}],"summary":"Replace a platform admin permission set (revokes existing tokens)","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_admins:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__admins%3Aplatform-green) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_admins:platform","read:platform_admins:platform"]}}},"/super-admin/platform-admins/{id}/password":{"patch":{"operationId":"PlatformAdminsController_changePassword","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePlatformAdminPasswordDto"}}}},"responses":{"204":{"description":"Password rotated; existing tokens revoked."},"401":{"description":"Missing or invalid JWT."},"403":{"description":"Requires SUPER_ADMIN or a platform admin with the matching `*:platform` permission."},"404":{"description":"Platform admin not found."}},"security":[{"Bearer":[]}],"summary":"Rotate a platform admin password (revokes tokens)","tags":["Super Admin — Platform Admins"],"description":"**Access:** ![Role: SUPER_ADMIN](https://img.shields.io/badge/Role-SUPER__ADMIN-purple) ![Role: PLATFORM_ADMIN](https://img.shields.io/badge/Role-PLATFORM__ADMIN-purple) ![Permission: manage:platform_admins:platform](https://img.shields.io/badge/Permission-manage%3Aplatform__admins%3Aplatform-green) ![Permission: read:platform_admins:platform](https://img.shields.io/badge/Permission-read%3Aplatform__admins%3Aplatform-green)","x-authorization":{"isPublic":false,"roles":["SUPER_ADMIN","PLATFORM_ADMIN"],"membership":null,"feature":null,"permissions":["manage:platform_admins:platform","read:platform_admins:platform"]}}},"/permissions/catalog":{"get":{"operationId":"PermissionsController_getCatalog","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant (defaults to JWT context)","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"List all grantable permissions (any authenticated user)","tags":["Permissions"]}},"/memberships/{userId}/permissions":{"get":{"operationId":"PermissionsController_getMembershipPermissions","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant (defaults to JWT context)","required":false,"schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Read a membership permission set (RESTAURANT_ADMIN)","tags":["Permissions"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}},"put":{"operationId":"PermissionsController_replaceMembershipPermissions","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant (defaults to JWT context)","required":false,"schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMembershipPermissionsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Replace a membership permission set (RESTAURANT_ADMIN)","tags":["Permissions"],"description":"**Access:** ![Membership: RESTAURANT_ADMIN](https://img.shields.io/badge/Membership-RESTAURANT__ADMIN-blueviolet)","x-authorization":{"isPublic":false,"roles":[],"membership":"RESTAURANT_ADMIN","feature":null,"permissions":[]}}},"/restaurants/{restaurantId}/ordering-channels":{"get":{"operationId":"OrderingChannelsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"List ordering channels for a restaurant","tags":["Ordering Channels"],"description":"**Access:** ![Permission: read:ordering_channels:restaurant](https://img.shields.io/badge/Permission-read%3Aordering__channels%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:ordering_channels:restaurant"]}},"post":{"operationId":"OrderingChannelsController_create","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChannelDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Create an ordering channel (e.g. Talabat, Jahez)","tags":["Ordering Channels"],"description":"**Access:** ![Permission: manage:ordering_channels:restaurant](https://img.shields.io/badge/Permission-manage%3Aordering__channels%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:ordering_channels:restaurant"]}}},"/restaurants/{restaurantId}/ordering-channels/{id}":{"get":{"operationId":"OrderingChannelsController_findOne","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Get a single channel","tags":["Ordering Channels"],"description":"**Access:** ![Permission: read:ordering_channels:restaurant](https://img.shields.io/badge/Permission-read%3Aordering__channels%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:ordering_channels:restaurant"]}},"patch":{"operationId":"OrderingChannelsController_update","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChannelDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Update a channel","tags":["Ordering Channels"],"description":"**Access:** ![Permission: manage:ordering_channels:restaurant](https://img.shields.io/badge/Permission-manage%3Aordering__channels%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:ordering_channels:restaurant"]}},"delete":{"operationId":"OrderingChannelsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Delete a channel (cascades all price overrides)","tags":["Ordering Channels"],"description":"**Access:** ![Permission: manage:ordering_channels:restaurant](https://img.shields.io/badge/Permission-manage%3Aordering__channels%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:ordering_channels:restaurant"]}}},"/restaurants/{restaurantId}/ordering-channels/{channelId}/branches":{"get":{"operationId":"ChannelBranchesController_list","parameters":[{"name":"channelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelBranchResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"List branches associated with this channel","tags":["Ordering Channels"],"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/ordering-channels/{channelId}/branches/{branchId}":{"post":{"operationId":"ChannelBranchesController_add","parameters":[{"name":"channelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelBranchResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"Bearer":[]}],"summary":"Associate a branch with this channel","tags":["Ordering Channels"],"description":"**Access:** ![Permission: manage:orders:restaurant](https://img.shields.io/badge/Permission-manage%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:orders:restaurant"]}},"delete":{"operationId":"ChannelBranchesController_remove","parameters":[{"name":"channelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Remove branch association from this channel","tags":["Ordering Channels"],"description":"**Access:** ![Permission: manage:orders:restaurant](https://img.shields.io/badge/Permission-manage%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:orders:restaurant"]}}},"/restaurants/{restaurantId}/channel-commissions":{"get":{"operationId":"ChannelCommissionsController_list","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCommissionResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"List all channel commissions for a restaurant","tags":["Channel Commissions"],"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}},"put":{"operationId":"ChannelCommissionsController_upsert","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertChannelCommissionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCommissionResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Create or update a channel commission","tags":["Channel Commissions"],"description":"**Access:** ![Permission: manage:orders:restaurant](https://img.shields.io/badge/Permission-manage%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:orders:restaurant"]}}},"/restaurants/{restaurantId}/channel-commissions/{channelId}":{"delete":{"operationId":"ChannelCommissionsController_remove","parameters":[{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"channelId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"Bearer":[]}],"summary":"Remove the commission for a channel","tags":["Channel Commissions"],"description":"**Access:** ![Permission: manage:orders:restaurant](https://img.shields.io/badge/Permission-manage%3Aorders%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:orders:restaurant"]}}},"/food-zone/webhook":{"post":{"description":"**Access:** ![Auth: Public](https://img.shields.io/badge/Auth-Public-blue)\n\nServer-to-server webhook from Food Zone. `ORDER_CREATE_WEBHOOK` creates the order at the mapped branch, or drops it with a reason; `ORDER_UPDATE_WEBHOOK` moves the order along or cancels it; other events are logged and acknowledged. Answers 5xx only when a new order could not be looked at, so Food Zone resends it.","operationId":"FoodZoneController_webhook","parameters":[],"requestBody":{"required":false,"description":"Foodizone event envelope. Any body is accepted and acknowledged; unknown shapes are only logged.","content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","example":"ORDER_CREATE_WEBHOOK","enum":["ORDER_CREATE_WEBHOOK","ORDER_UPDATE_WEBHOOK","BRANCH_UPDATE_WEBHOOK","MENU_UPDATE_WEBHOOK","MENU_AVAILABILITY_UPDATE_WEBHOOK"]},"data":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}},"summary":"Food Zone webhook (provider → server)","tags":["Food Zone"],"x-authorization":{"isPublic":true,"roles":[],"membership":null,"feature":null,"permissions":[]}}},"/restaurant-settings/integrations/food-zone/stores":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nThe brand's branches on Foodizone, read live with the stored token. Pick one per branch for `PUT …/food-zone/branches`.","operationId":"FoodZoneAccountController_listStores","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FoodZoneStoreDto"}}}}},"404":{"description":"Foodizone is not connected yet — PUT the API token first."},"422":{"description":"`FOOD_ZONE_TOKEN_REJECTED` — Foodizone refused the stored token."},"502":{"description":"`FOOD_ZONE_UNAVAILABLE` — Foodizone could not be reached."}},"summary":"List Foodizone branches","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}}},"/restaurant-settings/integrations/food-zone/providers":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nEvery delivery app Foodizone relays, with how many of the brand's branches have it connected. Pick one per ordering channel for `PUT …/food-zone/channels`.","operationId":"FoodZoneAccountController_listProviders","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FoodZoneProviderDto"}}}}},"404":{"description":"Foodizone is not connected yet — PUT the API token first."},"422":{"description":"`FOOD_ZONE_TOKEN_REJECTED` — Foodizone refused the stored token."},"502":{"description":"`FOOD_ZONE_UNAVAILABLE` — Foodizone could not be reached."}},"summary":"List delivery apps","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}}},"/restaurant-settings/integrations/food-zone/menu-syncs":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nEvery attempt to push the menu to the delivery apps, newest first. A retried sync appears once per attempt.","operationId":"FoodZoneMenuSyncsController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"status","required":false,"in":"query","schema":{"example":"FAILED","type":"array","items":{"type":"string","enum":["RUNNING","SUCCEEDED","FAILED"]}}},{"name":"trigger","required":false,"in":"query","schema":{"example":"MANUAL","type":"array","items":{"type":"string","enum":["CATALOG_CHANGED","MANUAL"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneMenuSyncListDto"}}}}},"summary":"List menu syncs","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}},"post":{"description":"**Access:** ![Permission: manage:settings:restaurant](https://img.shields.io/badge/Permission-manage%3Asettings%3Arestaurant-green)\n\nQueues a full menu push. While one is already waiting, the request is merged into it; the result appears in the list.","operationId":"FoodZoneMenuSyncsController_syncNow","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneMenuSyncQueuedDto"}}}},"404":{"description":"Foodizone is not connected yet — PUT the API token first."}},"summary":"Sync the menu now","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:settings:restaurant"]}}},"/restaurant-settings/integrations/food-zone/menu-syncs/{syncId}":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nOne attempt with everything it left out and why.","operationId":"FoodZoneMenuSyncsController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"syncId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneMenuSyncDetailDto"}}}},"404":{"description":""}},"summary":"Get a menu sync","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}}},"/restaurant-settings/integrations/food-zone/menu-syncs/{syncId}/payload":{"get":{"description":"**Access:** ![Permission: read:settings:restaurant](https://img.shields.io/badge/Permission-read%3Asettings%3Arestaurant-green)\n\nThe import request and the response. Syncs are kept for 7 days.","operationId":"FoodZoneMenuSyncsController_findPayload","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (their JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"syncId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodZoneMenuSyncPayloadDto"}}}},"404":{"description":"The sync failed before sending, or is gone."}},"summary":"Get what a menu sync sent and received","tags":["Restaurant Settings"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:settings:restaurant"]}}},"/restaurants/{restaurantId}/reports/sales":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nReturns a summary and breakdown of completed orders for a date range. Optionally scoped to a branch or ordering channel. All monetary values are in the restaurant currency.","operationId":"SalesReportController_getSalesReport","parameters":[{"name":"date_from","required":true,"in":"query","description":"Inclusive lower bound as a UTC instant.","schema":{"format":"date-time","example":"2026-05-12T00:00:00.000Z","type":"string"}},{"name":"date_to","required":true,"in":"query","description":"Inclusive upper bound as a UTC instant.","schema":{"format":"date-time","example":"2026-06-10T23:59:59.999Z","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"channel_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"channel_kind","required":false,"in":"query","description":"Every channel of one kind at once: CASHIER is the restaurant’s own sales (orders with no channel placed at the cashier or a table included), DELIVERY_APP every delivery app together. Each order is in exactly one kind. Combined with channel_id the two narrow each other.","schema":{"$ref":"#/components/schemas/OrderingChannelKind"}},{"name":"top_products_limit","required":false,"in":"query","schema":{"minimum":1,"maximum":50,"type":"number"}},{"name":"compare_previous","required":false,"in":"query","description":"Also compute the window of the same length immediately before this one (summary and days only) and return it as `previous`, so a comparison costs one request.","schema":{"type":"boolean"}},{"name":"custom_field_id","required":false,"in":"query","description":"Filter orders to those that have this custom field set. When provided without customFieldValue, the response also includes a byCustomField breakdown.","schema":{"format":"uuid","type":"string"}},{"name":"custom_field_value","required":false,"in":"query","description":"Narrow the custom field filter to a specific value (case-insensitive).","schema":{"type":"string"}},{"name":"custom_field_values","required":false,"in":"query","description":"Values to match (case-insensitive, OR). Takes precedence over custom_field_value; omit both to get the byCustomField breakdown.","schema":{"type":"array","items":{"type":"string"}}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesReportResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Sales report","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/reports/products":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nPer-product performance over a date range: revenue, quantity sold, order count, average revenue per order, profit and revenue share, plus a category breakdown. Optionally scoped to a branch and/or a set of categories. All monetary values are in the restaurant currency.","operationId":"ProductReportController_getProductReport","parameters":[{"name":"date_from","required":true,"in":"query","description":"Inclusive lower bound as a UTC instant.","schema":{"format":"date-time","example":"2026-05-12T00:00:00.000Z","type":"string"}},{"name":"date_to","required":true,"in":"query","description":"Inclusive upper bound as a UTC instant.","schema":{"format":"date-time","example":"2026-06-10T23:59:59.999Z","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"category_ids","required":false,"in":"query","description":"Filter to products in these categories. Repeat or comma-separate: `?category_ids=<id1>,<id2>` or `?category_ids=<id1>&category_ids=<id2>`.","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"limit","required":false,"in":"query","description":"Maximum number of products returned in the `products` array (sorted by revenue).","schema":{"minimum":1,"maximum":500,"default":100,"type":"number"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Product report","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/reports/returns":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nReturns, refunds and inventory-disposition analytics for a date range. Money (refund) and inventory effect (NONE / RESTOCK / WASTE) are independent axes. Optionally scoped to a branch. All monetary values are in the restaurant currency.","operationId":"ReturnsReportController_getReturnsReport","parameters":[{"name":"date_from","required":true,"in":"query","description":"Inclusive lower bound as a UTC instant.","schema":{"format":"date-time","example":"2026-05-12T00:00:00.000Z","type":"string"}},{"name":"date_to","required":true,"in":"query","description":"Inclusive upper bound as a UTC instant.","schema":{"format":"date-time","example":"2026-06-10T23:59:59.999Z","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"top_products_limit","required":false,"in":"query","description":"Max rows in topReturnedProducts (default 10).","schema":{"minimum":1,"maximum":50,"type":"number"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnsReportResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Returns & refunds report","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/reports/returns/orders":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nPaginated list of the orders that had a return in the date range — the detail behind the returns report summary. Shares the report scope (restaurant, optional branch), and adds free-text search and a fully/partially-returned filter.","operationId":"ReturnsReportController_getReturnedOrders","parameters":[{"name":"date_from","required":true,"in":"query","description":"Inclusive lower bound as a UTC instant.","schema":{"format":"date-time","example":"2026-05-12T00:00:00.000Z","type":"string"}},{"name":"date_to","required":true,"in":"query","description":"Inclusive upper bound as a UTC instant.","schema":{"format":"date-time","example":"2026-06-10T23:59:59.999Z","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"return_status","required":false,"in":"query","description":"Narrow to fully- or partially-returned orders. Omit for both.","schema":{"type":"string","enum":["PARTIALLY_RETURNED","FULLY_RETURNED"]}},{"name":"search","required":false,"in":"query","description":"Customer name / phone (contains), serial number, or offline receipt number.","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated returned orders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderResponseDto"}}}}}},"security":[{"Bearer":[]}],"summary":"Returned orders (row-level detail for the returns report)","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/reports/custom-fields":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nOne section per active DROPDOWN order field, each listing every option (zero-filled) with its completed-order count and net revenue for the date range. Optionally scoped to a branch. All monetary values are in the restaurant currency.","operationId":"CustomFieldsReportController_getCustomFieldsReport","parameters":[{"name":"date_from","required":true,"in":"query","description":"Inclusive lower bound as a UTC instant.","schema":{"format":"date-time","example":"2026-05-12T00:00:00.000Z","type":"string"}},{"name":"date_to","required":true,"in":"query","description":"Inclusive upper bound as a UTC instant.","schema":{"format":"date-time","example":"2026-06-10T23:59:59.999Z","type":"string"}},{"name":"branch_id","required":false,"in":"query","description":"Scope to a single branch. Omit to cover every branch of the restaurant.","schema":{"format":"uuid","type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldsReportResponseDto"}}}}},"security":[{"Bearer":[]}],"summary":"Custom dropdown fields report","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/reports/exports":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nReturns previously requested Excel exports for this restaurant, newest first. Does not expose storage keys. Download a READY file via GET …/exports/:id/file.","operationId":"ReportExportController_list","parameters":[{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"report_type","required":false,"in":"query","schema":{"type":"string","enum":["sales"]}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedReportListDto"}}}}},"security":[{"Bearer":[]}],"summary":"List generated report files","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/reports/exports/{id}/file":{"get":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nWhen status is READY, streams the stored artifact: the .xlsx for a spreadsheet, or the report model as JSON for a PDF (the browser renders the PDF from it). Tenant-scoped by restaurantId; storage keys are never returned.","operationId":"ReportExportController_download","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Excel workbook, or the report model as JSON for a PDF export","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary"}}}}},"security":[{"Bearer":[]}],"summary":"Download a previously generated report","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/restaurants/{restaurantId}/reports/{reportType}/export":{"post":{"description":"**Access:** ![Permission: read:orders:restaurant](https://img.shields.io/badge/Permission-read%3Aorders%3Arestaurant-green)\n\nEnqueues generation and returns a PENDING row immediately. Poll GET …/reports/exports until status is READY, then download via GET …/exports/:id/file. A user cannot queue a second report while they already have a PENDING or PROCESSING one. Sales exports require date_from and date_to and reject spans longer than 366 days.","operationId":"ReportExportController_export","parameters":[{"name":"reportType","required":true,"in":"path","schema":{"enum":["sales"],"type":"string"}},{"name":"date_from","required":false,"in":"query","description":"Inclusive lower bound as a UTC instant. Required for sales exports.","schema":{"format":"date-time","example":"2026-08-17T00:00:00.000Z","type":"string"}},{"name":"date_to","required":false,"in":"query","description":"Inclusive upper bound as a UTC instant. Required for sales exports.","schema":{"format":"date-time","example":"2026-08-17T23:59:59.999Z","type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"channel_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"channel_kind","required":false,"in":"query","description":"Every channel of one kind at once — see the sales report.","schema":{"$ref":"#/components/schemas/OrderingChannelKind"}},{"name":"custom_field_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"custom_field_value","required":false,"in":"query","schema":{"type":"string"}},{"name":"locale","required":false,"in":"query","schema":{"default":"ar","type":"string","enum":["ar","en"]}},{"name":"format","required":false,"in":"query","schema":{"default":"xlsx","type":"string","enum":["xlsx","pdf"]}},{"name":"restaurantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedReportDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedReportDto"}}}}},"security":[{"Bearer":[]}],"summary":"Queue an Excel report","tags":["Reports"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:orders:restaurant"]}}},"/branches/{branchId}/printers/default-cashier":{"get":{"operationId":"BranchPrintersController_getDefaultCashier","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}},"summary":"Get the default cashier printer for this branch","tags":["Printers"],"description":"**Access:** ![Permission: read:mobile_printers:branch](https://img.shields.io/badge/Permission-read%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:mobile_printers:branch"]}}},"/branches/{branchId}/printers/default-kitchen":{"get":{"operationId":"BranchPrintersController_getDefaultKitchen","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}},"summary":"Get the default kitchen printer for this branch","tags":["Printers"],"description":"**Access:** ![Permission: read:mobile_printers:branch](https://img.shields.io/badge/Permission-read%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:mobile_printers:branch"]}}},"/branches/{branchId}/printers/stats":{"get":{"operationId":"BranchPrintersController_getStats","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterStatsDto"}}}}},"summary":"Printer counts and breakdown by type for this branch","tags":["Printers"],"description":"**Access:** ![Permission: read:mobile_printers:branch](https://img.shields.io/badge/Permission-read%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:mobile_printers:branch"]}}},"/branches/{branchId}/printers/order-routing":{"post":{"description":"**Access:** ![Permission: read:mobile_printers:branch](https://img.shields.io/badge/Permission-read%3Amobile__printers%3Abranch-green)\n\nReturns active printers matching the given category IDs — either because they have printsAllCategories=true or have a direct category assignment. Result is grouped by printer type.","operationId":"BranchPrintersController_getOrderRouting","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPrintersDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPrintersResponseDto"}}}}},"summary":"Resolve which printers should print for an order","tags":["Printers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:mobile_printers:branch"]}}},"/branches/{branchId}/printers":{"get":{"operationId":"BranchPrintersController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}},{"name":"active_only","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"printer_type","required":false,"in":"query","schema":{"type":"string","enum":["DELIVERY","CASHIER","KITCHEN"]}},{"name":"device_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}}},"summary":"List printers for this branch","tags":["Printers"],"description":"**Access:** ![Permission: read:mobile_printers:branch](https://img.shields.io/badge/Permission-read%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:mobile_printers:branch"]}},"post":{"operationId":"BranchPrintersController_create","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMobilePrinterDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}},"summary":"Create a printer for this branch","tags":["Printers"],"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}}},"/branches/{branchId}/printers/{printerId}":{"get":{"operationId":"BranchPrintersController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"printerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}},"summary":"Get a printer by id","tags":["Printers"],"description":"**Access:** ![Permission: read:mobile_printers:branch](https://img.shields.io/badge/Permission-read%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:mobile_printers:branch"]}},"put":{"operationId":"BranchPrintersController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"printerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMobilePrinterDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}},"summary":"Update a printer","tags":["Printers"],"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}},"delete":{"operationId":"BranchPrintersController_remove","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"printerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid"}}],"responses":{"204":{"description":"Printer removed."}},"summary":"Delete a printer","tags":["Printers"],"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}}},"/branches/{branchId}/printers/{printerId}/categories":{"put":{"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)\n\nAtomically replaces all category assignments for this printer.","operationId":"BranchPrintersController_bulkSetCategories","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"printerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSetCategoriesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}},"summary":"Bulk replace category assignments","tags":["Printers"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}}},"/branches/{branchId}/printers/{printerId}/categories/{categoryId}":{"post":{"operationId":"BranchPrintersController_addCategory","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"printerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterCategoryDto"}}}}},"summary":"Add or update a category assignment","tags":["Printers"],"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}},"delete":{"operationId":"BranchPrintersController_removeCategory","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"printerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid"}}],"responses":{"204":{"description":"Assignment removed."}},"summary":"Remove a category assignment","tags":["Printers"],"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}}},"/branches/{branchId}/printers/{printerId}/duplicate":{"post":{"operationId":"BranchPrintersController_duplicate","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"printerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"branchId","required":true,"in":"path","schema":{"format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicatePrinterDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}},"summary":"Duplicate a printer (within this branch or to another branch)","tags":["Printers"],"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}}},"/restaurants/{restaurantId}/printers":{"get":{"operationId":"RestaurantPrintersController_listAll","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored only for SUPER_ADMIN.","required":false,"schema":{"type":"string"}},{"name":"restaurantId","required":true,"in":"path","schema":{"format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MobilePrinterDto"}}}}}},"summary":"List all printers across all branches of the restaurant","tags":["Printers"],"description":"**Access:** ![Permission: manage:mobile_printers:branch](https://img.shields.io/badge/Permission-manage%3Amobile__printers%3Abranch-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:mobile_printers:branch"]}}},"/expenses":{"get":{"operationId":"ExpensesController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["PENDING","PAID","OVERDUE","CANCELLED"]}}},{"name":"payment_method","required":false,"in":"query","description":"Only expenses paid (or to be paid) by these methods. Repeat or comma-separate.","schema":{"type":"array","items":{"type":"string","enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"]}}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"category_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"supplier_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"format":"date","example":"2026-01-01","type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"format":"date","example":"2026-12-31","type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple: `?expand=category&expand=supplier`","schema":{"type":"array","items":{"type":"string","enum":["category","supplier","branch"]}}},{"name":"locale","required":false,"in":"query","description":"Locale for exported column headers.","schema":{"type":"string","enum":["ar","en"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseListDto"}}}}},"summary":"List expenses","tags":["Expenses"],"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}},"post":{"operationId":"ExpensesController_create","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}}},"summary":"Create an expense","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}}},"/expenses/export":{"get":{"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)\n\nStreams a CSV of every expense matching the current filters (not paginated). Pass `locale=ar|en` to localize the column headers.","operationId":"ExpensesController_export","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","enum":["PENDING","PAID","OVERDUE","CANCELLED"]}}},{"name":"payment_method","required":false,"in":"query","description":"Only expenses paid (or to be paid) by these methods. Repeat or comma-separate.","schema":{"type":"array","items":{"type":"string","enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"]}}},{"name":"branch_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"category_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"supplier_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"format":"date","example":"2026-01-01","type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"format":"date","example":"2026-12-31","type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load. Repeat for multiple: `?expand=category&expand=supplier`","schema":{"type":"array","items":{"type":"string","enum":["category","supplier","branch"]}}},{"name":"locale","required":false,"in":"query","description":"Locale for exported column headers.","schema":{"type":"string","enum":["ar","en"]}}],"responses":{"200":{"description":"CSV file","content":{"text/csv; charset=utf-8":{"schema":{"type":"string","format":"binary"}}}}},"summary":"Export expenses to CSV","tags":["Expenses"],"x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}}},"/expenses/stats":{"get":{"operationId":"ExpensesController_stats","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"format":"date","example":"2026-01-01","type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"format":"date","example":"2026-12-31","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseStatsDto"}}}}},"summary":"Get expense statistics for the active period","tags":["Expenses"],"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}}},"/expenses/{expenseId}":{"get":{"operationId":"ExpensesController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"expand","required":false,"in":"query","description":"Relations to eager-load.","schema":{"type":"array","items":{"type":"string","enum":["category","supplier","branch"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}}},"summary":"Get an expense by id","tags":["Expenses"],"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}},"put":{"operationId":"ExpensesController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}}},"summary":"Update an expense","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}}},"/expenses/{expenseId}/pay":{"patch":{"operationId":"ExpensesController_pay","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}}},"summary":"Mark an expense as paid","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}}},"/expenses/{expenseId}/cancel":{"patch":{"operationId":"ExpensesController_cancel","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelExpenseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}}},"summary":"Cancel an expense","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}}},"/expenses/{expenseId}/attachments":{"post":{"operationId":"ExpensesController_addAttachment","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Image (jpeg/png/webp) or PDF."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}}},"summary":"Upload an attachment to an expense","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}},"delete":{"operationId":"ExpensesController_removeAttachment","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDto"}}}}},"summary":"Remove an attachment from an expense by URL","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}}},"/expenses/recurring":{"get":{"operationId":"ExpensesController_listRecurring","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Case-insensitive match on the schedule title.","schema":{"maxLength":100,"type":"string"}},{"name":"is_active","required":false,"in":"query","description":"Filter by active (running) vs. paused schedules.","schema":{"type":"boolean"}},{"name":"branch_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}},{"name":"category_id","required":false,"in":"query","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringScheduleListDto"}}}}},"summary":"List recurring expense schedules","tags":["Expenses"],"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}},"post":{"operationId":"ExpensesController_createRecurring","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecurringScheduleDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringScheduleDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringScheduleDto"}}}}},"summary":"Create a recurring expense schedule","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}}},"/expenses/recurring/{scheduleId}":{"get":{"operationId":"ExpensesController_findOneRecurring","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"scheduleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringScheduleDto"}}}}},"summary":"Get a recurring expense schedule by id","tags":["Expenses"],"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}},"put":{"operationId":"ExpensesController_updateRecurring","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"scheduleId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRecurringScheduleDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringScheduleDto"}}}}},"summary":"Update a recurring expense schedule","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}},"delete":{"operationId":"ExpensesController_removeRecurring","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"scheduleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Schedule deleted."}},"summary":"Delete a recurring expense schedule","tags":["Expenses"],"description":"**Access:** ![Permission: manage:expenses:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expenses:restaurant"]}}},"/expense-categories":{"get":{"operationId":"ExpenseCategoriesController_list","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Clamped server-side to MAX_EXPLICIT_LIMIT (5000).","schema":{"minimum":1,"maximum":5000,"type":"number"}},{"name":"search","required":false,"in":"query","description":"Free-text search across name and nameAr (and any extra identifier fields the endpoint exposes). Case-insensitive substring match. Optimised with a pg_trgm GIN index.","schema":{"maxLength":100,"example":"burger","type":"string"}},{"name":"is_active","required":false,"in":"query","schema":{"example":true,"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryListDto"}}}}},"summary":"List expense categories","tags":["Expense Categories"],"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}},"post":{"operationId":"ExpenseCategoriesController_create","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryDto"}}}}},"summary":"Create an expense category","tags":["Expense Categories"],"description":"**Access:** ![Permission: manage:expense_categories:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpense__categories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expense_categories:restaurant"]}}},"/expense-categories/{categoryId}":{"get":{"operationId":"ExpenseCategoriesController_findOne","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryDto"}}}}},"summary":"Get an expense category by id","tags":["Expense Categories"],"description":"**Access:** ![Permission: read:expenses:restaurant](https://img.shields.io/badge/Permission-read%3Aexpenses%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["read:expenses:restaurant"]}},"put":{"operationId":"ExpenseCategoriesController_update","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryDto"}}}}},"summary":"Update an expense category","tags":["Expense Categories"],"description":"**Access:** ![Permission: manage:expense_categories:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpense__categories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expense_categories:restaurant"]}},"delete":{"operationId":"ExpenseCategoriesController_remove","parameters":[{"name":"x-restaurant-id","in":"header","description":"Override active restaurant. Ignored for staff users (JWT is authoritative); honored for SUPER_ADMIN only.","required":false,"schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Category deleted."}},"summary":"Delete an expense category","tags":["Expense Categories"],"description":"**Access:** ![Permission: manage:expense_categories:restaurant](https://img.shields.io/badge/Permission-manage%3Aexpense__categories%3Arestaurant-green)","x-authorization":{"isPublic":false,"roles":[],"membership":null,"feature":null,"permissions":["manage:expense_categories:restaurant"]}}}},"info":{"title":"API","description":"HTTP API","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"Bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"ActivityActorDto":{"type":"object","properties":{"type":{"enum":["STAFF","SUPER_ADMIN","PLATFORM_ADMIN","CUSTOMER","SYSTEM","PROVIDER","DEVICE"],"type":"string"},"id":{"type":"string","nullable":true},"role":{"type":"string","nullable":true,"example":"CASHIER"},"name":{"type":"string","nullable":true,"description":"Resolved at read time."}},"required":["type","id","role","name"],"title":"ActivityActorDto"},"ActivitySubjectDto":{"type":"object","properties":{"type":{"type":"string","example":"order"},"id":{"type":"string"},"label":{"type":"string","nullable":true,"example":"#1234"}},"required":["type","id","label"],"title":"ActivitySubjectDto"},"ActivityOperationResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"enum":["internal.error","table.occupied","table.released","order.status_changed","order.completed_automatically","order.step_failed","payment.recorded","gift_card.debited","zatca.invoice_issued","zatca.credit_note_issued","zatca.invoice_submitted","zatca.invoice_failed","loyalty.points_earned","loyalty.points_redeemed","loyalty.points_reversed","loyalty.points_credited_back","promotion.reversed","loyalty.stamps_queued","loyalty.stamps_awarded","loyalty.stamps_failed","stock.deduction_queued","stock.deducted","stock.deduction_skipped","stock.deduction_failed","stock.returned","stock.return_failed","expense.generated","subscription.expired"],"type":"string","description":"The dashboard renders the message from code and params."},"status":{"enum":["SUCCEEDED","FAILED"],"type":"string"},"error_code":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"params":{"type":"object","additionalProperties":true},"ref_type":{"type":"string","nullable":true,"example":"stock_transaction"},"ref_id":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"}},"required":["id","code","status","error_code","error_message","params","ref_type","ref_id","created_at"],"title":"ActivityOperationResponseDto"},"ActivityGroupDto":{"type":"object","properties":{"count":{"type":"number","description":"Rows in the group, this one included.","example":3},"first_at":{"format":"date-time","type":"string","description":"When the oldest row in the group happened."},"changes":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Net change across the group (first `from`, last `to`); a field set back to where it started is left out."},"activities":{"description":"The other rows, newest first.","type":"array","items":{"$ref":"#/components/schemas/ActivityResponseDto"}}},"required":["count","first_at","changes","activities"],"title":"ActivityGroupDto"},"ActivityResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string"},"branch_id":{"type":"string","nullable":true},"category":{"enum":["ORDERS","PAYMENTS","INVENTORY","MENU","EMENU","CUSTOMERS","LOYALTY","STAFF","BRANCHES","FINANCE","BILLING","PLATFORM","SYSTEM","REPORTS"],"type":"string"},"code":{"enum":["order.created","order.placed_online","order.delivery_app_received","order.delivery_app_dropped","order.delivery_app_status_updated","order.delivery_app_cancelled","order.delivery_app_cancel_requested","order.updated","order.items_added","order.item_updated","order.item_removed","order.sent_to_kitchen","order.status_updated","order.reviewed","order.kitchen_status_updated","order.cancelled","order.voided","order.deferred","order.return_created","order.refund_recorded","pager.created","pager.marked_ready","pager.called","pager.collected","pager.cancelled","table.session_opened","table.session_closed","order.payment_recorded","order.payment_added","order.payment_method_changed","customer_credit.settled","customer_credit.payment_link_created","online_payment.confirmed","online_payment.refunded","zatca.retry_swept","stock_item.created","stock_item.updated","stock_item.deactivated","stock_category.created","stock_category.updated","stock_category.deleted","unit_of_measure.created","unit_of_measure.updated","unit_of_measure.deactivated","inventory_location.created","inventory_location.updated","inventory_location.deactivated","inventory_settings.updated","recipe.created","recipe.updated","recipe.deleted","recipe.ingredient_added","recipe.ingredient_updated","recipe.ingredient_removed","option_value_effect.created","option_value_effect.updated","option_value_effect.deleted","supplier.created","supplier.updated","supplier.deactivated","supplier.item_added","supplier.item_updated","supplier.item_removed","purchase.created","purchase.updated","purchase.submitted","purchase.confirmed","purchase.received","purchase.posted","purchase.voided","purchase.cancelled","transfer.created","transfer.updated","transfer.submitted","transfer.approved","transfer.shipped","transfer.received","transfer.cancelled","inventory_count.created","inventory_count.item_added","inventory_count.started","inventory_count.submitted","inventory_count.approved","inventory_count.discarded","stock.adjusted","wastage_reason_code.created","wastage_reason_code.updated","wastage_entry.created","wastage_entry.updated","wastage_entry.submitted","wastage_entry.approved","wastage_entry.rejected","wastage_entry.posted","production_order.created","production_order.started","production_order.completed","production_order.posted","production_order.cancelled","order_posting.retried","order_posting.resolved","product.created","product.updated","product.deactivated","product.bulk_deactivated","product.variant_created","product.variant_updated","product.variant_deleted","product.option_groups_linked","product.option_group_unlinked","product.option_groups_reordered","product.branch_availability_updated","product.branch_availability_removed","product.variant_branch_availability_updated","product.variant_branch_availability_removed","product.prices_adjusted","product.prices_bulk_updated","product.imported","product.legacy_variants_cleaned","category.created","category.updated","category.deleted","category.reordered","category.branch_availability_added","category.branch_availability_removed","option_group.created","option_group.updated","option_group.deactivated","option_group.snoozed","option_group.sorted","option_value.created","option_value.updated","option_value.deleted","option_value.reordered","discount.created","discount.updated","discount.deleted","scale_barcode_format.created","scale_barcode_format.updated","scale_barcode_format.deleted","promotion.created","promotion.updated","promotion.deleted","price_override.set","price_override.removed","emenu.settings_updated","emenu.theme_applied","emenu.page_created","emenu.page_updated","emenu.page_deleted","reservation_config.updated","reservation_schedule.added","reservation_schedule.removed","reservation_schedule.applied_to_all_days","table_reservation.created","table_reservation.requested","table_reservation.updated","table_reservation.deleted","customer.created","customer.updated","customer.deleted","customer.account_deleted","customer.note_added","customer.note_deleted","gift_card.issued","gift_card.cancelled","gift_card.expired","gift_card_theme.created","gift_card_theme.updated","gift_card_theme.archived","loyalty_pass_theme.created","loyalty_pass_theme.updated","loyalty_pass_theme.archived","loyalty_pass_theme.unarchived","loyalty_pass.joined","loyalty_pass.stamps_added","loyalty_pass.redeemed","loyalty_pass.voided","loyalty_pass.unvoided","loyalty_pass.promotional_alert_sent","loyalty_pass.geolocation_message_updated","loyalty_pass_icon.created","loyalty_pass_icon.deleted","staff_member.added","staff_member.updated","staff_member.role_changed","staff_member.removed","staff_member.branch_assigned","staff_member.branch_unassigned","staff_member.permissions_updated","staff_member.availability_set","staff_member.availability_removed","staff_member.service_assigned","staff_member.service_unassigned","cashier_shift.opened","cashier_shift.closed","cashier_shift.reopened","cashier_shift.corrected","branch.created","branch.updated","branch.deleted","order_field.created","order_field.updated","order_field.deactivated","delivery_zone.created","delivery_zone.updated","delivery_zone.deleted","delivery_settings.updated","dining_table.created","dining_table.updated","dining_table.deleted","table_group.created","table_group.updated","table_group.deleted","printer.created","printer.updated","printer.deleted","printer.duplicated","printer.categories_updated","printer.category_linked","printer.category_unlinked","customer_display.paired","customer_display.renamed","customer_display.revoked","ordering_channel.created","ordering_channel.updated","ordering_channel.deleted","ordering_channel.branch_linked","ordering_channel.branch_unlinked","channel_commission.set","channel_commission.removed","payment_method.created","payment_method.updated","payment_method.deleted","payment_provider.connected","payment_provider.updated","payment_provider.disconnected","restaurant_settings.updated","restaurant_settings.invoice_counter_reset","zatca.csr_generated","zatca.compliance_csid_requested","zatca.compliance_checks_run","zatca.production_csid_requested","zatca.production_csid_renewed","zatca.unlinked","service_booking.created","service_booking.updated","service_booking.cancelled","expense.created","expense.updated","expense.paid","expense.cancelled","expense.attachment_added","expense.attachment_removed","expense_category.created","expense_category.updated","expense_category.deleted","recurring_expense.created","recurring_expense.updated","recurring_expense.deleted","report.exported","offline_sync.batch_received","offline_sync.issue_resolved","offline_sync.action_settled","subscription.payment_started","subscription.change_purchase_started","subscription.updated","marketplace.trial_started","marketplace.purchase_started","marketplace.app_granted","marketplace.app_revoked","loyalty.points_expired","recurring_expenses.generated","subscriptions.expired"],"type":"string","description":"The dashboard renders the message from code and params."},"status":{"enum":["SUCCEEDED","FAILED"],"type":"string"},"error_code":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"actor":{"$ref":"#/components/schemas/ActivityActorDto"},"subject":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ActivitySubjectDto"}]},"params":{"type":"object","additionalProperties":true},"duration_ms":{"type":"number","nullable":true},"operations":{"type":"array","items":{"$ref":"#/components/schemas/ActivityOperationResponseDto"}},"operation_count":{"type":"number","description":"List endpoints only."},"failed_operation_count":{"type":"number","description":"List endpoints only."},"group":{"description":"List with `group=true` only: the related edits folded into this row.","allOf":[{"$ref":"#/components/schemas/ActivityGroupDto"}]},"created_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","branch_id","category","code","status","error_code","error_message","actor","subject","params","duration_ms","created_at"],"title":"ActivityResponseDto"},"PaginationMetaDto":{"type":"object","properties":{"page":{"type":"number","example":1},"limit":{"type":"number","example":10},"total":{"type":"number","example":47},"total_pages":{"type":"number","example":5},"has_next_page":{"type":"boolean","example":true},"has_previous_page":{"type":"boolean","example":false}},"required":["page","limit","total","total_pages","has_next_page","has_previous_page"],"title":"PaginationMetaDto"},"ActivityListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ActivityResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ActivityListResponseDto"},"RegisterDto":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"phone":{"type":"string"}},"required":["name","email","password","phone"],"title":"RegisterDto"},"AuthUserResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"b5b1e2c0-1e7c-4d4b-9a9c-7e3a3f6d2c11"},"type":{"enum":["SUPER_ADMIN","PLATFORM_ADMIN","STAFF","CUSTOMER"],"type":"string","description":"Session actor type — what kind of subject this token belongs to"},"role":{"type":"string","description":"Effective role string (SUPER_ADMIN, RESTAURANT_ADMIN, BRANCH_MANAGER, CASHIER, …)","example":"RESTAURANT_ADMIN"},"restaurant_id":{"type":"string","nullable":true,"format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"permissions":{"example":[],"type":"array","items":{"type":"string"}}},"required":["id","type","role","restaurant_id","branch_id","permissions"],"title":"AuthUserResponseDto"},"AccessibleBranchResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Main Branch"},"name_ar":{"type":"string","nullable":true,"example":"الفرع الرئيسي"},"is_main_branch":{"type":"boolean","example":true},"is_active":{"type":"boolean","example":true},"subscription_status":{"type":"string","enum":["ACTIVE","EXPIRED","NONE"],"example":"ACTIVE","description":"Effective subscription status of the branch. EXPIRED covers any ended/lapsed/cancelled subscription; NONE = never subscribed. Use it to render a \"renew plan\" widget when an expired branch is selected."},"subscription_ends_at":{"type":"string","nullable":true,"format":"date-time","description":"When the branch subscription ends/ended (null if none or open-ended)."},"plan_name":{"type":"string","nullable":true,"example":"Growth","description":"Snapshotted plan name of the branch subscription (null if never subscribed)."}},"required":["id","name","name_ar","is_main_branch","is_active","subscription_status","subscription_ends_at","plan_name"],"title":"AccessibleBranchResponseDto"},"AuthResponseDto":{"type":"object","properties":{"access_token":{"type":"string","description":"Short-lived JWT access token (Bearer).","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refresh_token":{"type":"string","description":"Opaque refresh token; exchange via POST /auth/refresh.","example":"k3z9mTqA-hY2pL..."},"user":{"$ref":"#/components/schemas/AuthUserResponseDto"},"accessible_branches":{"description":"Branches the user can operate against. Populated only on restaurant logins (staff or restaurant admin).","type":"array","items":{"$ref":"#/components/schemas/AccessibleBranchResponseDto"}}},"required":["access_token","refresh_token","user"],"title":"AuthResponseDto"},"ValidationDetailDto":{"type":"object","properties":{"field":{"type":"string","example":"email","description":"Path of the offending field (dot-notation for nested)."},"messages":{"example":["email must be an email"],"type":"array","items":{"type":"string"}}},"required":["field","messages"],"title":"ValidationDetailDto"},"AuthErrorResponseDto":{"type":"object","properties":{"success":{"type":"boolean","example":false},"status_code":{"type":"number","example":401},"error_code":{"type":"string","example":"AUTH_INVALID_CREDENTIALS","description":"Stable machine-readable error identifier — branch on this in the client."},"message":{"type":"string","example":"Invalid credentials"},"error":{"type":"string","example":"Unauthorized"},"details":{"description":"Per-field validation errors. Present only on 400 VALIDATION_FAILED responses.","type":"array","items":{"$ref":"#/components/schemas/ValidationDetailDto"}},"path":{"type":"string","example":"/auth/login"},"timestamp":{"type":"string","example":"2026-05-02T20:47:01.000Z"},"trace_id":{"type":"string","example":"545613f43f862ffd54761a7f7dcc102c","description":"OpenTelemetry trace id of the failing request. Quote it when reporting an error; it opens the request in SigNoz."}},"required":["success","status_code","error_code","message","error","timestamp"],"title":"AuthErrorResponseDto"},"LoginDto":{"type":"object","properties":{"account_number":{"type":"number","minimum":1,"description":"Restaurant account number (short integer). Alternative to the x-restaurant-id header for POS login.","example":1001},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email","password"],"title":"LoginDto"},"MfaChallengeResponseDto":{"type":"object","properties":{"status":{"enum":["MFA_REQUIRED","ENROLLMENT_REQUIRED"],"type":"string"},"ticket":{"type":"string","description":"Opaque single-use ticket for the second step."},"methods":{"type":"array","items":{"type":"string","enum":["PASSKEY","TOTP","RECOVERY_CODE"]},"description":"Methods this account can use now, strongest first."},"expires_at":{"type":"string","format":"date-time"}},"required":["status","ticket","methods","expires_at"],"title":"MfaChallengeResponseDto"},"LoginResponseDto":{"type":"object","properties":{"access_token":{"type":"string","description":"Short-lived JWT access token (Bearer).","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refresh_token":{"type":"string","description":"Opaque refresh token; exchange via POST /auth/refresh.","example":"k3z9mTqA-hY2pL..."},"user":{"$ref":"#/components/schemas/AuthUserResponseDto"},"accessible_branches":{"description":"Branches the user can operate against. Populated only on restaurant logins (staff or restaurant admin).","type":"array","items":{"$ref":"#/components/schemas/AccessibleBranchResponseDto"}},"mfa":{"description":"Present instead of tokens when a second factor is needed. Continue with `POST /auth/mfa/verify` (MFA_REQUIRED) or `POST /auth/mfa/enroll/totp` (ENROLLMENT_REQUIRED).","allOf":[{"$ref":"#/components/schemas/MfaChallengeResponseDto"}]}},"required":["access_token","refresh_token","user"],"title":"LoginResponseDto"},"CustomerRequestOtpDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"phone":{"type":"string","pattern":"^\\+?[0-9\\s]{6,20}$"}},"required":["restaurant_id","phone"],"title":"CustomerRequestOtpDto"},"OtpRequestedResponseDto":{"type":"object","properties":{"sent":{"type":"boolean","description":"true once the OTP request has been accepted (SMS delivery is async).","example":true}},"required":["sent"],"title":"OtpRequestedResponseDto"},"CustomerLoginDto":{"type":"object","properties":{"name":{"type":"string","description":"Customer's display name. Stored only on first login."},"email":{"type":"string","format":"email"},"restaurant_id":{"type":"string","format":"uuid"},"phone":{"type":"string","pattern":"^\\+?[0-9\\s]{6,20}$"}},"required":["restaurant_id","phone"],"title":"CustomerLoginDto"},"RefreshTokenDto":{"type":"object","properties":{"refresh_token":{"type":"string","minLength":10}},"required":["refresh_token"],"title":"RefreshTokenDto"},"ForgotPasswordDto":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Staff account email address","example":"staff@example.com"}},"required":["email"],"title":"ForgotPasswordDto"},"ResetPasswordDto":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Staff account email address","example":"staff@example.com"},"code":{"type":"string","pattern":"^[0-9]{6}$","description":"6-digit password reset code from email","example":"482910"},"password":{"type":"string","minLength":8,"description":"New password (minimum 8 characters)","example":"NewSecure1!"}},"required":["email","code","password"],"title":"ResetPasswordDto"},"ChangePasswordDto":{"type":"object","properties":{"current_password":{"type":"string","minLength":8,"description":"Current account password","example":"CurrentSecure1!"},"new_password":{"type":"string","minLength":8,"description":"New password (minimum 8 characters; must differ from current)","example":"NewSecure1!"}},"required":["current_password","new_password"],"title":"ChangePasswordDto"},"IssueRestaurantSessionDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid","description":"Optional branch to pin on the session. Omit or null for restaurant-wide RESTAURANT_ADMIN scope."}},"required":["restaurant_id"],"title":"IssueRestaurantSessionDto"},"MfaVerifyDto":{"type":"object","properties":{"ticket":{"type":"string","minLength":20,"maxLength":100,"description":"Ticket from `mfa.ticket` in the login response."},"method":{"enum":["PASSKEY","TOTP","RECOVERY_CODE"],"type":"string"},"code":{"type":"string","minLength":6,"maxLength":20,"description":"TOTP code (6 digits) or a recovery code."},"credential":{"type":"object","description":"PASSKEY only: the `navigator.credentials.get()` result as JSON (camelCase)."}},"required":["ticket","method"],"title":"MfaVerifyDto"},"MfaSessionResponseDto":{"type":"object","properties":{"access_token":{"type":"string","description":"Short-lived JWT access token (Bearer).","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refresh_token":{"type":"string","description":"Opaque refresh token; exchange via POST /auth/refresh.","example":"k3z9mTqA-hY2pL..."},"user":{"$ref":"#/components/schemas/AuthUserResponseDto"},"accessible_branches":{"description":"Branches the user can operate against. Populated only on restaurant logins (staff or restaurant admin).","type":"array","items":{"$ref":"#/components/schemas/AccessibleBranchResponseDto"}},"recovery_codes":{"description":"Only right after the first factor is set up. Shown once — never retrievable again.","type":"array","items":{"type":"string"}}},"required":["access_token","refresh_token","user"],"title":"MfaSessionResponseDto"},"MfaTicketDto":{"type":"object","properties":{"ticket":{"type":"string","minLength":20,"maxLength":100,"description":"Ticket from `mfa.ticket` in the login response."}},"required":["ticket"],"title":"MfaTicketDto"},"PasskeyOptionsResponseDto":{"type":"object","properties":{"ticket":{"type":"string","description":"Registration only: send back with the credential."},"options":{"type":"object","description":"WebAuthn options, verbatim (camelCase) — pass straight to the browser API."}},"required":["options"],"title":"PasskeyOptionsResponseDto"},"TotpSetupResponseDto":{"type":"object","properties":{"secret":{"type":"string","description":"Base32 secret, for manual entry."},"otpauth_url":{"type":"string","example":"otpauth://totp/Twlm:admin%40twlm.com?secret=…"}},"required":["secret","otpauth_url"],"title":"TotpSetupResponseDto"},"MfaEnrollConfirmDto":{"type":"object","properties":{"ticket":{"type":"string","minLength":20,"maxLength":100,"description":"Ticket from `mfa.ticket` in the login response."},"code":{"type":"string","minLength":6,"maxLength":6,"example":"123456"}},"required":["ticket","code"],"title":"MfaEnrollConfirmDto"},"MfaPasskeyResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","created_at","last_used_at"],"title":"MfaPasskeyResponseDto"},"MfaStatusResponseDto":{"type":"object","properties":{"required":{"type":"boolean","description":"MFA is mandatory for this account (last factor cannot be removed)."},"totp_enabled":{"type":"boolean"},"passkeys_available":{"type":"boolean","description":"The server has WebAuthn configured, so passkeys can be added."},"passkeys":{"type":"array","items":{"$ref":"#/components/schemas/MfaPasskeyResponseDto"}},"recovery_codes_left":{"type":"number"}},"required":["required","totp_enabled","passkeys_available","passkeys","recovery_codes_left"],"title":"MfaStatusResponseDto"},"MfaTotpConfirmDto":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":6,"example":"123456"},"password":{"type":"string","description":"Current account password (step-up for adding a factor)."}},"required":["code","password"],"title":"MfaTotpConfirmDto"},"FactorAddedResponseDto":{"type":"object","properties":{"recovery_codes":{"nullable":true,"description":"Only when this was the first factor.","type":"array","items":{"type":"string"}},"session":{"nullable":true,"description":"Only when this was the first factor: every older session was signed out; switch to these tokens.","type":"object","allOf":[{"$ref":"#/components/schemas/AuthResponseDto"}]},"passkey_id":{"type":"string","format":"uuid"}},"title":"FactorAddedResponseDto"},"MfaPasswordDto":{"type":"object","properties":{"password":{"type":"string","description":"Current account password (step-up for removing protection)."}},"required":["password"],"title":"MfaPasswordDto"},"PasskeyRegisterDto":{"type":"object","properties":{"ticket":{"type":"string","minLength":20,"maxLength":100,"description":"Ticket from `mfa.ticket` in the login response."},"credential":{"type":"object","description":"The `navigator.credentials.create()` result as JSON (camelCase)."},"name":{"type":"string","minLength":1,"maxLength":60,"example":"MacBook Touch ID"},"password":{"type":"string","description":"Current account password (step-up for adding a factor)."}},"required":["ticket","credential","name","password"],"title":"PasskeyRegisterDto"},"RecoveryCodesResponseDto":{"type":"object","properties":{"recovery_codes":{"type":"array","items":{"type":"string"}}},"required":["recovery_codes"],"title":"RecoveryCodesResponseDto"},"CustomerDisplayResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Counter 1"},"kind":{"enum":["CUSTOMER_SCREEN","PAGER_MONITOR"],"type":"string"},"paired_at":{"type":"string","nullable":true,"format":"date-time","description":"Null until the monitor collected its token."},"last_seen_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","branch_id","name","kind","paired_at","last_seen_at","created_at"],"title":"CustomerDisplayResponseDto"},"ClaimCustomerDisplayDto":{"type":"object","properties":{"code":{"type":"string","minLength":4,"maxLength":12,"example":"K7M2QX","description":"The code the monitor shows."},"name":{"type":"string","maxLength":80,"example":"Counter 1"},"kind":{"enum":["CUSTOMER_SCREEN","PAGER_MONITOR"],"type":"string","default":"CUSTOMER_SCREEN","description":"The customer-facing QR screen, or the staff pager monitor."}},"required":["code","name"],"title":"ClaimCustomerDisplayDto"},"RenameCustomerDisplayDto":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"example":"Counter 2"}},"required":["name"],"title":"RenameCustomerDisplayDto"},"CustomerPagerStatusResponseDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"The branch has the CUSTOMER_PAGER app right now."}},"required":["enabled"],"title":"CustomerPagerStatusResponseDto"},"PairingStartedResponseDto":{"type":"object","properties":{"pairing_id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"K7M2QX","description":"Shown on the monitor, typed into the dashboard."},"secret":{"type":"string","description":"Kept by the monitor to collect its display token. Shown once."},"expires_at":{"type":"string","format":"date-time"}},"required":["pairing_id","code","secret","expires_at"],"title":"PairingStartedResponseDto"},"CollectPairingDto":{"type":"object","properties":{"secret":{"type":"string","maxLength":128,"description":"The secret returned when the pairing started."}},"required":["secret"],"title":"CollectPairingDto"},"PairingCollectResponseDto":{"type":"object","properties":{"status":{"enum":["pending","paired"],"type":"string"},"display_token":{"type":"string","description":"Present once paired. Store it; it is never shown again."},"display_id":{"type":"string","format":"uuid"},"kind":{"enum":["CUSTOMER_SCREEN","PAGER_MONITOR"],"type":"string","description":"Present once paired: open the page for this kind if it is not this one."}},"required":["status"],"title":"PairingCollectResponseDto"},"PagerBrandingResponseDto":{"type":"object","properties":{"restaurant_name":{"type":"string","example":"Twlm Cafe"},"restaurant_name_ar":{"type":"string","nullable":true},"logo_url":{"type":"string","nullable":true},"branch_name":{"type":"string","example":"Olaya"},"branch_name_ar":{"type":"string","nullable":true}},"required":["restaurant_name","restaurant_name_ar","logo_url","branch_name","branch_name_ar"],"title":"PagerBrandingResponseDto"},"DisplayCashierResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"DisplayCashierResponseDto"},"DisplayQueueItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sequence":{"type":"string","example":"1042","description":"Server order of issue (bigint as string)."},"kind":{"enum":["order","standalone"],"type":"string"},"order_number":{"type":"string","example":"#12","description":"The order's number, or a standalone pager's."},"status":{"enum":["PENDING","ACCEPTED","PREPARING","READY","COMPLETED","CANCELLED","VOIDED","REJECTED"],"type":"string","description":"A standalone pager reads as PENDING until ready, then READY."},"cashier_id":{"type":"string","nullable":true,"format":"uuid"},"cashier_name":{"type":"string","nullable":true},"cashier_name_ar":{"type":"string","nullable":true},"tracking_url":{"type":"string","example":"https://v2.twlm.solutions/o/0bR2x…"},"created_at":{"type":"string","format":"date-time"},"version":{"type":"number","example":1762862400000}},"required":["id","sequence","kind","order_number","status","cashier_id","cashier_name","cashier_name_ar","tracking_url","created_at","version"],"title":"DisplayQueueItemResponseDto"},"DisplaySnapshotResponseDto":{"type":"object","properties":{"display_id":{"type":"string","format":"uuid"},"display_name":{"type":"string","example":"Counter 1"},"branch_id":{"type":"string","format":"uuid"},"service_active":{"type":"boolean","description":"False when the add-on lapsed: show the \"service inactive\" screen."},"server_time":{"type":"string","format":"date-time"},"branding":{"$ref":"#/components/schemas/PagerBrandingResponseDto"},"cashiers":{"type":"array","items":{"$ref":"#/components/schemas/DisplayCashierResponseDto"}},"queue":{"description":"In server order.","type":"array","items":{"$ref":"#/components/schemas/DisplayQueueItemResponseDto"}}},"required":["display_id","display_name","branch_id","service_active","server_time","branding","cashiers","queue"],"title":"DisplaySnapshotResponseDto"},"OrderTrackingItemResponseDto":{"type":"object","properties":{"name":{"type":"string","example":"Latte"},"name_ar":{"type":"string","nullable":true},"quantity":{"type":"number","example":2}},"required":["name","name_ar","quantity"],"title":"OrderTrackingItemResponseDto"},"OrderTrackingResponseDto":{"type":"object","properties":{"state":{"enum":["active","finished"],"type":"string","description":"`finished`: closed for over 24 hours — only the branding is returned."},"kind":{"enum":["order","standalone"],"type":"string","description":"`order` follows an order; `standalone` was handed out without one."},"order_number":{"type":"string","nullable":true,"example":"#12","description":"The order's number, or a standalone pager's number."},"status":{"nullable":true,"enum":["PENDING","ACCEPTED","PREPARING","READY","COMPLETED","CANCELLED","VOIDED","REJECTED"],"type":"string","description":"A standalone pager reads as PENDING, READY, then COMPLETED (collected) or CANCELLED."},"order_type":{"nullable":true,"enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"],"type":"string"},"call_count":{"type":"number","example":1,"description":"How many times staff called the customer; ring once for each new call."},"version":{"type":"number","example":1762862400000,"description":"Epoch ms of the latest change. Ignore any update with a lower version."},"created_at":{"type":"string","nullable":true,"format":"date-time"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderTrackingItemResponseDto"}},"branding":{"$ref":"#/components/schemas/PagerBrandingResponseDto"},"emenu_path":{"type":"string","nullable":true,"example":"/emenu/7c0e…/9a1b…","description":"In-app path to the branch's e-menu; null when the branch has none."},"push_public_key":{"type":"string","nullable":true,"description":"VAPID public key for `pushManager.subscribe`; null when Web Push is off."}},"required":["state","kind","order_number","status","order_type","call_count","version","created_at","items","branding","emenu_path","push_public_key"],"title":"OrderTrackingResponseDto"},"SubscribeOrderPushDto":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":2048,"example":"https://fcm.googleapis.com/fcm/send/…","description":"Must point at a known browser push service (FCM, Mozilla, Apple, WNS)."},"p256dh":{"type":"string","maxLength":256,"description":"subscription.keys.p256dh"},"auth":{"type":"string","maxLength":256,"description":"subscription.keys.auth"}},"required":["endpoint","p256dh","auth"],"title":"SubscribeOrderPushDto"},"CreateDiningTableDto":{"type":"object","properties":{"table_number":{"type":"string","maxLength":50,"example":"12"},"max_members":{"type":"number","minimum":1,"default":4},"is_reservable":{"type":"boolean","default":true},"is_active":{"type":"boolean","default":true},"group_id":{"type":"string","format":"uuid","description":"Assign to a table group (floor/section)"}},"required":["table_number"],"title":"CreateDiningTableDto"},"UpdateDiningTableDto":{"type":"object","properties":{"table_number":{"type":"string","maxLength":50,"example":"12"},"max_members":{"type":"number","minimum":1,"default":4},"is_reservable":{"type":"boolean","default":true},"is_active":{"type":"boolean","default":true},"group_id":{"type":"string","format":"uuid","description":"Assign to a table group (floor/section)"}},"title":"UpdateDiningTableDto"},"CreateDiningTableGroupDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Floor 1"},"sort_order":{"type":"number","minimum":0,"default":0,"description":"Display order (ascending)"}},"required":["name"],"title":"CreateDiningTableGroupDto"},"UpdateDiningTableGroupDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Floor 1"},"sort_order":{"type":"number","minimum":0,"default":0,"description":"Display order (ascending)"}},"title":"UpdateDiningTableGroupDto"},"OpenShiftDto":{"type":"object","properties":{"opening_balance":{"type":"number","minimum":0},"opening_notes":{"type":"string"},"on_behalf_of_staff_id":{"type":"string"}},"required":["opening_balance"],"title":"OpenShiftDto"},"ShiftClosingCountDto":{"type":"object","properties":{"payment_method_id":{"type":"string","nullable":true,"format":"uuid"},"method":{"type":"string"},"method_ar":{"type":"string","nullable":true},"type":{"type":"string","example":"CASH","description":"Payment method kind: a PaymentMethodType, GIFT_CARD, or DEFERRED for the آجل row (CREDIT on shifts closed before Oct 2026)."},"expected":{"type":"number","description":"System-expected amount (net taken; cash also includes the opening float)."},"counted":{"type":"number","description":"Amount the cashier physically counted."},"variance":{"type":"number","description":"counted − expected."}},"required":["payment_method_id","method","method_ar","type","expected","counted","variance"],"title":"ShiftClosingCountDto"},"ShiftStaffExpandDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"title":"ShiftStaffExpandDto"},"ShiftBranchExpandDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"city_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar","city","city_ar"],"title":"ShiftBranchExpandDto"},"ShiftViewDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"staff_id":{"type":"string","format":"uuid"},"status":{"enum":["OPEN","CLOSED"],"type":"string"},"opened_by_staff_id":{"type":"string","nullable":true,"format":"uuid"},"closed_by_staff_id":{"type":"string","nullable":true,"format":"uuid"},"opened_at":{"format":"date-time","type":"string"},"closed_at":{"type":"string","nullable":true,"format":"date-time"},"opening_balance":{"type":"number","example":50},"counted_closing_balance":{"type":"number","nullable":true},"expected_closing_balance":{"type":"number","nullable":true},"variance":{"type":"number","nullable":true},"opening_notes":{"type":"string","nullable":true},"closing_notes":{"type":"string","nullable":true},"closing_counts":{"nullable":true,"description":"Per-payment-method expected vs counted reconciliation, populated once the shift is closed.","type":"array","items":{"$ref":"#/components/schemas/ShiftClosingCountDto"}},"corrected_at":{"format":"date-time","type":"string","nullable":true,"description":"When a manager last corrected the closed figures; null when uncorrected."},"corrected_by_staff_id":{"type":"string","nullable":true},"correction_reason":{"type":"string","nullable":true},"staff":{"nullable":true,"description":"Present when `expand=staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"opened_by_staff":{"nullable":true,"description":"Present when `expand=opened_by_staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"closed_by_staff":{"nullable":true,"description":"Present when `expand=closed_by_staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"corrected_by_staff":{"nullable":true,"description":"Present when `expand=corrected_by_staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"branch":{"description":"Present when `expand=branch` is requested","allOf":[{"$ref":"#/components/schemas/ShiftBranchExpandDto"}]}},"required":["id","branch_id","staff_id","status","opened_by_staff_id","closed_by_staff_id","opened_at","closed_at","opening_balance","counted_closing_balance","expected_closing_balance","variance","opening_notes","closing_notes","closing_counts","corrected_at","corrected_by_staff_id","correction_reason"],"title":"ShiftViewDto"},"CountedPaymentMethodDto":{"type":"object","properties":{"payment_method_id":{"type":"string","description":"Restaurant payment method id this count applies to."},"type":{"type":"string","description":"Method kind (CASH, CARD, …) — fallback when no id."},"counted_amount":{"type":"number","minimum":0,"description":"Amount the cashier physically counted for this method."}},"required":["counted_amount"],"title":"CountedPaymentMethodDto"},"CloseShiftDto":{"type":"object","properties":{"counted_closing_balance":{"type":"number","minimum":0},"counted_by_method":{"description":"Physical count per payment method at close. Stored as a snapshot and reconciled against system-expected figures to produce per-method variances.","type":"array","items":{"$ref":"#/components/schemas/CountedPaymentMethodDto"}},"closing_notes":{"type":"string"}},"required":["counted_closing_balance"],"title":"CloseShiftDto"},"ShiftSummaryTotalsDto":{"type":"object","properties":{"order_count":{"type":"number"},"gross_revenue":{"type":"number"},"refunds":{"type":"number"},"net_revenue":{"type":"number"},"discounts":{"type":"number"},"cash_sales":{"type":"number"},"cash_refunds":{"type":"number","description":"Cash paid back out of the drawer this shift (refunds settled in cash)."},"collected_for_other_shifts":{"type":"number","description":"Payments this shift took on orders rung up in another shift (e.g. a deferred debt settled). Included in the tender lines, not in gross_revenue."},"unsettled_orders":{"type":"number","description":"Completed orders in this shift neither paid in full nor put on account (آجل) — an exception to chase."},"unsettled_amount":{"type":"number","description":"What the unsettled orders still lack (total − paid)."},"card_sales":{"type":"number"},"credit_sales":{"type":"number","description":"Sales put on account (آجل) this shift that no drawer holds — deferred totals minus what was collected on them."},"expected_cash":{"type":"number"},"counted_cash":{"type":"number","nullable":true},"variance":{"type":"number","nullable":true}},"required":["order_count","gross_revenue","refunds","net_revenue","discounts","cash_sales","cash_refunds","collected_for_other_shifts","unsettled_orders","unsettled_amount","card_sales","credit_sales","expected_cash","counted_cash","variance"],"title":"ShiftSummaryTotalsDto"},"ShiftPaymentMethodEntryDto":{"type":"object","properties":{"payment_method_id":{"type":"string","nullable":true,"format":"uuid"},"method":{"type":"string"},"method_ar":{"type":"string","nullable":true},"type":{"type":"string","example":"CASH","description":"Payment method kind: a PaymentMethodType, GIFT_CARD, or DEFERRED for the آجل row (CREDIT on shifts closed before Oct 2026)."},"count":{"type":"number"},"revenue":{"type":"number","description":"Gross revenue collected on this method."},"refunds":{"type":"number","description":"Money refunded back on this method during the shift."},"net":{"type":"number","description":"Net taken on this method (revenue − refunds)."}},"required":["payment_method_id","method","method_ar","type","count","revenue","refunds","net"],"title":"ShiftPaymentMethodEntryDto"},"ShiftProductEntryDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"quantity":{"type":"number","description":"Units sold during the shift."},"revenue":{"type":"number","description":"Gross revenue from this product (sum of line totals, VAT-inclusive)."},"returned_quantity":{"type":"number","description":"Units handed back during the shift, refunded or not."},"returns":{"type":"number","description":"Money credited back for this product (refunded return lines)."},"net_quantity":{"type":"number","description":"Units sold minus units returned."},"net_revenue":{"type":"number","description":"Revenue minus returns."}},"required":["product_id","name","name_ar","quantity","revenue","returned_quantity","returns","net_quantity","net_revenue"],"title":"ShiftProductEntryDto"},"ShiftChannelEntryDto":{"type":"object","properties":{"channel_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"order_count":{"type":"number"},"revenue":{"type":"number","description":"Gross order value booked on this channel."},"returns":{"type":"number","description":"Money credited back on this channel's orders."},"net_revenue":{"type":"number","description":"Revenue minus returns."}},"required":["channel_id","name","name_ar","order_count","revenue","returns","net_revenue"],"title":"ShiftChannelEntryDto"},"ShiftSummaryDto":{"type":"object","properties":{"shift":{"$ref":"#/components/schemas/ShiftViewDto"},"totals":{"$ref":"#/components/schemas/ShiftSummaryTotalsDto"},"by_payment_method":{"type":"array","items":{"$ref":"#/components/schemas/ShiftPaymentMethodEntryDto"}},"products":{"description":"Products sold during the shift.","type":"array","items":{"$ref":"#/components/schemas/ShiftProductEntryDto"}},"by_channel":{"description":"Ordering-channel statistics for the shift.","type":"array","items":{"$ref":"#/components/schemas/ShiftChannelEntryDto"}}},"required":["shift","totals","by_payment_method","products","by_channel"],"title":"ShiftSummaryDto"},"CorrectShiftDto":{"type":"object","properties":{"opening_balance":{"type":"number","minimum":0,"description":"Corrected opening float."},"counted_closing_balance":{"type":"number","minimum":0,"description":"Corrected counted cash. Defaults to the corrected cash line of `counted_by_method` when omitted."},"counted_by_method":{"description":"Corrected physical counts. Merged over the stored counts by payment method, so methods left out keep what was counted at close.","type":"array","items":{"$ref":"#/components/schemas/CountedPaymentMethodDto"}},"closing_notes":{"type":"string"},"reason":{"type":"string","maxLength":500,"description":"Why the closed shift is being corrected."}},"required":["reason"],"title":"CorrectShiftDto"},"ShiftListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ShiftViewDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ShiftListResponseDto"},"CreateReservationDto":{"type":"object","properties":{"customer_id":{"type":"string","minLength":1},"party_size":{"type":"number","minimum":1},"reservation_time":{"type":"string"},"duration_minutes":{"type":"number","minimum":1},"special_requests":{"type":"string"}},"required":["customer_id","party_size","reservation_time"],"title":"CreateReservationDto"},"ReservationCustomerDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"phone":{"type":"string","example":"+966500000000"},"email":{"type":"string","nullable":true}},"required":["id","phone"],"title":"ReservationCustomerDto"},"ReservationDiningTableDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"table_number":{"type":"string","example":"T-01"},"max_members":{"type":"number","minimum":1,"example":4},"is_reservable":{"type":"boolean"}},"required":["id","table_number","max_members"],"title":"ReservationDiningTableDto"},"TableReservationResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"018e7c3a-6f2b-7000-b1c2-d3e4f5a60001"},"branch_id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"dining_table_id":{"type":"string","format":"uuid"},"table_number":{"type":"string","example":"T-01"},"reservation_time":{"format":"date-time","type":"string","example":"2026-07-10T19:00:00.000Z"},"duration_minutes":{"type":"number","minimum":1,"example":60},"party_size":{"type":"number","minimum":1,"example":2},"special_requests":{"type":"string","nullable":true,"example":"Window seat preferred"},"status":{"type":"string","example":"pending","description":"pending | confirmed | seated | completed | cancelled"},"cancelled_at":{"format":"date-time","type":"string","nullable":true},"cancelled_reason":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"customer":{"$ref":"#/components/schemas/ReservationCustomerDto"},"dining_table":{"$ref":"#/components/schemas/ReservationDiningTableDto"}},"required":["id","branch_id","customer_id","dining_table_id","table_number","reservation_time","duration_minutes","party_size","status","created_at","updated_at","customer","dining_table"],"title":"TableReservationResponseDto"},"UpdateTableReservationDto":{"type":"object","properties":{"reservation_time":{"type":"string"},"duration_minutes":{"type":"number","nullable":true,"minimum":1},"party_size":{"type":"number","minimum":1},"special_requests":{"type":"string"},"status":{"type":"string","maxLength":20},"cancelled_reason":{"type":"string"}},"title":"UpdateTableReservationDto"},"DeleteReservationResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","example":true}},"required":["deleted"],"title":"DeleteReservationResponseDto"},"AvailableTimeSlotsResponseDto":{"type":"object","properties":{"date":{"type":"string","example":"2026-07-10","description":"Local date (YYYY-MM-DD)"},"party_size":{"type":"number","example":2},"starts":{"example":["2026-07-10T17:00:00.000Z","2026-07-10T17:15:00.000Z"],"description":"Available slot start times as ISO 8601 UTC strings","type":"array","items":{"type":"string"}}},"required":["date","party_size","starts"],"title":"AvailableTimeSlotsResponseDto"},"CreateCustomerReservationDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"party_size":{"type":"number","minimum":1,"example":2},"reservation_time":{"type":"string","example":"2026-08-11T12:30:00.000Z"},"duration_minutes":{"type":"number","minimum":1,"example":90},"special_requests":{"type":"string"}},"required":["branch_id","party_size","reservation_time"],"title":"CreateCustomerReservationDto"},"DiningTableStatusResponseDto":{"type":"object","properties":{"table_id":{"type":"string","format":"uuid"},"table_number":{"type":"string","example":"T-05"},"is_active":{"type":"boolean"},"is_occupied":{"type":"boolean","description":"True when the table has an open current order session."},"is_reserved_now":{"type":"boolean","description":"True when a non-cancelled reservation window covers the current time."},"owned_by_me":{"type":"boolean","description":"True when the caller’s customer JWT owns the current session and/or overlapping reservation. Always false when anonymous."},"can_order":{"type":"boolean","description":"Whether the caller may place a walk-in dine-in order for this table (available, or already theirs)."},"status":{"enum":["available","occupied","reserved"],"type":"string"}},"required":["table_id","table_number","is_active","is_occupied","is_reserved_now","owned_by_me","can_order","status"],"title":"DiningTableStatusResponseDto"},"BranchReservationScheduleResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"config_id":{"type":"string","format":"uuid"},"day_of_week":{"enum":["SAT","SUN","MON","TUE","WED","THU","FRI"],"type":"string","example":"MON"},"start_time":{"type":"string","example":"12:00","description":"Start time HH:mm (24h)"},"end_time":{"type":"string","example":"23:00","description":"End time HH:mm (24h)"}},"required":["id","config_id","day_of_week","start_time","end_time"],"title":"BranchReservationScheduleResponseDto"},"BranchReservationConfigResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"is_enabled":{"type":"boolean","example":true},"max_duration_minutes":{"type":"number","example":60,"description":"Maximum reservation duration in minutes"},"buffer_minutes":{"type":"number","example":15,"description":"Buffer between reservations in minutes"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"schedules":{"type":"array","items":{"$ref":"#/components/schemas/BranchReservationScheduleResponseDto"}}},"required":["id","branch_id","is_enabled","max_duration_minutes","buffer_minutes","created_at","updated_at","schedules"],"title":"BranchReservationConfigResponseDto"},"UpsertBranchReservationConfigDto":{"type":"object","properties":{"is_enabled":{"type":"boolean","default":true},"max_duration_minutes":{"type":"number","minimum":1,"default":60,"description":"Maximum reservation duration in minutes"},"buffer_minutes":{"type":"number","minimum":0,"default":15,"description":"Buffer between reservations in minutes"}},"title":"UpsertBranchReservationConfigDto"},"AddReservationScheduleDto":{"type":"object","properties":{"day_of_week":{"enum":["SAT","SUN","MON","TUE","WED","THU","FRI"],"type":"string"},"start_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","example":"12:00","description":"Start time HH:mm (24h)"},"end_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","example":"23:00","description":"End time HH:mm (24h)"}},"required":["day_of_week","start_time","end_time"],"title":"AddReservationScheduleDto"},"ApplyToAllDaysDto":{"type":"object","properties":{"slots":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/AddReservationScheduleDto"}}},"required":["slots"],"title":"ApplyToAllDaysDto"},"CartItemOptionInputDto":{"type":"object","properties":{"option_group_id":{"type":"string","format":"uuid"},"option_value_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":1,"default":1},"price_delta":{"type":"number"},"snapshot":{"type":"object","additionalProperties":{}}},"required":["option_group_id","option_value_id","price_delta"],"title":"CartItemOptionInputDto"},"CartItemInputDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"variant_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0,"description":"Supports fractional quantities (e.g. 1.5) for weight/volume products."},"unit_price":{"type":"number","minimum":0},"snapshot":{"type":"object","additionalProperties":{}},"is_free":{"type":"boolean"},"options":{"type":"array","items":{"$ref":"#/components/schemas/CartItemOptionInputDto"}}},"required":["product_id","quantity","unit_price","snapshot"],"title":"CartItemInputDto"},"CreateCartDto":{"type":"object","properties":{"channel_id":{"type":"string","format":"uuid","description":"Ordering channel this cart belongs to, used to resolve channel-scoped price overrides."},"currency":{"type":"string","description":"ISO currency code","default":"SAR"},"metadata":{"type":"object","additionalProperties":{}},"tax_amount":{"type":"number","minimum":0,"default":0,"deprecated":true,"description":"Ignored: VAT is inside the catalog prices and derived at checkout."},"discount_amount":{"type":"number","minimum":0,"default":0,"deprecated":true,"description":"Ignored: the only customer discount is a promo code, applied at checkout."},"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItemInputDto"}}},"title":"CreateCartDto"},"CartItemOptionResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"cart_item_id":{"type":"string","format":"uuid"},"option_group_id":{"type":"string","format":"uuid"},"option_value_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":1},"price_delta":{"type":"string","description":"Price delta per unit (Decimal serialized as string)"},"snapshot":{"type":"object","additionalProperties":{},"nullable":true}},"required":["id","cart_item_id","option_group_id","option_value_id","quantity","price_delta"],"title":"CartItemOptionResponseDto"},"CartItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"cart_id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"variant_id":{"type":"string","nullable":true,"format":"uuid"},"quantity":{"type":"number","minimum":1},"unit_price":{"type":"string","description":"Price per unit (Decimal serialized as string)"},"total_price":{"type":"string","description":"unitPrice × quantity + options total"},"snapshot":{"type":"object","additionalProperties":{}},"is_free":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"cart_item_options":{"type":"array","items":{"$ref":"#/components/schemas/CartItemOptionResponseDto"}}},"required":["id","cart_id","product_id","quantity","unit_price","total_price","snapshot","is_free","created_at","updated_at","cart_item_options"],"title":"CartItemResponseDto"},"CartResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"018e7c3a-6f2b-7000-a1b2-c3d4e5f60001"},"token":{"type":"string","description":"Opaque cart token for unauthenticated reads"},"branch_id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"metadata":{"type":"object","additionalProperties":{},"nullable":true},"subtotal":{"type":"string","example":"79.00","description":"Items subtotal before tax/discount (Decimal as string)"},"tax_amount":{"type":"string","example":"11.85","description":"Tax amount (Decimal as string)"},"discount_amount":{"type":"string","example":"0.00","description":"Discount amount (Decimal as string)"},"total_amount":{"type":"string","example":"90.85","description":"subtotal − discountAmount, minimum 0. Prices are gross, so taxAmount is inside it, never added."},"status":{"type":"string","example":"active","description":"Cart lifecycle status (active | checked_out | expired)"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"cart_items":{"type":"array","items":{"$ref":"#/components/schemas/CartItemResponseDto"}}},"required":["id","token","branch_id","customer_id","currency","subtotal","tax_amount","discount_amount","total_amount","status","created_at","updated_at","cart_items"],"title":"CartResponseDto"},"UpdateCartDto":{"type":"object","properties":{"channel_id":{"type":"string","format":"uuid","description":"Ordering channel this cart belongs to, used to resolve channel-scoped price overrides."},"currency":{"type":"string","description":"ISO currency code","default":"SAR"},"metadata":{"type":"object","additionalProperties":{}},"tax_amount":{"type":"number","minimum":0,"default":0,"deprecated":true,"description":"Ignored: VAT is inside the catalog prices and derived at checkout."},"discount_amount":{"type":"number","minimum":0,"default":0,"deprecated":true,"description":"Ignored: the only customer discount is a promo code, applied at checkout."},"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItemInputDto"}}},"title":"UpdateCartDto"},"DeleteCartResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","example":true}},"required":["deleted"],"title":"DeleteCartResponseDto"},"InventoryLocationDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"type":{"enum":["MAIN_WAREHOUSE","BRANCH_STORE"],"type":"string","example":"MAIN_WAREHOUSE"},"name":{"type":"string","example":"Main Warehouse"},"name_ar":{"type":"string","nullable":true,"example":"المستودع الرئيسي"},"is_default":{"type":"boolean","example":true},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","branch_id","type","name","name_ar","is_default","is_active","created_at","updated_at"],"title":"InventoryLocationDto"},"InventoryLocationListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryLocationDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"InventoryLocationListDto"},"CreateInventoryLocationDto":{"type":"object","properties":{"branch_id":{"type":"string","nullable":true,"format":"uuid"},"type":{"enum":["MAIN_WAREHOUSE","BRANCH_STORE"],"type":"string"},"name":{"type":"string","maxLength":100},"name_ar":{"type":"string","maxLength":100},"is_default":{"type":"boolean","default":false}},"required":["type","name"],"title":"CreateInventoryLocationDto"},"UpdateInventoryLocationDto":{"type":"object","properties":{"branch_id":{"type":"string","nullable":true,"format":"uuid"},"type":{"enum":["MAIN_WAREHOUSE","BRANCH_STORE"],"type":"string"},"name":{"type":"string","maxLength":100},"name_ar":{"type":"string","maxLength":100},"is_default":{"type":"boolean","default":false},"is_active":{"type":"boolean"}},"title":"UpdateInventoryLocationDto"},"StockCategoryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"parent_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","example":"Beverages"},"name_ar":{"type":"string","nullable":true,"example":"مشروبات"},"sort_order":{"type":"number","example":0},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/StockCategoryDto"}}},"required":["id","restaurant_id","parent_id","name","name_ar","sort_order","is_active","created_at","updated_at"],"title":"StockCategoryDto"},"CreateStockCategoryDto":{"type":"object","properties":{"parent_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","maxLength":100},"name_ar":{"type":"string","maxLength":100},"sort_order":{"type":"number","default":0}},"required":["name"],"title":"CreateStockCategoryDto"},"UpdateStockCategoryDto":{"type":"object","properties":{"parent_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","maxLength":100},"name_ar":{"type":"string","maxLength":100},"sort_order":{"type":"number","default":0},"is_active":{"type":"boolean"}},"title":"UpdateStockCategoryDto"},"UnitDimension":{"type":"string","enum":["MASS","VOLUME","LENGTH","COUNT"],"description":"What the unit measures; null while unclassified","title":"UnitDimension"},"UnitOfMeasureDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","nullable":true,"format":"uuid","description":"Null for a system unit"},"name":{"type":"string","example":"Kilogram"},"name_ar":{"type":"string","nullable":true,"example":"كيلوغرام"},"symbol":{"type":"string","example":"kg"},"dimension":{"nullable":true,"description":"What the unit measures; null while unclassified","allOf":[{"$ref":"#/components/schemas/UnitDimension"}]},"factor_to_base":{"type":"number","nullable":true,"example":1000,"description":"How many base units (g, ml, mm, piece) one of this unit is"},"is_system":{"type":"boolean","description":"A system unit every business can use and none can change"},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","symbol","dimension","factor_to_base","is_system","is_active","created_at","updated_at"],"title":"UnitOfMeasureDto"},"StockItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"category_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","example":"Tomato"},"name_ar":{"type":"string","nullable":true,"example":"طماطم"},"type":{"enum":["RAW_MATERIAL","SEMI_FINISHED","FINISHED_GOOD","CONSUMABLE","PACKAGING"],"type":"string","example":"RAW_MATERIAL"},"storage_unit_id":{"type":"string","format":"uuid","description":"ID of the storage UnitOfMeasure"},"recipe_unit_id":{"type":"string","format":"uuid","description":"ID of the recipe UnitOfMeasure"},"conversion_factor":{"type":"number","example":1000,"description":"How many recipe units fit in one storage unit"},"sku":{"type":"string","nullable":true,"example":"TOM-001"},"barcode":{"type":"string","nullable":true,"example":"1234567890"},"cost_price":{"type":"number","nullable":true,"example":5.5},"average_cost":{"type":"number","nullable":true,"example":5.25},"costing_method":{"nullable":true,"enum":["WAC","FIFO","FEFO"],"type":"string","example":"WAC"},"reorder_point":{"type":"number","nullable":true,"example":10},"reorder_qty":{"type":"number","nullable":true,"example":20},"allow_negative_stock":{"type":"boolean","example":false},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"storage_unit":{"description":"Present when `expand=storageUnit` is requested","allOf":[{"$ref":"#/components/schemas/UnitOfMeasureDto"}]},"recipe_unit":{"description":"Present when `expand=recipeUnit` is requested","allOf":[{"$ref":"#/components/schemas/UnitOfMeasureDto"}]},"category":{"description":"Present when `expand=category` is requested","allOf":[{"$ref":"#/components/schemas/StockCategoryDto"}]}},"required":["id","restaurant_id","category_id","name","name_ar","type","storage_unit_id","recipe_unit_id","conversion_factor","sku","barcode","cost_price","average_cost","costing_method","reorder_point","reorder_qty","allow_negative_stock","is_active","created_at","updated_at"],"title":"StockItemDto"},"StockItemListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockItemDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"StockItemListDto"},"CreateStockItemDto":{"type":"object","properties":{"category_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","maxLength":150},"name_ar":{"type":"string","maxLength":150},"type":{"enum":["RAW_MATERIAL","SEMI_FINISHED","FINISHED_GOOD","CONSUMABLE","PACKAGING"],"type":"string"},"storage_unit_id":{"type":"string","format":"uuid","description":"Storage UnitOfMeasure ID"},"recipe_unit_id":{"type":"string","format":"uuid","description":"Recipe UnitOfMeasure ID"},"conversion_factor":{"type":"number","minimum":0.0001,"default":1,"description":"How many recipe units = 1 storage unit"},"sku":{"type":"string","maxLength":100},"barcode":{"type":"string","maxLength":100},"cost_price":{"type":"number","minimum":0},"costing_method":{"enum":["WAC","FIFO","FEFO"],"type":"string"},"reorder_point":{"type":"number","minimum":0},"reorder_qty":{"type":"number","minimum":0},"allow_negative_stock":{"type":"boolean","default":true}},"required":["name","type","storage_unit_id","recipe_unit_id"],"title":"CreateStockItemDto"},"UpdateStockItemDto":{"type":"object","properties":{"category_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","maxLength":150},"name_ar":{"type":"string","maxLength":150},"type":{"enum":["RAW_MATERIAL","SEMI_FINISHED","FINISHED_GOOD","CONSUMABLE","PACKAGING"],"type":"string"},"storage_unit_id":{"type":"string","format":"uuid","description":"Storage UnitOfMeasure ID"},"recipe_unit_id":{"type":"string","format":"uuid","description":"Recipe UnitOfMeasure ID"},"conversion_factor":{"type":"number","minimum":0.0001,"default":1,"description":"How many recipe units = 1 storage unit"},"sku":{"type":"string","maxLength":100},"barcode":{"type":"string","maxLength":100},"cost_price":{"type":"number","minimum":0},"costing_method":{"enum":["WAC","FIFO","FEFO"],"type":"string"},"reorder_point":{"type":"number","minimum":0},"reorder_qty":{"type":"number","minimum":0},"allow_negative_stock":{"type":"boolean","default":true},"is_active":{"type":"boolean"}},"title":"UpdateStockItemDto"},"RecipeIngredientDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"recipe_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":0.5,"description":"Quantity in the stock item's recipe unit"},"wastage_percent":{"type":"number","example":5},"sort_order":{"type":"number","example":0},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","recipe_id","stock_item_id","quantity","wastage_percent","sort_order","created_at","updated_at"],"title":"RecipeIngredientDto"},"RecipeCostDto":{"type":"object","properties":{"total_cost":{"type":"number","example":12.5},"cost_per_unit":{"type":"number","example":12.5},"has_incomplete_data":{"type":"boolean","example":false}},"required":["total_cost","cost_per_unit","has_incomplete_data"],"title":"RecipeCostDto"},"RecipeDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"type":{"enum":["PRODUCTION","SALES"],"type":"string","example":"PRODUCT"},"product_id":{"type":"string","nullable":true,"format":"uuid"},"variant_id":{"type":"string","nullable":true,"format":"uuid"},"output_stock_item_id":{"type":"string","nullable":true,"format":"uuid"},"yield_qty":{"type":"number","example":1},"yield_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"ID of the yield UnitOfMeasure"},"notes":{"type":"string","nullable":true},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ingredients":{"type":"array","items":{"$ref":"#/components/schemas/RecipeIngredientDto"}},"computed_cost":{"$ref":"#/components/schemas/RecipeCostDto"}},"required":["id","restaurant_id","type","product_id","variant_id","output_stock_item_id","yield_qty","yield_unit_id","notes","is_active","created_at","updated_at","ingredients","computed_cost"],"title":"RecipeDto"},"RecipeListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RecipeDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"RecipeListDto"},"CreateRecipeDto":{"type":"object","properties":{"type":{"enum":["SALES","PRODUCTION"],"type":"string"},"product_id":{"type":"string","nullable":true,"format":"uuid"},"variant_id":{"type":"string","nullable":true,"format":"uuid"},"output_stock_item_id":{"type":"string","nullable":true,"format":"uuid"},"yield_qty":{"type":"number","minimum":0.0001,"default":1},"yield_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"Yield UnitOfMeasure ID"},"notes":{"type":"string","maxLength":500}},"required":["type"],"title":"CreateRecipeDto"},"CostPreviewDto":{"type":"object","properties":{"base_cost":{"type":"number","example":12.5},"total_cost":{"type":"number","example":14},"has_incomplete_data":{"type":"boolean","example":false}},"required":["base_cost","total_cost","has_incomplete_data"],"title":"CostPreviewDto"},"UpdateRecipeDto":{"type":"object","properties":{"type":{"enum":["SALES","PRODUCTION"],"type":"string"},"product_id":{"type":"string","nullable":true,"format":"uuid"},"variant_id":{"type":"string","nullable":true,"format":"uuid"},"output_stock_item_id":{"type":"string","nullable":true,"format":"uuid"},"yield_qty":{"type":"number","minimum":0.0001,"default":1},"yield_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"Yield UnitOfMeasure ID"},"notes":{"type":"string","maxLength":500},"is_active":{"type":"boolean"}},"title":"UpdateRecipeDto"},"CreateRecipeIngredientDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0.0001,"description":"Quantity in the stock item's recipe unit"},"wastage_percent":{"type":"number","minimum":0,"maximum":100,"default":0},"sort_order":{"type":"number","default":0}},"required":["stock_item_id","quantity"],"title":"CreateRecipeIngredientDto"},"UpdateRecipeIngredientDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0.0001,"description":"Quantity in the stock item's recipe unit"},"wastage_percent":{"type":"number","minimum":0,"maximum":100,"default":0},"sort_order":{"type":"number","default":0}},"title":"UpdateRecipeIngredientDto"},"OptionValueSummaryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"option_group_id":{"type":"string","format":"uuid"}},"required":["id","name","name_ar","option_group_id"],"title":"OptionValueSummaryDto"},"OptionValueRecipeEffectDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"option_value_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"effect_type":{"enum":["ADD","REMOVE_ALL","REMOVE_QTY","REMOVE_PERCENT"],"type":"string","example":"ADD"},"quantity":{"type":"number","example":0.1,"description":"Quantity in the affected stock item's recipe unit"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/StockItemDto"}]},"option_value":{"description":"Present when `expand=option_value` is requested","allOf":[{"$ref":"#/components/schemas/OptionValueSummaryDto"}]}},"required":["id","option_value_id","stock_item_id","effect_type","quantity","created_at","updated_at"],"title":"OptionValueRecipeEffectDto"},"CreateOptionValueRecipeEffectDto":{"type":"object","properties":{"option_value_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"effect_type":{"enum":["ADD","REMOVE_ALL","REMOVE_QTY","REMOVE_PERCENT"],"type":"string"},"quantity":{"type":"number","minimum":0,"description":"Quantity in the affected stock item's recipe unit"}},"required":["option_value_id","stock_item_id","effect_type","quantity"],"title":"CreateOptionValueRecipeEffectDto"},"UpdateOptionValueRecipeEffectDto":{"type":"object","properties":{"option_value_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"effect_type":{"enum":["ADD","REMOVE_ALL","REMOVE_QTY","REMOVE_PERCENT"],"type":"string"},"quantity":{"type":"number","minimum":0,"description":"Quantity in the affected stock item's recipe unit"}},"title":"UpdateOptionValueRecipeEffectDto"},"SupplierDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Fresh Farms Co."},"name_ar":{"type":"string","nullable":true,"example":"شركة المزارع الطازجة"},"code":{"type":"string","nullable":true,"example":"SUP-001"},"contact_name":{"type":"string","nullable":true,"example":"Ahmed Al-Rashid"},"phone":{"type":"string","nullable":true,"example":"+966501234567"},"email":{"type":"string","nullable":true,"example":"info@freshfarms.com"},"website":{"type":"string","nullable":true,"example":"https://freshfarms.com"},"address":{"type":"string","nullable":true,"example":"Riyadh, Saudi Arabia"},"address_ar":{"type":"string","nullable":true,"example":"الرياض، المملكة العربية السعودية"},"tax_number":{"type":"string","nullable":true,"example":"300012345600003"},"payment_terms":{"type":"string","nullable":true,"example":"Net 30"},"notes":{"type":"string","nullable":true},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","code","contact_name","phone","email","website","address","address_ar","tax_number","payment_terms","notes","is_active","created_at","updated_at"],"title":"SupplierDto"},"SupplierListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SupplierDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"SupplierListDto"},"CreateSupplierDto":{"type":"object","properties":{"name":{"type":"string","maxLength":150},"name_ar":{"type":"string","maxLength":150},"code":{"type":"string","maxLength":50,"description":"Internal or external supplier reference code"},"contact_name":{"type":"string","maxLength":100},"phone":{"type":"string","maxLength":50},"email":{"type":"string","maxLength":150,"format":"email"},"website":{"type":"string","maxLength":200},"address":{"type":"string","maxLength":300},"address_ar":{"type":"string","maxLength":300},"tax_number":{"type":"string","maxLength":50},"payment_terms":{"type":"string","maxLength":100},"notes":{"type":"string","maxLength":500}},"required":["name"],"title":"CreateSupplierDto"},"UpdateSupplierDto":{"type":"object","properties":{"name":{"type":"string","maxLength":150},"name_ar":{"type":"string","maxLength":150},"code":{"type":"string","maxLength":50,"description":"Internal or external supplier reference code"},"contact_name":{"type":"string","maxLength":100},"phone":{"type":"string","maxLength":50},"email":{"type":"string","maxLength":150,"format":"email"},"website":{"type":"string","maxLength":200},"address":{"type":"string","maxLength":300},"address_ar":{"type":"string","maxLength":300},"tax_number":{"type":"string","maxLength":50},"payment_terms":{"type":"string","maxLength":100},"notes":{"type":"string","maxLength":500},"is_active":{"type":"boolean"}},"title":"UpdateSupplierDto"},"SupplierItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"supplier_sku":{"type":"string","nullable":true,"example":"TOM-SUP-001"},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"current_unit_cost":{"type":"number","example":5.5},"is_preferred":{"type":"boolean","example":true},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","supplier_id","stock_item_id","restaurant_id","supplier_sku","unit_id","current_unit_cost","is_preferred","is_active","created_at","updated_at"],"title":"SupplierItemDto"},"CreateSupplierItemDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"supplier_sku":{"type":"string","maxLength":100},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"current_unit_cost":{"type":"number","minimum":0},"is_preferred":{"type":"boolean","default":false}},"required":["stock_item_id","unit_id","current_unit_cost"],"title":"CreateSupplierItemDto"},"UpdateSupplierItemDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"supplier_sku":{"type":"string","maxLength":100},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"current_unit_cost":{"type":"number","minimum":0},"is_preferred":{"type":"boolean","default":false},"is_active":{"type":"boolean"}},"title":"UpdateSupplierItemDto"},"SupplierItemPriceHistoryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"supplier_item_id":{"type":"string","format":"uuid"},"unit_cost":{"type":"number","example":5.5},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"effective_date":{"format":"date-time","type":"string"},"notes":{"type":"string","nullable":true},"source":{"type":"string","example":"PURCHASE"},"purchase_id":{"type":"string","nullable":true,"format":"uuid"},"recorded_by_id":{"type":"string","nullable":true,"format":"uuid"},"created_at":{"format":"date-time","type":"string"}},"required":["id","supplier_item_id","unit_cost","unit_id","effective_date","notes","source","purchase_id","recorded_by_id","created_at"],"title":"SupplierItemPriceHistoryDto"},"StockPurchaseUnitDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"symbol":{"type":"string","example":"kg"}},"required":["id","name","name_ar","symbol"],"title":"StockPurchaseUnitDto"},"StockPurchaseStockItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"storage_unit_id":{"type":"string","format":"uuid"},"recipe_unit_id":{"type":"string","format":"uuid"},"storage_unit":{"$ref":"#/components/schemas/StockPurchaseUnitDto"},"recipe_unit":{"$ref":"#/components/schemas/StockPurchaseUnitDto"}},"required":["id","name","name_ar","storage_unit_id","recipe_unit_id","storage_unit","recipe_unit"],"title":"StockPurchaseStockItemDto"},"StockPurchaseItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"purchase_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":10,"description":"Ordered quantity"},"received_quantity":{"type":"number","nullable":true,"example":8,"description":"Quantity actually delivered, set on receive. Null means the line was delivered in full."},"unit_cost":{"type":"number","example":5.5},"total_cost":{"type":"number","example":55,"description":"Payable line total: effective quantity x unit cost"},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"expiry_date":{"type":"string","nullable":true,"format":"date-time"},"batch_number":{"type":"string","nullable":true,"example":"BATCH-2024-001"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/StockPurchaseStockItemDto"}]}},"required":["id","purchase_id","stock_item_id","quantity","received_quantity","unit_cost","total_cost","unit_id","expiry_date","batch_number","created_at","updated_at"],"title":"StockPurchaseItemDto"},"StockPurchaseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"location_id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","nullable":true,"format":"uuid"},"supplier_name":{"type":"string","nullable":true,"example":"Fresh Farms Co."},"invoice_number":{"type":"string","nullable":true,"example":"INV-2024-001"},"mode":{"enum":["DIRECT","PO"],"type":"string","example":"DIRECT"},"status":{"enum":["DRAFT","SUBMITTED","CONFIRMED","RECEIVED","POSTED","VOIDED","CANCELLED"],"type":"string","example":"DRAFT"},"purchase_date":{"format":"date-time","type":"string"},"expected_date":{"type":"string","nullable":true,"format":"date-time"},"total_amount":{"type":"number","example":550},"notes":{"type":"string","nullable":true},"sent_at":{"type":"string","nullable":true,"format":"date-time"},"confirmed_at":{"type":"string","nullable":true,"format":"date-time"},"received_at":{"type":"string","nullable":true,"format":"date-time"},"received_by_id":{"type":"string","nullable":true,"format":"uuid"},"posted_at":{"type":"string","nullable":true,"format":"date-time"},"posted_by_id":{"type":"string","nullable":true,"format":"uuid"},"voided_at":{"type":"string","nullable":true,"format":"date-time"},"voided_by_id":{"type":"string","nullable":true,"format":"uuid"},"cancelled_at":{"type":"string","nullable":true,"format":"date-time"},"cancelled_by_id":{"type":"string","nullable":true,"format":"uuid"},"created_by_id":{"type":"string","nullable":true,"format":"uuid"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockPurchaseItemDto"}},"supplier":{"description":"Present when `expand=supplier` is requested","allOf":[{"$ref":"#/components/schemas/SupplierDto"}]},"location":{"description":"Present when `expand=location` is requested","allOf":[{"$ref":"#/components/schemas/InventoryLocationDto"}]}},"required":["id","restaurant_id","location_id","supplier_id","supplier_name","invoice_number","mode","status","purchase_date","expected_date","total_amount","notes","sent_at","confirmed_at","received_at","received_by_id","posted_at","posted_by_id","voided_at","voided_by_id","cancelled_at","cancelled_by_id","created_by_id","created_at","updated_at","items"],"title":"StockPurchaseDto"},"StockPurchaseListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockPurchaseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"StockPurchaseListDto"},"CreateStockPurchaseItemDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0.0001},"unit_cost":{"type":"number","minimum":0},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID. Defaults to the stock item's storage unit. Must be either the item's storage unit or its recipe unit."},"expiry_date":{"type":"string"},"batch_number":{"type":"string","maxLength":100}},"required":["stock_item_id","quantity","unit_cost"],"title":"CreateStockPurchaseItemDto"},"CreateStockPurchaseDto":{"type":"object","properties":{"location_id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","nullable":true,"format":"uuid"},"supplier_name":{"type":"string","maxLength":150},"invoice_number":{"type":"string","maxLength":100},"mode":{"enum":["DIRECT","PO"],"type":"string","default":"DIRECT"},"purchase_date":{"type":"string"},"expected_date":{"type":"string"},"notes":{"type":"string","maxLength":500},"items":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CreateStockPurchaseItemDto"}}},"required":["location_id","items"],"title":"CreateStockPurchaseDto"},"UpdateStockPurchaseDto":{"type":"object","properties":{"location_id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","nullable":true,"format":"uuid"},"supplier_name":{"type":"string","maxLength":150},"invoice_number":{"type":"string","maxLength":100},"mode":{"enum":["DIRECT","PO"],"type":"string","default":"DIRECT"},"purchase_date":{"type":"string"},"expected_date":{"type":"string"},"notes":{"type":"string","maxLength":500},"items":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CreateStockPurchaseItemDto"}}},"title":"UpdateStockPurchaseDto"},"ReceiveStockPurchaseItemDto":{"type":"object","properties":{"item_id":{"type":"string","format":"uuid","description":"StockPurchaseItem ID"},"received_quantity":{"type":"number","minimum":0,"description":"Quantity actually delivered, in the line unit"}},"required":["item_id","received_quantity"],"title":"ReceiveStockPurchaseItemDto"},"ReceiveStockPurchaseDto":{"type":"object","properties":{"items":{"description":"Per-line delivered quantities. Omit to receive every line in full. Lines left out of a supplied array are also received in full.","type":"array","items":{"$ref":"#/components/schemas/ReceiveStockPurchaseItemDto"}}},"title":"ReceiveStockPurchaseDto"},"CreateAdjustmentDto":{"type":"object","properties":{"location_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"qty":{"type":"number","minimum":0.0001},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"type":{"enum":["ADD","REMOVE"],"type":"string"},"notes":{"type":"string","maxLength":500}},"required":["location_id","stock_item_id","qty","unit_id","type"],"title":"CreateAdjustmentDto"},"StockMovementStockItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true}},"required":["id","name","name_ar","sku"],"title":"StockMovementStockItemDto"},"StockMovementUnitDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"symbol":{"type":"string","example":"kg"}},"required":["id","name","symbol"],"title":"StockMovementUnitDto"},"StockMovementLocationDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"StockMovementLocationDto"},"StockMovementDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"location_id":{"type":"string","format":"uuid"},"type":{"enum":["SALE","PURCHASE","PURCHASE_VOID","SALE_RETURN","TRANSFER_IN","TRANSFER_OUT","TRANSFER_LOSS","PRODUCTION_CONSUME","PRODUCTION_OUTPUT","ADJUSTMENT_ADD","ADJUSTMENT_REMOVE","WASTAGE","COUNT_ADJUSTMENT","OPENING_BALANCE"],"type":"string","example":"PURCHASE"},"qty":{"type":"number","example":10},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"unit_cost":{"type":"number","nullable":true,"example":5.5},"total_cost":{"type":"number","nullable":true,"example":55},"balance_after":{"type":"number","example":60},"reference_type":{"type":"string","nullable":true,"example":"purchase"},"reference_id":{"type":"string","nullable":true,"format":"uuid"},"notes":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/StockMovementStockItemDto"}]},"unit":{"description":"Present when `expand=unit` is requested","allOf":[{"$ref":"#/components/schemas/StockMovementUnitDto"}]},"location":{"description":"Present when `expand=location` is requested","allOf":[{"$ref":"#/components/schemas/StockMovementLocationDto"}]}},"required":["id","stock_item_id","location_id","type","qty","unit_id","unit_cost","total_cost","balance_after","reference_type","reference_id","notes","created_at"],"title":"StockMovementDto"},"StockLevelDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"stock_item_name":{"type":"string","example":"Tomato"},"stock_item_name_ar":{"type":"string","nullable":true,"example":"طماطم"},"storage_unit_id":{"type":"string","format":"uuid","description":"ID of the storage UnitOfMeasure"},"storage_unit_symbol":{"type":"string","example":"kg","description":"Symbol of the storage UnitOfMeasure"},"location_id":{"type":"string","format":"uuid"},"location_name":{"type":"string","example":"Main Warehouse"},"quantity":{"type":"number","example":50},"reorder_point":{"type":"number","nullable":true,"example":10},"is_below_reorder_point":{"type":"boolean","example":false},"average_cost":{"type":"number","nullable":true,"example":5.25}},"required":["stock_item_id","stock_item_name","stock_item_name_ar","storage_unit_id","storage_unit_symbol","location_id","location_name","quantity","reorder_point","is_below_reorder_point","average_cost"],"title":"StockLevelDto"},"StockLevelListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockLevelDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"StockLevelListDto"},"StockValuationDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"stock_item_name":{"type":"string","example":"Tomato"},"location_id":{"type":"string","format":"uuid"},"location_name":{"type":"string","example":"Main Warehouse"},"quantity":{"type":"number","example":50},"storage_unit_id":{"type":"string","format":"uuid","description":"ID of the storage UnitOfMeasure"},"average_cost":{"type":"number","nullable":true,"example":5.25},"total_value":{"type":"number","example":262.5}},"required":["stock_item_id","stock_item_name","location_id","location_name","quantity","storage_unit_id","average_cost","total_value"],"title":"StockValuationDto"},"StockMovementListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockMovementDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"StockMovementListDto"},"WastageSummaryRowDto":{"type":"object","properties":{"wastage_entry_id":{"type":"string","format":"uuid"},"location_id":{"type":"string","format":"uuid"},"location_name":{"type":"string","example":"Main Warehouse"},"status":{"type":"string","example":"POSTED"},"posted_at":{"type":"string","nullable":true,"format":"date-time"},"total_cost":{"type":"number","nullable":true,"example":25.5},"item_count":{"type":"number","example":3},"created_at":{"format":"date-time","type":"string"}},"required":["wastage_entry_id","location_id","location_name","status","posted_at","total_cost","item_count","created_at"],"title":"WastageSummaryRowDto"},"WastageSummaryListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WastageSummaryRowDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"WastageSummaryListDto"},"OversoldLineRowDto":{"type":"object","properties":{"reservation_id":{"type":"string","format":"uuid"},"order_id":{"type":"string","format":"uuid"},"order_serial_number":{"type":"number","nullable":true,"example":1042},"order_status":{"type":"string","example":"COMPLETED"},"product_id":{"type":"string","format":"uuid"},"product_name":{"type":"string","example":"Chocolate Cake"},"variant_id":{"type":"string","nullable":true,"format":"uuid"},"variant_name":{"type":"string","nullable":true,"example":"Slice"},"stock_item_id":{"type":"string","format":"uuid"},"stock_item_name":{"type":"string","example":"Cake"},"location_id":{"type":"string","format":"uuid"},"location_name":{"type":"string","example":"Main Store"},"quantity":{"type":"number","example":2,"description":"In the stock item's storage unit"},"approved_by_id":{"type":"string","nullable":true,"format":"uuid","description":"Null when no one approved it (record mode)"},"approved_by_name":{"type":"string","nullable":true,"example":"Sara"},"created_at":{"format":"date-time","type":"string"}},"required":["reservation_id","order_id","order_serial_number","order_status","product_id","product_name","variant_id","variant_name","stock_item_id","stock_item_name","location_id","location_name","quantity","approved_by_id","approved_by_name","created_at"],"title":"OversoldLineRowDto"},"OversoldLineListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OversoldLineRowDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"OversoldLineListDto"},"LowStockDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"stock_item_name":{"type":"string","example":"Tomato"},"stock_item_name_ar":{"type":"string","nullable":true,"example":"طماطم"},"sku":{"type":"string","nullable":true,"example":"TOM-001"},"location_id":{"type":"string","format":"uuid"},"location_name":{"type":"string","example":"Main Warehouse"},"current_qty":{"type":"number","example":5},"storage_unit_id":{"type":"string","format":"uuid","description":"ID of the storage UnitOfMeasure"},"reorder_point":{"type":"number","example":10},"reorder_qty":{"type":"number","nullable":true,"example":20},"average_cost":{"type":"number","nullable":true,"example":5.25},"preferred_supplier_id":{"type":"string","nullable":true,"format":"uuid"},"preferred_supplier_name":{"type":"string","nullable":true,"example":"Fresh Farms Co."},"estimated_reorder_cost":{"type":"number","nullable":true,"example":105}},"required":["stock_item_id","stock_item_name","stock_item_name_ar","sku","location_id","location_name","current_qty","storage_unit_id","reorder_point","reorder_qty","average_cost","preferred_supplier_id","preferred_supplier_name","estimated_reorder_cost"],"title":"LowStockDto"},"PurchaseSummaryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"supplier_name":{"type":"string","nullable":true,"example":"Fresh Farms Co."},"supplier_name_ar":{"type":"string","nullable":true,"example":"مزارع طازجة"},"invoice_number":{"type":"string","nullable":true,"example":"INV-2024-001"},"mode":{"type":"string","example":"DIRECT"},"status":{"type":"string","example":"POSTED"},"purchase_date":{"format":"date-time","type":"string"},"total_amount":{"type":"number","example":550},"item_count":{"type":"number","example":5},"location_id":{"type":"string","format":"uuid"},"location_name":{"type":"string","example":"Main Warehouse"},"posted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"}},"required":["id","supplier_name","supplier_name_ar","invoice_number","mode","status","purchase_date","total_amount","item_count","location_id","location_name","posted_at","created_at"],"title":"PurchaseSummaryDto"},"PurchaseSummaryListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseSummaryDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"PurchaseSummaryListDto"},"ProfitabilitySummaryDto":{"type":"object","properties":{"revenue":{"type":"number"},"actual_cogs":{"type":"number"},"theoretical_cogs":{"type":"number"},"gross_profit":{"type":"number"},"gross_margin_pct":{"type":"number"},"units_sold":{"type":"number"},"orders_count":{"type":"number"},"has_incomplete_costing":{"type":"boolean"}},"required":["revenue","actual_cogs","theoretical_cogs","gross_profit","gross_margin_pct","units_sold","orders_count","has_incomplete_costing"],"title":"ProfitabilitySummaryDto"},"ProductProfitabilityRowDto":{"type":"object","properties":{"product_id":{"type":"string"},"product_name":{"type":"string"},"product_name_ar":{"type":"string","nullable":true},"units_sold":{"type":"number"},"revenue":{"type":"number"},"theoretical_cogs":{"type":"number"},"gross_profit":{"type":"number"},"gross_margin_pct":{"type":"number"},"has_incomplete_costing":{"type":"boolean"}},"required":["product_id","product_name","product_name_ar","units_sold","revenue","theoretical_cogs","gross_profit","gross_margin_pct","has_incomplete_costing"],"title":"ProductProfitabilityRowDto"},"DailyProfitabilityRowDto":{"type":"object","properties":{"date":{"type":"string"},"revenue":{"type":"number"},"actual_cogs":{"type":"number"},"gross_profit":{"type":"number"},"orders_count":{"type":"number"}},"required":["date","revenue","actual_cogs","gross_profit","orders_count"],"title":"DailyProfitabilityRowDto"},"ProfitabilityReportDto":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/ProfitabilitySummaryDto"},"by_product":{"type":"array","items":{"$ref":"#/components/schemas/ProductProfitabilityRowDto"}},"by_day":{"type":"array","items":{"$ref":"#/components/schemas/DailyProfitabilityRowDto"}}},"required":["summary","by_product","by_day"],"title":"ProfitabilityReportDto"},"InventorySettingsDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"default_costing_method":{"enum":["WAC","FIFO","FEFO"],"type":"string","example":"WAC"},"allow_negative_stock":{"type":"boolean","example":false},"settings":{"type":"object","additionalProperties":{},"nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","default_costing_method","allow_negative_stock","settings","created_at","updated_at"],"title":"InventorySettingsDto"},"UpsertInventorySettingsDto":{"type":"object","properties":{"default_costing_method":{"enum":["WAC","FIFO","FEFO"],"type":"string"},"allow_negative_stock":{"type":"boolean"},"settings":{"type":"object","additionalProperties":{}}},"title":"UpsertInventorySettingsDto"},"WastageReasonCodeDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"SPOILAGE"},"name":{"type":"string","example":"Spoilage"},"name_ar":{"type":"string","nullable":true,"example":"تلف"},"requires_approval":{"type":"boolean","example":false},"is_active":{"type":"boolean","example":true},"sort_order":{"type":"number","example":0},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","code","name","name_ar","requires_approval","is_active","sort_order","created_at","updated_at"],"title":"WastageReasonCodeDto"},"CreateWastageReasonCodeDto":{"type":"object","properties":{"code":{"type":"string","maxLength":50},"name":{"type":"string","maxLength":100},"name_ar":{"type":"string","maxLength":100},"requires_approval":{"type":"boolean","default":false},"sort_order":{"type":"number","default":0}},"required":["code","name"],"title":"CreateWastageReasonCodeDto"},"UpdateWastageReasonCodeDto":{"type":"object","properties":{"code":{"type":"string","maxLength":50},"name":{"type":"string","maxLength":100},"name_ar":{"type":"string","maxLength":100},"requires_approval":{"type":"boolean","default":false},"sort_order":{"type":"number","default":0},"is_active":{"type":"boolean"}},"title":"UpdateWastageReasonCodeDto"},"WastageItemStockItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"WastageItemStockItemDto"},"WastageItemReasonCodeDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"EXPIRED"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","code","name","name_ar"],"title":"WastageItemReasonCodeDto"},"WastageItemUnitDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"symbol":{"type":"string","example":"kg"}},"required":["id","name","name_ar","symbol"],"title":"WastageItemUnitDto"},"WastageEntryItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"wastage_entry_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"reason_code_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":2},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"unit_cost":{"type":"number","nullable":true,"example":5.5},"total_cost":{"type":"number","nullable":true,"example":11},"notes":{"type":"string","nullable":true},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/WastageItemStockItemDto"}]},"reason_code":{"description":"Present when `expand=reason_code` is requested","allOf":[{"$ref":"#/components/schemas/WastageItemReasonCodeDto"}]},"unit":{"description":"Present when `expand=unit` is requested","allOf":[{"$ref":"#/components/schemas/WastageItemUnitDto"}]}},"required":["id","wastage_entry_id","stock_item_id","reason_code_id","quantity","unit_id","unit_cost","total_cost","notes"],"title":"WastageEntryItemDto"},"WastageEntryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"location_id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"DRAFT"},"description":{"type":"string","nullable":true},"source_order_id":{"type":"string","nullable":true,"format":"uuid","description":"Set when auto-created from an order return; the originating order."},"source_order_serial_number":{"type":"number","nullable":true,"description":"User-facing serial number of the source order, for a localized label."},"total_cost":{"type":"number","nullable":true,"example":11},"submitted_by_id":{"type":"string","nullable":true,"format":"uuid"},"approved_by_id":{"type":"string","nullable":true,"format":"uuid"},"submitted_at":{"type":"string","nullable":true,"format":"date-time"},"approved_at":{"type":"string","nullable":true,"format":"date-time"},"posted_at":{"type":"string","nullable":true,"format":"date-time"},"rejected_at":{"type":"string","nullable":true,"format":"date-time"},"rejection_reason":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/WastageEntryItemDto"}},"location":{"description":"Present when `expand=location` is requested","allOf":[{"$ref":"#/components/schemas/InventoryLocationDto"}]}},"required":["id","restaurant_id","location_id","status","description","source_order_id","source_order_serial_number","total_cost","submitted_by_id","approved_by_id","submitted_at","approved_at","posted_at","rejected_at","rejection_reason","notes","created_at","updated_at","items"],"title":"WastageEntryDto"},"WastageEntryListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WastageEntryDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"WastageEntryListDto"},"WastageItemDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"reason_code_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0.0001},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"notes":{"type":"string","maxLength":300}},"required":["stock_item_id","reason_code_id","quantity","unit_id"],"title":"WastageItemDto"},"CreateWastageEntryDto":{"type":"object","properties":{"location_id":{"type":"string","format":"uuid"},"description":{"type":"string","maxLength":500},"notes":{"type":"string","maxLength":500},"items":{"type":"array","items":{"$ref":"#/components/schemas/WastageItemDto"}}},"required":["location_id","items"],"title":"CreateWastageEntryDto"},"UpdateWastageEntryDto":{"type":"object","properties":{"description":{"type":"string","maxLength":500},"notes":{"type":"string","maxLength":500}},"title":"UpdateWastageEntryDto"},"RejectWastageEntryDto":{"type":"object","properties":{"rejection_reason":{"type":"string","maxLength":500}},"required":["rejection_reason"],"title":"RejectWastageEntryDto"},"OrderPostingDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"order_id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"POSTED"},"retry_count":{"type":"number","example":0},"error_message":{"type":"string","nullable":true},"posted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","order_id","restaurant_id","status","retry_count","error_message","posted_at","created_at","updated_at"],"title":"OrderPostingDto"},"OrderPostingListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderPostingDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"OrderPostingListDto"},"StockTransferItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"transfer_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"requested_qty":{"type":"number","example":10},"approved_qty":{"type":"number","nullable":true,"example":10},"shipped_qty":{"type":"number","nullable":true,"example":10},"received_qty":{"type":"number","nullable":true,"example":9.5},"damaged_qty":{"type":"number","example":0},"unit":{"type":"string","example":"KG"},"unit_cost":{"type":"number","nullable":true,"example":5.5},"notes":{"type":"string","nullable":true}},"required":["id","transfer_id","stock_item_id","requested_qty","approved_qty","shipped_qty","received_qty","damaged_qty","unit","unit_cost","notes"],"title":"StockTransferItemResponseDto"},"StockTransferDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"from_location_id":{"type":"string","format":"uuid"},"to_location_id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"DRAFT"},"requested_by_id":{"type":"string","nullable":true,"format":"uuid"},"approved_by_id":{"type":"string","nullable":true,"format":"uuid"},"received_by_id":{"type":"string","nullable":true,"format":"uuid"},"notes":{"type":"string","nullable":true},"requested_at":{"type":"string","nullable":true,"format":"date-time"},"approved_at":{"type":"string","nullable":true,"format":"date-time"},"shipped_at":{"type":"string","nullable":true,"format":"date-time"},"received_at":{"type":"string","nullable":true,"format":"date-time"},"cancelled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockTransferItemResponseDto"}},"from_location":{"description":"Present when `expand=from_location` is requested","allOf":[{"$ref":"#/components/schemas/InventoryLocationDto"}]},"to_location":{"description":"Present when `expand=to_location` is requested","allOf":[{"$ref":"#/components/schemas/InventoryLocationDto"}]}},"required":["id","restaurant_id","from_location_id","to_location_id","status","requested_by_id","approved_by_id","received_by_id","notes","requested_at","approved_at","shipped_at","received_at","cancelled_at","created_at","updated_at","items"],"title":"StockTransferDto"},"StockTransferListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockTransferDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"StockTransferListDto"},"StockTransferItemDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"requested_qty":{"type":"number","minimum":0.0001},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"notes":{"type":"string"}},"required":["stock_item_id","requested_qty","unit_id"],"title":"StockTransferItemDto"},"CreateStockTransferDto":{"type":"object","properties":{"from_location_id":{"type":"string","format":"uuid"},"to_location_id":{"type":"string","format":"uuid"},"notes":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockTransferItemDto"}}},"required":["from_location_id","to_location_id","items"],"title":"CreateStockTransferDto"},"UpdateStockTransferDto":{"type":"object","properties":{"notes":{"type":"string"}},"title":"UpdateStockTransferDto"},"ApproveTransferItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"approved_qty":{"type":"number","minimum":0}},"required":["id","approved_qty"],"title":"ApproveTransferItemDto"},"ApproveStockTransferDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ApproveTransferItemDto"}}},"required":["items"],"title":"ApproveStockTransferDto"},"ReceiveTransferItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"received_qty":{"type":"number","minimum":0},"damaged_qty":{"type":"number","minimum":0}},"required":["id","received_qty"],"title":"ReceiveTransferItemDto"},"ReceiveStockTransferDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReceiveTransferItemDto"}}},"required":["items"],"title":"ReceiveStockTransferDto"},"InventoryCountStockItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"InventoryCountStockItemDto"},"InventoryCountItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"count_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"expected_qty":{"type":"number","example":50},"counted_qty":{"type":"number","nullable":true,"example":48},"variance":{"type":"number","nullable":true,"example":-2},"unit":{"type":"string","example":"KG"},"notes":{"type":"string","nullable":true},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/InventoryCountStockItemDto"}]}},"required":["id","count_id","stock_item_id","expected_qty","counted_qty","variance","unit","notes"],"title":"InventoryCountItemDto"},"InventoryCountDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"location_id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"DRAFT"},"name":{"type":"string","example":"Monthly Count - Jan 2025"},"name_ar":{"type":"string","nullable":true,"example":"الجرد الشهري - يناير 2025"},"counted_by_id":{"type":"string","nullable":true,"format":"uuid"},"approved_by_id":{"type":"string","nullable":true,"format":"uuid"},"started_at":{"type":"string","nullable":true,"format":"date-time"},"submitted_at":{"type":"string","nullable":true,"format":"date-time"},"approved_at":{"type":"string","nullable":true,"format":"date-time"},"notes":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/InventoryCountItemDto"}},"location":{"description":"Present when `expand=location` is requested","allOf":[{"$ref":"#/components/schemas/InventoryLocationDto"}]}},"required":["id","restaurant_id","location_id","status","name","name_ar","counted_by_id","approved_by_id","started_at","submitted_at","approved_at","notes","created_at","updated_at","items"],"title":"InventoryCountDto"},"InventoryCountListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryCountDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"InventoryCountListDto"},"CreateInventoryCountDto":{"type":"object","properties":{"location_id":{"type":"string","format":"uuid"},"name":{"type":"string","maxLength":200},"name_ar":{"type":"string","maxLength":200},"notes":{"type":"string"}},"required":["location_id","name"],"title":"CreateInventoryCountDto"},"AddCountItemDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"notes":{"type":"string"}},"required":["stock_item_id","unit_id"],"title":"AddCountItemDto"},"CountItemEntryDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"counted_qty":{"type":"number","minimum":0},"notes":{"type":"string"}},"required":["stock_item_id","counted_qty"],"title":"CountItemEntryDto"},"SubmitInventoryCountDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CountItemEntryDto"}}},"required":["items"],"title":"SubmitInventoryCountDto"},"ProductionLineStockItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"ProductionLineStockItemDto"},"ProductionLineUnitDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"symbol":{"type":"string","example":"kg"}},"required":["id","name","name_ar","symbol"],"title":"ProductionLineUnitDto"},"ProductionIngredientResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"production_order_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"planned_qty":{"type":"number","example":2},"actual_qty":{"type":"number","nullable":true,"example":1.9},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/ProductionLineStockItemDto"}]},"unit":{"description":"Present when `expand=unit` is requested","allOf":[{"$ref":"#/components/schemas/ProductionLineUnitDto"}]}},"required":["id","production_order_id","stock_item_id","planned_qty","actual_qty","unit_id"],"title":"ProductionIngredientResponseDto"},"ProductionOutputResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"production_order_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"planned_qty":{"type":"number","example":10},"actual_qty":{"type":"number","nullable":true,"example":9.5},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"is_primary":{"type":"boolean","example":true},"notes":{"type":"string","nullable":true},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/ProductionLineStockItemDto"}]},"unit":{"description":"Present when `expand=unit` is requested","allOf":[{"$ref":"#/components/schemas/ProductionLineUnitDto"}]}},"required":["id","production_order_id","stock_item_id","planned_qty","actual_qty","unit_id","is_primary","notes"],"title":"ProductionOutputResponseDto"},"ProductionWasteItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"production_order_id":{"type":"string","format":"uuid"},"stock_item_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","example":0.1},"unit_id":{"type":"string","format":"uuid","description":"ID of the UnitOfMeasure"},"reason":{"type":"string","nullable":true},"stock_item":{"description":"Present when `expand=stock_item` is requested","allOf":[{"$ref":"#/components/schemas/ProductionLineStockItemDto"}]},"unit":{"description":"Present when `expand=unit` is requested","allOf":[{"$ref":"#/components/schemas/ProductionLineUnitDto"}]}},"required":["id","production_order_id","stock_item_id","quantity","unit_id","reason"],"title":"ProductionWasteItemDto"},"ProductionOrderDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"location_id":{"type":"string","format":"uuid"},"recipe_id":{"type":"string","nullable":true,"format":"uuid"},"status":{"type":"string","example":"DRAFT"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"started_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"posted_at":{"type":"string","nullable":true,"format":"date-time"},"notes":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true,"format":"uuid"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ingredients":{"type":"array","items":{"$ref":"#/components/schemas/ProductionIngredientResponseDto"}},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/ProductionOutputResponseDto"}},"waste_items":{"type":"array","items":{"$ref":"#/components/schemas/ProductionWasteItemDto"}},"location":{"description":"Present when `expand=location` is requested","allOf":[{"$ref":"#/components/schemas/InventoryLocationDto"}]}},"required":["id","restaurant_id","location_id","recipe_id","status","scheduled_at","started_at","completed_at","posted_at","notes","created_by_id","created_at","updated_at","ingredients","outputs","waste_items"],"title":"ProductionOrderDto"},"ProductionOrderListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductionOrderDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ProductionOrderListDto"},"ProductionIngredientDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"planned_qty":{"type":"number","minimum":0.0001},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"}},"required":["stock_item_id","planned_qty","unit_id"],"title":"ProductionIngredientDto"},"ProductionOutputDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"planned_qty":{"type":"number","minimum":0.0001},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"is_primary":{"type":"boolean","default":true},"notes":{"type":"string","maxLength":300}},"required":["stock_item_id","planned_qty","unit_id"],"title":"ProductionOutputDto"},"CreateProductionOrderDto":{"type":"object","properties":{"location_id":{"type":"string","format":"uuid"},"recipe_id":{"type":"string","format":"uuid","description":"Link to a PRODUCTION recipe; auto-populates ingredients if provided"},"target_yield_qty":{"type":"number","minimum":0.0001,"description":"Target yield quantity; scales recipe ingredients proportionally when recipeId is set"},"scheduled_at":{"type":"string"},"notes":{"type":"string","maxLength":500},"ingredients":{"description":"Required when no recipeId is provided","type":"array","items":{"$ref":"#/components/schemas/ProductionIngredientDto"}},"outputs":{"description":"Required when no recipeId is provided","type":"array","items":{"$ref":"#/components/schemas/ProductionOutputDto"}}},"required":["location_id"],"title":"CreateProductionOrderDto"},"ActualIngredientDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"actual_qty":{"type":"number","minimum":0}},"required":["id","actual_qty"],"title":"ActualIngredientDto"},"ActualOutputDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"actual_qty":{"type":"number","minimum":0}},"required":["id","actual_qty"],"title":"ActualOutputDto"},"WasteItemDto":{"type":"object","properties":{"stock_item_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0.0001},"unit_id":{"type":"string","format":"uuid","description":"UnitOfMeasure ID"},"reason":{"type":"string","maxLength":300}},"required":["stock_item_id","quantity","unit_id"],"title":"WasteItemDto"},"CompleteProductionOrderDto":{"type":"object","properties":{"ingredients":{"type":"array","items":{"$ref":"#/components/schemas/ActualIngredientDto"}},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/ActualOutputDto"}},"waste_items":{"type":"array","items":{"$ref":"#/components/schemas/WasteItemDto"}}},"required":["ingredients","outputs"],"title":"CompleteProductionOrderDto"},"UnitOfMeasureListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UnitOfMeasureDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"UnitOfMeasureListDto"},"CreateUnitOfMeasureDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Kilogram"},"name_ar":{"type":"string","maxLength":100,"example":"كيلوغرام"},"symbol":{"type":"string","maxLength":20,"example":"kg"},"dimension":{"nullable":true,"description":"What the unit measures. Null leaves it unclassified: it never converts.","allOf":[{"$ref":"#/components/schemas/UnitDimension"}]},"factor_to_base":{"type":"number","nullable":true,"minimum":0.000001,"example":1000,"description":"How many base units (g, ml, mm, piece) one of this unit is. Required with a dimension."}},"required":["name","symbol"],"title":"CreateUnitOfMeasureDto"},"UpdateUnitOfMeasureDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Kilogram"},"name_ar":{"type":"string","maxLength":100,"example":"كيلوغرام"},"symbol":{"type":"string","maxLength":20,"example":"kg"},"dimension":{"nullable":true,"description":"What the unit measures. Null leaves it unclassified: it never converts.","allOf":[{"$ref":"#/components/schemas/UnitDimension"}]},"factor_to_base":{"type":"number","nullable":true,"minimum":0.000001,"example":1000,"description":"How many base units (g, ml, mm, piece) one of this unit is. Required with a dimension."},"is_active":{"type":"boolean","example":true}},"title":"UpdateUnitOfMeasureDto"},"UpsertPriceOverrideDto":{"type":"object","properties":{"entity_type":{"enum":["PRODUCT","VARIANT","OPTION_VALUE"],"type":"string"},"entity_id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","nullable":true,"format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"price":{"type":"number","nullable":true,"minimum":0},"price_delta":{"type":"number","nullable":true},"is_active":{"type":"boolean","default":true}},"required":["entity_type","entity_id"],"title":"UpsertPriceOverrideDto"},"PriceOverrideDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"entity_type":{"enum":["PRODUCT","VARIANT","OPTION_VALUE"],"type":"string"},"entity_id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","nullable":true,"format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"price":{"type":"number","nullable":true,"example":9.99},"price_delta":{"type":"number","nullable":true,"example":-1.5,"description":"Additive price delta"},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","entity_type","entity_id","channel_id","branch_id","price","price_delta","is_active","created_at","updated_at"],"title":"PriceOverrideDto"},"DeletePriceOverrideDto":{"type":"object","properties":{"entity_type":{"enum":["PRODUCT","VARIANT","OPTION_VALUE"],"type":"string"},"entity_id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","nullable":true,"format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"}},"required":["entity_type","entity_id"],"title":"DeletePriceOverrideDto"},"ProductChannelPriceDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","format":"uuid"},"price":{"type":"number","example":12.5}},"required":["product_id","channel_id","price"],"title":"ProductChannelPriceDto"},"ProductPricingOverviewDto":{"type":"object","properties":{"product_overrides":{"description":"Product-level overrides (entityType=PRODUCT)","type":"array","items":{"$ref":"#/components/schemas/PriceOverrideDto"}},"variant_overrides":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/PriceOverrideDto"}},"description":"Per-variant overrides keyed by variantId (entityType=VARIANT)"},"option_value_overrides":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/PriceOverrideDto"}},"description":"Per-option-value overrides keyed by optionValueId (entityType=OPTION_VALUE)"}},"required":["product_overrides"],"title":"ProductPricingOverviewDto"},"PromotionTargetResponseDto":{"type":"object","properties":{"target_type":{"enum":["PRODUCT","CATEGORY"],"type":"string"},"target_id":{"type":"string","format":"uuid"}},"required":["target_type","target_id"],"title":"PromotionTargetResponseDto"},"PromotionResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"type":{"enum":["CODE","AUTOMATIC"],"type":"string"},"code":{"type":"string","nullable":true,"description":"Null for an AUTOMATIC promotion, which nobody types."},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"value":{"type":"number"},"max_discount_amount":{"type":"number","nullable":true},"min_order_subtotal":{"type":"number","nullable":true},"starts_at":{"type":"string","nullable":true,"format":"date-time"},"ends_at":{"type":"string","nullable":true,"format":"date-time"},"max_total_usages":{"type":"number","nullable":true},"max_usages_per_customer":{"type":"number","nullable":true},"usage_count":{"type":"number","description":"Redemptions so far, excluding reversed ones"},"sources":{"type":"array","items":{"type":"string","enum":["pos","emenu","table_session","service_booking","delivery_app"]}},"order_types":{"type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]}},"target_mode":{"enum":["ALL","INCLUDE","EXCLUDE"],"type":"string"},"branch_ids":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/PromotionTargetResponseDto"}},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","type","code","name","name_ar","discount_type","value","max_discount_amount","min_order_subtotal","starts_at","ends_at","max_total_usages","max_usages_per_customer","usage_count","sources","order_types","target_mode","branch_ids","targets","is_active","created_at","updated_at"],"title":"PromotionResponseDto"},"PromotionTargetDto":{"type":"object","properties":{"target_type":{"enum":["PRODUCT","CATEGORY"],"type":"string"},"target_id":{"type":"string","format":"uuid","description":"Product or category id, per target_type"}},"required":["target_type","target_id"],"title":"PromotionTargetDto"},"CreatePromotionDto":{"type":"object","properties":{"type":{"enum":["CODE","AUTOMATIC"],"type":"string","default":"CODE","description":"CODE is unlocked by the customer typing it and discounts the order total. AUTOMATIC needs no action: it lowers the price of every product it covers, so the menu shows the old price struck through."},"code":{"type":"string","maxLength":40,"pattern":"^[A-Z0-9_-]+$","example":"SUMMER26","description":"Required for a CODE promotion, rejected for an AUTOMATIC one."},"name":{"type":"string","maxLength":150,"example":"Summer sale"},"name_ar":{"type":"string","maxLength":150,"example":"خصم الصيف"},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"value":{"type":"number","minimum":0.01,"example":20,"description":"Percent when discount_type is PERCENTAGE (1-100), otherwise a currency amount"},"max_discount_amount":{"type":"number","minimum":0.01,"example":50,"description":"Ceiling on the computed amount"},"min_order_subtotal":{"type":"number","minimum":0,"example":100,"description":"Measured against the full item subtotal, before any exclusions"},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time","description":"Exclusive — the code dies at this instant"},"max_total_usages":{"type":"number","minimum":1,"description":"Total redemptions allowed. Null = unlimited"},"max_usages_per_customer":{"type":"number","minimum":1,"description":"Redemptions per customer. Null = unlimited"},"sources":{"type":"array","items":{"type":"string","enum":["pos","emenu","table_session","service_booking","delivery_app"]},"description":"Empty = every surface"},"order_types":{"type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]},"description":"Empty = every order type"},"branch_ids":{"description":"Empty = every branch","type":"array","items":{"type":"string","format":"uuid"}},"target_mode":{"enum":["ALL","INCLUDE","EXCLUDE"],"type":"string","default":"ALL"},"targets":{"maxItems":500,"description":"Read according to target_mode","type":"array","items":{"$ref":"#/components/schemas/PromotionTargetDto"}},"is_active":{"type":"boolean","default":true}},"required":["name","discount_type","value"],"title":"CreatePromotionDto"},"UpdatePromotionDto":{"type":"object","properties":{"type":{"enum":["CODE","AUTOMATIC"],"type":"string","default":"CODE","description":"CODE is unlocked by the customer typing it and discounts the order total. AUTOMATIC needs no action: it lowers the price of every product it covers, so the menu shows the old price struck through."},"code":{"type":"string","maxLength":40,"pattern":"^[A-Z0-9_-]+$","example":"SUMMER26","description":"Required for a CODE promotion, rejected for an AUTOMATIC one."},"name":{"type":"string","maxLength":150,"example":"Summer sale"},"name_ar":{"type":"string","maxLength":150,"example":"خصم الصيف"},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"value":{"type":"number","minimum":0.01,"example":20,"description":"Percent when discount_type is PERCENTAGE (1-100), otherwise a currency amount"},"max_discount_amount":{"type":"number","minimum":0.01,"example":50,"description":"Ceiling on the computed amount"},"min_order_subtotal":{"type":"number","minimum":0,"example":100,"description":"Measured against the full item subtotal, before any exclusions"},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time","description":"Exclusive — the code dies at this instant"},"max_total_usages":{"type":"number","minimum":1,"description":"Total redemptions allowed. Null = unlimited"},"max_usages_per_customer":{"type":"number","minimum":1,"description":"Redemptions per customer. Null = unlimited"},"sources":{"type":"array","items":{"type":"string","enum":["pos","emenu","table_session","service_booking","delivery_app"]},"description":"Empty = every surface"},"order_types":{"type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]},"description":"Empty = every order type"},"branch_ids":{"description":"Empty = every branch","type":"array","items":{"type":"string","format":"uuid"}},"target_mode":{"enum":["ALL","INCLUDE","EXCLUDE"],"type":"string","default":"ALL"},"targets":{"maxItems":500,"description":"Read according to target_mode","type":"array","items":{"$ref":"#/components/schemas/PromotionTargetDto"}},"is_active":{"type":"boolean","default":true}},"title":"UpdatePromotionDto"},"ValidatePromotionDto":{"type":"object","properties":{"code":{"type":"string","maxLength":40,"example":"SUMMER26"},"cart_id":{"type":"string","format":"uuid","description":"The active cart the code is priced against"},"branch_id":{"type":"string","format":"uuid"},"order_type":{"enum":["DELIVERY","takeaway","DINE_IN","DRIVE_THROUGH","TABLE_RESERVATION","SERVICE","OTHER"],"type":"string"}},"required":["code","cart_id","branch_id","order_type"],"title":"ValidatePromotionDto"},"PromotionQuoteResponseDto":{"type":"object","properties":{"valid":{"type":"boolean"},"reason":{"nullable":true,"enum":["NOT_FOUND","INACTIVE","NOT_STARTED","EXPIRED","SOURCE_NOT_ELIGIBLE","ORDER_TYPE_NOT_ELIGIBLE","BRANCH_NOT_ELIGIBLE","BELOW_MINIMUM_SUBTOTAL","NO_ELIGIBLE_ITEMS","USAGE_LIMIT_REACHED","CUSTOMER_LIMIT_REACHED","CUSTOMER_REQUIRED"],"type":"string"},"discount_amount":{"type":"number","description":"Zero whenever valid is false"},"code":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true}},"required":["valid","discount_amount","code","name","name_ar"],"title":"PromotionQuoteResponseDto"},"OrderServiceBookingDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"scheduled_at":{"format":"date-time","type":"string","description":"Appointment start (ISO 8601, UTC)."},"ends_at":{"format":"date-time","type":"string","description":"Start + duration (buffer excluded)."},"duration_minutes":{"type":"number"},"status":{"enum":["PENDING_ADVANCE","SCHEDULED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW"],"type":"string"},"staff_id":{"type":"string","nullable":true,"format":"uuid"},"staff_name":{"type":"string","nullable":true},"product_name":{"type":"string","nullable":true},"product_name_ar":{"type":"string","nullable":true},"advance_amount":{"type":"number","nullable":true},"time_zone":{"type":"string","description":"Branch IANA zone the appointment is read in."}},"required":["id","scheduled_at","ends_at","duration_minutes","status","staff_id","staff_name","product_name","product_name_ar","advance_amount","time_zone"],"title":"OrderServiceBookingDto"},"CustomerSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true},"phone":{"type":"string"},"email":{"type":"string","nullable":true},"loyalty_points":{"type":"number"}},"required":["id","name","name_ar","phone","email","loyalty_points"],"title":"CustomerSummaryDto"},"OrderFieldValueResponseDto":{"type":"object","properties":{"field_id":{"type":"string"},"label":{"type":"string"},"label_ar":{"type":"string","nullable":true},"value":{"type":"string"}},"required":["field_id","label","value"],"title":"OrderFieldValueResponseDto"},"OrderPaymentGatewayMetadataDto":{"type":"object","properties":{"provider":{"type":"string","example":"myfatoorah","description":"Provider key — pick the gateway logo by it; show a generic card for unknown keys."},"payment_id":{"type":"string","example":"0808895551828707495085"},"invoice_id":{"type":"string","example":"89555182"},"invoice_reference":{"type":"string","example":"2026003418","description":"The gateway's invoice reference — show it as the payment's Ref Number."},"reference_id":{"type":"string","example":"624423027081","description":"Bank reference (RRN) printed on the customer's receipt."},"authorization_id":{"type":"string","example":"065842"},"payment_method":{"type":"string","example":"Apple Pay (mada)","description":"How the customer paid, as the gateway names it."}},"required":["provider"],"title":"OrderPaymentGatewayMetadataDto"},"OrderPaymentMetadataDto":{"type":"object","properties":{"v":{"type":"number","enum":[1]},"gateway":{"$ref":"#/components/schemas/OrderPaymentGatewayMetadataDto"}},"required":["v"],"title":"OrderPaymentMetadataDto"},"OrderPaymentRefundSummaryDto":{"type":"object","properties":{"status":{"enum":["PENDING","PARTIALLY_REFUNDED","REFUNDED"],"type":"string","description":"PENDING: a refund was sent and is not settled yet. REFUNDED: the whole payment went back."},"refunded_amount":{"type":"number","example":25,"description":"Returned to the customer."},"pending_amount":{"type":"number","example":0,"description":"Sent to the gateway and not settled yet."}},"required":["status","refunded_amount","pending_amount"],"title":"OrderPaymentRefundSummaryDto"},"PaymentMethodSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"type":{"type":"string"},"auto_open_drawer":{"type":"boolean"}},"required":["id","name","name_ar","type","auto_open_drawer"],"title":"PaymentMethodSummaryDto"},"OrderPaymentResponseDto":{"type":"object","properties":{"id":{"type":"string"},"payment_transaction_id":{"type":"string","nullable":true,"description":"Gateway transaction that captured this money. Its payment method cannot be changed."},"metadata":{"nullable":true,"description":"Gateway references and other per-payment facts; null for cash and most tenders.","type":"object","allOf":[{"$ref":"#/components/schemas/OrderPaymentMetadataDto"}]},"refund":{"nullable":true,"description":"Gateway refunds of this payment; null when none.","type":"object","allOf":[{"$ref":"#/components/schemas/OrderPaymentRefundSummaryDto"}]},"payment_method_id":{"type":"string","nullable":true},"gift_card_id":{"type":"string","nullable":true},"amount":{"type":"number"},"notes":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"payment_method":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/PaymentMethodSummaryDto"}]}},"required":["id","payment_transaction_id","payment_method_id","gift_card_id","amount","notes","created_at"],"title":"OrderPaymentResponseDto"},"OptionGroupSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"OptionGroupSummaryDto"},"OrderItemOptionResponseDto":{"type":"object","properties":{"id":{"type":"string"},"option_group_id":{"type":"string"},"option_value_id":{"type":"string"},"quantity":{"type":"number"},"unit_price_delta":{"type":"number"},"total_price_delta":{"type":"number"},"snapshot":{"type":"object"},"option_group":{"$ref":"#/components/schemas/OptionGroupSummaryDto"},"option_value":{"$ref":"#/components/schemas/OptionValueSummaryDto"}},"required":["id","option_group_id","option_value_id","quantity","unit_price_delta","total_price_delta","snapshot"],"title":"OrderItemOptionResponseDto"},"ProductSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"type":{"type":"string"},"category_id":{"type":"string","nullable":true},"category_name":{"type":"string","nullable":true}},"required":["id","name","name_ar","type","category_id","category_name"],"title":"ProductSummaryDto"},"VariantSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true},"price":{"type":"number"}},"required":["id","name","name_ar","sku","price"],"title":"VariantSummaryDto"},"OrderItemResponseDto":{"type":"object","properties":{"sale_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"The unit a weighted line was sold in (kg). Null for pieces."},"sale_unit_symbol":{"type":"string","nullable":true,"example":"kg","description":"Symbol of the sale unit, kept on the line. Null for pieces."},"scanned_code":{"type":"string","nullable":true,"example":"2010008005004","description":"The scale label scanned for this line. Null when the quantity was entered."},"scale_format_id":{"type":"string","nullable":true,"format":"uuid","description":"The scale label format that read the scanned code."},"scale_label_total":{"type":"number","nullable":true,"example":40,"description":"Price labels: the total printed on the label."},"scale_price_mismatch":{"type":"boolean","description":"Price labels: the list price × the quantity differs from the label total (the line uses the list price)."},"id":{"type":"string"},"product_id":{"type":"string"},"variant_id":{"type":"string","nullable":true},"quantity":{"type":"number"},"unit_price":{"type":"number"},"total_price":{"type":"number"},"vat_percentage":{"type":"number"},"vat_amount":{"type":"number"},"snapshot":{"type":"object"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"price":{"type":"number"},"product_name":{"type":"string"},"is_free":{"type":"boolean"},"status":{"type":"string","nullable":true},"stock_status":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"options":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemOptionResponseDto"}},"product":{"$ref":"#/components/schemas/ProductSummaryDto"},"variant":{"$ref":"#/components/schemas/VariantSummaryDto"}},"required":["id","product_id","variant_id","quantity","unit_price","total_price","vat_percentage","vat_amount","snapshot","name","name_ar","price","product_name","is_free","status","stock_status","notes","options"],"title":"OrderItemResponseDto"},"ChannelSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"is_active":{"type":"boolean"}},"required":["id","name","name_ar","is_active"],"title":"ChannelSummaryDto"},"BranchSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"city_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar","city","city_ar"],"title":"BranchSummaryDto"},"StaffSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"title":"StaffSummaryDto"},"OrderResponseDto":{"type":"object","properties":{"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"offline_number":{"type":"string","nullable":true,"example":"T3-0042","description":"Receipt number printed while offline. Null for orders created online."},"client_ref":{"type":"string","nullable":true,"format":"uuid","description":"The device's temporary id for an order recorded offline."},"synced_at":{"format":"date-time","type":"string","nullable":true,"description":"When an offline order reached the server; `created_at` is when it was sold."},"twlm_qr_url":{"type":"string","nullable":true,"description":"Public digital-invoice URL to encode into the TWLM receipt QR code. Always returned; whether it is printed is decided by `settings.invoice.show_twlm_qr` at render time.","example":"https://twlm.solutions/invoice/1f0a…"},"deferred_at":{"type":"string","nullable":true,"format":"date-time","description":"When the sale was put on account (آجل). Stays set after the debt is paid off; such orders keep their payment methods locked."},"scheduled_for":{"type":"string","nullable":true,"format":"date-time","description":"When the customer wants the order (e-menu scheduled pickup/delivery). Null means as soon as possible."},"service_bookings":{"type":"array","items":{"$ref":"#/components/schemas/OrderServiceBookingDto"}},"id":{"type":"string"},"restaurant_id":{"type":"string"},"branch_id":{"type":"string"},"order_type":{"type":"string"},"status":{"type":"string"},"payment_status":{"type":"string"},"return_status":{"type":"string"},"delivery_details":{"type":"object"},"dine_in_details":{"type":"object"},"drive_through_details":{"type":"object"},"booking_details":{"type":"object"},"customer_id":{"type":"string","nullable":true},"customer":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/CustomerSummaryDto"}]},"subtotal":{"type":"number"},"tax_amount":{"type":"number"},"tax_rate":{"type":"number"},"product_vat_amount":{"type":"number"},"discount_amount":{"type":"number"},"delivery_fee":{"type":"number"},"service_charge":{"type":"number"},"total":{"type":"number"},"discount_type":{"type":"string","nullable":true},"discount_value":{"type":"number","nullable":true},"loyalty_discount":{"type":"number"},"loyalty_points_earned":{"type":"number"},"loyalty_points_redeemed":{"type":"number"},"staff_id":{"type":"string","nullable":true},"serial_number":{"type":"number","nullable":true},"serial_order_number":{"type":"number","nullable":true},"notes":{"type":"string","nullable":true},"source":{"type":"string"},"order_source":{"type":"string"},"table_number":{"type":"string","nullable":true},"customer_name":{"type":"string","nullable":true},"customer_phone":{"type":"string","nullable":true},"payment_method":{"type":"string"},"channel_id":{"type":"string","nullable":true},"commission":{"type":"number","nullable":true},"zatca_qr_code":{"type":"string","nullable":true},"deleted_at":{"format":"date-time","type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"field_values":{"type":"array","items":{"$ref":"#/components/schemas/OrderFieldValueResponseDto"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/OrderPaymentResponseDto"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemResponseDto"}},"channel":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ChannelSummaryDto"}]},"branch":{"$ref":"#/components/schemas/BranchSummaryDto"},"staff":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/StaffSummaryDto"}]}},"required":["currency","twlm_qr_url","deferred_at","service_bookings","id","restaurant_id","branch_id","order_type","status","payment_status","return_status","delivery_details","dine_in_details","drive_through_details","booking_details","customer_id","customer","subtotal","tax_amount","tax_rate","product_vat_amount","discount_amount","delivery_fee","service_charge","total","discount_type","discount_value","loyalty_discount","loyalty_points_earned","loyalty_points_redeemed","staff_id","serial_number","serial_order_number","notes","source","order_source","table_number","customer_name","customer_phone","payment_method","channel_id","commission","zatca_qr_code","deleted_at","created_at","updated_at","field_values","payments","items"],"title":"OrderResponseDto"},"InvoiceRestaurantDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"logo_url":{"type":"string","nullable":true},"tax_number":{"type":"string","nullable":true},"currency":{"type":"string"}},"required":["id","name","name_ar","logo_url","tax_number","currency"],"title":"InvoiceRestaurantDto"},"InvoiceBranchDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["id","name","name_ar","address","city","phone"],"title":"InvoiceBranchDto"},"InvoiceItemOptionDto":{"type":"object","properties":{"option_group_id":{"type":"string"},"option_value_id":{"type":"string"},"quantity":{"type":"number"},"unit_price_delta":{"type":"number"},"total_price_delta":{"type":"number"},"snapshot":{"type":"object"}},"required":["option_group_id","option_value_id","quantity","unit_price_delta","total_price_delta","snapshot"],"title":"InvoiceItemOptionDto"},"InvoiceItemDto":{"type":"object","properties":{"sale_unit_symbol":{"type":"string","nullable":true,"example":"kg"},"id":{"type":"string"},"quantity":{"type":"number"},"unit_price":{"type":"number"},"total_price":{"type":"number"},"vat_percentage":{"type":"number"},"vat_amount":{"type":"number"},"is_free":{"type":"boolean"},"snapshot":{"type":"object"},"options":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItemOptionDto"}}},"required":["id","quantity","unit_price","total_price","vat_percentage","vat_amount","is_free","snapshot","options"],"title":"InvoiceItemDto"},"PublicOrderInvoiceDto":{"type":"object","properties":{"id":{"type":"string"},"serial_number":{"type":"number","nullable":true},"invoice_number_prefix":{"type":"string"},"order_type":{"type":"string"},"status":{"type":"string"},"payment_status":{"type":"string"},"subtotal":{"type":"number"},"tax_amount":{"type":"number"},"tax_rate":{"type":"number"},"product_vat_amount":{"type":"number"},"discount_amount":{"type":"number"},"loyalty_discount":{"type":"number"},"delivery_fee":{"type":"number"},"service_charge":{"type":"number"},"total":{"type":"number"},"notes":{"type":"string","nullable":true},"zatca_qr_code":{"type":"string","nullable":true},"twlm_qr_url":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"restaurant":{"$ref":"#/components/schemas/InvoiceRestaurantDto"},"branch":{"$ref":"#/components/schemas/InvoiceBranchDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItemDto"}}},"required":["id","serial_number","invoice_number_prefix","order_type","status","payment_status","subtotal","tax_amount","tax_rate","product_vat_amount","discount_amount","loyalty_discount","delivery_fee","service_charge","total","notes","zatca_qr_code","twlm_qr_url","created_at","restaurant","branch","items"],"title":"PublicOrderInvoiceDto"},"ReadyBoardCategoryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Burgers"},"name_ar":{"type":"string","nullable":true,"example":"برجر"}},"required":["id","name","name_ar"],"title":"ReadyBoardCategoryDto"},"ReadyBoardTokenDto":{"type":"object","properties":{"serial_number":{"type":"number","nullable":true,"example":12,"description":"Branch daily order serial / token number; null for an order synced from offline"},"offline_number":{"type":"string","nullable":true,"example":"B17","description":"Receipt number printed offline; the token of an order with no serial"},"order_type":{"type":"string","example":"TAKEAWAY","description":"Order type enum value"},"category_ids":{"description":"Distinct product category ids from the order line-item snapshots","type":"array","items":{"type":"string","format":"uuid"}},"ready_category_ids":{"description":"Category ids where every line item in that category is READY (station-level completion)","type":"array","items":{"type":"string","format":"uuid"}}},"required":["serial_number","offline_number","order_type","category_ids","ready_category_ids"],"title":"ReadyBoardTokenDto"},"ReadyBoardResponseDto":{"type":"object","properties":{"restaurant_name":{"type":"string","example":"Burger Palace"},"restaurant_name_ar":{"type":"string","nullable":true,"example":"برجر بالاس"},"branch_name":{"type":"string","example":"Olaya"},"branch_name_ar":{"type":"string","nullable":true,"example":"العليا"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/ReadyBoardCategoryDto"}},"preparing":{"type":"array","items":{"$ref":"#/components/schemas/ReadyBoardTokenDto"}},"ready":{"type":"array","items":{"$ref":"#/components/schemas/ReadyBoardTokenDto"}}},"required":["restaurant_name","restaurant_name_ar","branch_name","branch_name_ar","categories","preparing","ready"],"title":"ReadyBoardResponseDto"},"CustomerLocationDto":{"type":"object","properties":{"lat":{"type":"number","example":24.7136},"lng":{"type":"number","example":46.6753}},"required":["lat","lng"],"title":"CustomerLocationDto"},"CustomerDriveThroughDetailsDto":{"type":"object","properties":{"vehicle_details":{"type":"string","description":"Vehicle description / plate number. Falls back to the customer plate number on record when omitted."}},"title":"CustomerDriveThroughDetailsDto"},"DineInDetailsDto":{"type":"object","properties":{"table_id":{"type":"string","format":"uuid"},"table_number":{"type":"string"},"reservation_id":{"type":"string","format":"uuid"}},"title":"DineInDetailsDto"},"OrderCustomFieldDto":{"type":"object","properties":{"field_id":{"type":"string","format":"uuid","description":"ID of the BranchOrderField definition"},"value":{"type":"string","description":"The selected dropdown value or free-text entry"}},"required":["field_id","value"],"title":"OrderCustomFieldDto"},"ServiceBookingAtCheckoutDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"SERVICE product present in the cart"},"staff_id":{"type":"string","format":"uuid","description":"Staff member to perform the service. Omit when no specific staff is required."},"scheduled_at":{"type":"string","description":"Scheduled start time (ISO 8601)"},"notes":{"type":"string"}},"required":["product_id","scheduled_at"],"title":"ServiceBookingAtCheckoutDto"},"CreateCustomerOrderDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"order_type":{"enum":["DELIVERY","takeaway","DINE_IN","DRIVE_THROUGH","TABLE_RESERVATION","SERVICE","OTHER"],"type":"string"},"cart_id":{"type":"string","format":"uuid","description":"Active cart for this branch (customer-owned)."},"payment_method":{"enum":["CASH","ONLINE"],"type":"string","description":"CASH: order stays PENDING until staff records payment. ONLINE: payment gateway flow is initiated after order creation.","default":"CASH"},"customer_location":{"description":"Required when `orderType` is `DELIVERY` (WGS84).","allOf":[{"$ref":"#/components/schemas/CustomerLocationDto"}]},"delivery_address":{"type":"string","description":"Delivery address string (for DELIVERY orders)."},"drive_through_details":{"$ref":"#/components/schemas/CustomerDriveThroughDetailsDto"},"reservation_id":{"type":"string","format":"uuid","description":"For `DINE_IN`: optional seated booking to attach. For `TABLE_RESERVATION`: required (validated in service)."},"dine_in_details":{"description":"For QR walk-in `DINE_IN` without `reservation_id`: pass `table_id` to create/reuse a customer TableReservation for that table slot, then attach the order to it.","allOf":[{"$ref":"#/components/schemas/DineInDetailsDto"}]},"notes":{"type":"string"},"custom_fields":{"description":"Values for branch-level custom order fields.","type":"array","items":{"$ref":"#/components/schemas/OrderCustomFieldDto"}},"service_bookings":{"description":"Staff + time selections for SERVICE items in the cart. One entry per service product being booked.","type":"array","items":{"$ref":"#/components/schemas/ServiceBookingAtCheckoutDto"}},"loyalty_points_to_redeem":{"type":"number","minimum":1,"description":"Loyalty points to redeem against this order. Converts to a loyalty_discount and reduces the order total. When the discount covers the full total, payment_status becomes PAID."},"loyalty_pass_serial":{"type":"string","maxLength":8,"description":"Serial of the loyalty card this order should stamp, chosen by the customer from their own cards (`GET /restaurants/:restaurantId/customer/loyalty-passes`). Rejected with 404 when the card is not theirs at this restaurant, and 400 when it has been voided. Omit to earn no stamp.","example":"NZB-RJ6"},"promo_code":{"type":"string","maxLength":40,"description":"Promotion code to apply, as checked against this cart via `POST /restaurants/:restaurantId/customer/promotions/validate`. Rejected with 400 when the code does not apply to this basket, so the customer is never charged a total the checkout screen did not show. At most one promotion per order; it is applied before any loyalty points are redeemed.","example":"SUMMER26"},"scheduled_for":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?(Z|[+-]\\d{2}:\\d{2})$","format":"date-time","description":"When the customer wants the order (ISO 8601 with a `Z` or `±hh:mm` offset). Omit for \"as soon as possible\". Only for TAKEAWAY, DELIVERY and DRIVE_THROUGH, when the restaurant has `orders.scheduled_orders.enabled`; refused with 400 `SCHEDULED_ORDER_REFUSED` when the time is inside the lead time, beyond the max days, or outside the opening hours.","example":"2026-11-26T18:30:00+03:00"}},"required":["branch_id","order_type","cart_id","payment_method"],"title":"CreateCustomerOrderDto"},"CreateCustomerOrderResultDto":{"type":"object","properties":{"payment_status":{"type":"string","enum":["PAID","PARTIAL","UNPAID","DEFERRED"],"description":"PAID for a cash checkout, UNPAID while an online payment is still pending."},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"tracking_token":{"type":"string","description":"Public token of the order's live status page (`/o/{token}`). Present only when the branch has the Customer Display & Pager add-on."},"scheduled_for":{"type":"string","format":"date-time","description":"When the customer wants the order. Present only for a scheduled order."},"order_id":{"type":"string"},"serial_number":{"type":"number"},"status":{"type":"string"},"total":{"type":"string"},"tax_amount":{"type":"string"},"delivery_fee":{"type":"string"},"estimated_time_minutes":{"type":"number"}},"required":["payment_status","currency","order_id","serial_number","status","total","tax_amount","delivery_fee"],"title":"CreateCustomerOrderResultDto"},"PosNewOrderEventDto":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"serial_number":{"type":"number","example":12,"description":"0 when the order has no serial (synced offline)"},"offline_number":{"type":"string","nullable":true,"example":"B17","description":"Receipt number printed by an offline POS; null for online orders"},"branch_id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"order_type":{"type":"string","example":"TAKEAWAY"},"total":{"type":"string","example":"42.50","description":"Order total as a decimal string"},"status":{"type":"string","example":"PENDING"},"created_at":{"type":"string","example":"2026-07-11T12:00:00.000Z"},"category_ids":{"description":"Distinct product category ids from the order line items (station alert filtering)","type":"array","items":{"type":"string","format":"uuid"}}},"required":["order_id","serial_number","offline_number","branch_id","restaurant_id","order_type","total","status","created_at","category_ids"],"title":"PosNewOrderEventDto"},"PosOrderStatusChangedEventDto":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"PREPARING"}},"required":["order_id","status"],"title":"PosOrderStatusChangedEventDto"},"PosOrderReadyEventDto":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"}},"required":["order_id"],"title":"PosOrderReadyEventDto"},"PosOrderItemReadyEventDto":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"item_id":{"type":"string","format":"uuid"}},"required":["order_id","item_id"],"title":"PosOrderItemReadyEventDto"},"PosOrderItemPreparingEventDto":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"item_id":{"type":"string","format":"uuid"}},"required":["order_id","item_id"],"title":"PosOrderItemPreparingEventDto"},"PosOrderVoidedEventDto":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"}},"required":["order_id"],"title":"PosOrderVoidedEventDto"},"PosCashierNotificationEventDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique per notification; clients may use it to de-duplicate"},"title":{"type":"string","example":"New Order"},"body":{"type":"string","example":"Order #12 · TAKEAWAY · 42.50 SAR"},"data":{"type":"object","additionalProperties":{"type":"string"},"description":"The FCM `data` string map, keys verbatim (e.g. `orderId`, `order_json`)"}},"required":["id","title","body","data"],"title":"PosCashierNotificationEventDto"},"KitchenItemOptionDto":{"type":"object","properties":{"option_value_id":{"type":"string","format":"uuid"},"quantity":{"type":"number"},"unit_price_delta":{"type":"number"},"snapshot":{"type":"object","additionalProperties":true},"option_group":{"$ref":"#/components/schemas/OptionGroupSummaryDto"},"option_value":{"$ref":"#/components/schemas/OptionValueSummaryDto"}},"required":["option_value_id","quantity","unit_price_delta","snapshot"],"title":"KitchenItemOptionDto"},"KitchenItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"quantity":{"type":"number"},"sale_unit_symbol":{"type":"string","nullable":true,"example":"kg","description":"Symbol of the sale unit, kept on the line. Null for pieces."},"snapshot":{"type":"object","additionalProperties":true},"status":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"options":{"type":"array","items":{"$ref":"#/components/schemas/KitchenItemOptionDto"}}},"required":["id","quantity","snapshot","status","notes","options"],"title":"KitchenItemDto"},"KitchenOrderDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"serial_number":{"type":"number","nullable":true},"order_type":{"type":"string"},"status":{"type":"string"},"dine_in_details":{"type":"object","additionalProperties":true,"nullable":true},"drive_through_details":{"type":"object","additionalProperties":true,"nullable":true},"booking_details":{"type":"object","additionalProperties":true,"nullable":true},"notes":{"type":"string","nullable":true},"customer_name":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"scheduled_for":{"type":"string","nullable":true,"format":"date-time","description":"When the customer wants the order (e-menu scheduled pickup/delivery). Null means as soon as possible."},"field_values":{"description":"Custom per-branch order fields captured at checkout, in the owner's configured sort order. Labels are snapshots taken at order creation, so a later rename does not rewrite old tickets.","type":"array","items":{"$ref":"#/components/schemas/OrderFieldValueResponseDto"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/KitchenItemDto"}}},"required":["id","branch_id","serial_number","order_type","status","dine_in_details","drive_through_details","booking_details","notes","customer_name","created_at","field_values","items"],"title":"KitchenOrderDto"},"KitchenOrdersResponseDto":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/KitchenOrderDto"}}},"required":["orders"],"title":"KitchenOrdersResponseDto"},"DeliveryDetailsDto":{"type":"object","properties":{"address":{"type":"string"},"city":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"fee":{"type":"number"},"method":{"type":"string"},"company":{"type":"string"}},"title":"DeliveryDetailsDto"},"DriveThroughDetailsDto":{"type":"object","properties":{"vehicle_details":{"type":"string"}},"title":"DriveThroughDetailsDto"},"BookingDetailsDto":{"type":"object","properties":{"booking_date":{"type":"string"},"booking_time":{"type":"string"},"party_size":{"type":"number","minimum":1}},"title":"BookingDetailsDto"},"CreateOrderItemOptionDto":{"type":"object","properties":{"option_group_id":{"type":"string","format":"uuid"},"option_value_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":1,"default":1},"unit_price_delta":{"type":"number","description":"Price delta (positive = surcharge, negative = discount)"}},"required":["option_group_id","option_value_id","unit_price_delta"],"title":"CreateOrderItemOptionDto"},"CreateOrderItemDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"variant_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0,"description":"Supports fractional quantities (e.g. 1.5) for weight/volume products."},"unit_price":{"type":"number","minimum":0},"scanned_code":{"type":"string","pattern":"^\\d{12,13}$","example":"2010008005004","description":"The raw scale label scanned for this line (12 or 13 digits). The server re-parses it against the business's active formats for the order's branch, checks the label's item code is the product's `scale_code`, and refuses a `quantity` other than the label's (WEIGHT: the weight in the sale unit; PRICE: round3(label total ÷ unit price)). Stored on the line."},"scale_format_id":{"type":"string","format":"uuid","description":"The format the POS parsed `scanned_code` with. Optional: without it the server picks the one active format for the branch that reads the code. Ignored without `scanned_code`."},"custom_price":{"type":"boolean","description":"True when the cashier typed this line price by hand. `unit_price` is then kept as sent: price overrides and automatic promotions do not replace it. Option deltas still resolve."},"notes":{"type":"string","description":"Per-item preparation note visible to kitchen staff."},"options":{"type":"array","items":{"$ref":"#/components/schemas/CreateOrderItemOptionDto"}}},"required":["product_id","quantity","unit_price"],"title":"CreateOrderItemDto"},"PaymentEntryDto":{"type":"object","properties":{"payment_method_id":{"type":"string","format":"uuid","description":"RestaurantPaymentMethod id. Required unless gift_card_id is provided."},"gift_card_id":{"type":"string","description":"7-char gift card code. Required unless payment_method_id is provided.","example":"AB1CDE2"},"amount":{"type":"number","minimum":0,"description":"Payment amount. Required for payment-method entries and BALANCE gift cards. Omit or set to 0 for ITEMS-type gift cards — the amount is computed automatically from matching order items. May be 0 for fully-discounted orders where the order total is zero."},"notes":{"type":"string"}},"title":"PaymentEntryDto"},"PosServiceBookingDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"The SERVICE product being booked; must be one of `items`."},"staff_id":{"type":"string","format":"uuid","description":"Staff member to perform the service. Omit when no specific staff is required."},"scheduled_at":{"type":"string","description":"Scheduled start time (ISO 8601). Defaults to now (walk-in)."},"notes":{"type":"string"}},"required":["product_id"],"title":"PosServiceBookingDto"},"CreateOrderDto":{"type":"object","properties":{"order_type":{"enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"],"type":"string"},"customer_id":{"type":"string","format":"uuid"},"discount_id":{"type":"string","format":"uuid","description":"A catalog cashier discount to apply. The backend takes its type, value and cap from the catalog and records which discount was used; discount / discount_type are ignored when it is set."},"discount":{"type":"number","minimum":0,"description":"Ad-hoc cashier discount: a percentage (capped at 100) or a fixed amount (capped at the subtotal), per discount_type."},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"delivery_fee":{"type":"number","minimum":0},"loyalty_discount":{"type":"number","minimum":0,"deprecated":true,"description":"Ignored. The loyalty discount is derived server-side from loyalty_points_to_redeem."},"delivery_details":{"$ref":"#/components/schemas/DeliveryDetailsDto"},"dine_in_details":{"$ref":"#/components/schemas/DineInDetailsDto"},"drive_through_details":{"$ref":"#/components/schemas/DriveThroughDetailsDto"},"booking_details":{"$ref":"#/components/schemas/BookingDetailsDto"},"notes":{"type":"string"},"channel_id":{"type":"string","format":"uuid","description":"Ordering channel (e.g. Talabat). When provided, server applies channel price overrides."},"loyalty_pass_serial":{"type":"string","description":"Loyalty pass serial to award stamps to. When provided, stamps are awarded directly to this pass regardless of customerId. When omitted and a customerId is present, stamps are resolved via the customer record.","example":"NZB-RJ6"},"items":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CreateOrderItemDto"}},"expected_subtotal":{"type":"number","minimum":0,"description":"The items subtotal the cashier was shown: the sum of line totals, before any discount. When sent, an order the server prices differently is rejected with 409 ORDER_PRICES_CHANGED before anything is created. This happens, for example, when an automatic promotion started or ended after the till loaded its products. The error `data` carries the server `subtotal` and per-item prices, index-aligned with `items`."},"promo_code":{"type":"string","maxLength":40,"description":"Promotion code the customer presented, as checked via `POST /restaurants/:restaurantId/orders/promotion-quote`. Rejected with 400 PROMOTION_NOT_APPLICABLE when it does not apply to this order. Cannot be combined with `discount`/`discount_type`. A code that limits uses per customer needs `customer_id`.","example":"SUMMER26"},"custom_fields":{"description":"Values for branch-level custom order fields. Omit or pass [] when no fields are defined.","type":"array","items":{"$ref":"#/components/schemas/OrderCustomFieldDto"}},"payments":{"minItems":1,"description":"Settle the order in the same request. Each entry uses either a restaurant payment method or a gift card, exactly as `PATCH /orders/:id/payment` expects. When provided, payment is recorded right after the order is created and the response carries the resulting `payment_status`. Omit to create an UNPAID order and settle it later.","type":"array","items":{"$ref":"#/components/schemas/PaymentEntryDto"}},"loyalty_points_to_redeem":{"type":"number","minimum":0,"description":"Loyalty points to redeem while settling the order. Only applied when `payments` is provided."},"service_bookings":{"minItems":1,"description":"Staff/slot bookings for the bookable SERVICE lines in `items`, one per service product. Required for every bookable service in the order, and needs `customer_id`. The bookings are created in the same transaction as the order, so availability is verified before it exists. `order_type` defaults to SERVICE when this is set.","type":"array","items":{"$ref":"#/components/schemas/PosServiceBookingDto"}},"allow_oversell":{"type":"boolean","description":"Sell lines past the stock count of products that track availability. Needs `apply:stock_oversell:branch`. Without it, such an order is refused with `STOCK_OVERSELL_NEEDS_APPROVAL`, naming the lines and what is left."}},"required":["items"],"title":"CreateOrderDto"},"PosPriceQuoteDto":{"type":"object","properties":{"order_type":{"enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"],"type":"string","description":"Defaults to DINE_IN, as on create."},"items":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CreateOrderItemDto"}},"channel_id":{"type":"string","format":"uuid"}},"required":["items"],"title":"PosPriceQuoteDto"},"PriceQuoteOptionResponseDto":{"type":"object","properties":{"option_value_id":{"type":"string","format":"uuid"},"unit_price_delta":{"type":"number"}},"required":["option_value_id","unit_price_delta"],"title":"PriceQuoteOptionResponseDto"},"PriceQuoteItemResponseDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"variant_id":{"type":"string","nullable":true,"format":"uuid"},"unit_price":{"type":"number","description":"The unit price the order will charge for this line."},"options":{"type":"array","items":{"$ref":"#/components/schemas/PriceQuoteOptionResponseDto"}}},"required":["product_id","variant_id","unit_price","options"],"title":"PriceQuoteItemResponseDto"},"PosPriceQuoteResponseDto":{"type":"object","properties":{"subtotal":{"type":"number","description":"The items subtotal, before any discount."},"items":{"description":"One per request item, in request order.","type":"array","items":{"$ref":"#/components/schemas/PriceQuoteItemResponseDto"}}},"required":["subtotal","items"],"title":"PosPriceQuoteResponseDto"},"PosPromotionQuoteDto":{"type":"object","properties":{"code":{"type":"string","maxLength":40,"example":"SUMMER26"},"order_type":{"enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"],"type":"string","description":"Defaults to DINE_IN, as on create."},"items":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CreateOrderItemDto"}},"customer_id":{"type":"string","format":"uuid","description":"Needed when the code limits uses per customer."},"channel_id":{"type":"string","format":"uuid"}},"required":["code","items"],"title":"PosPromotionQuoteDto"},"UpdatePosOrderDto":{"type":"object","properties":{"order_type":{"enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"],"type":"string"},"notes":{"type":"string"},"table_number":{"type":"string","description":"Update dine-in table number in dineInDetails"},"discount_id":{"type":"string","nullable":true,"format":"uuid","description":"A catalog cashier discount to apply (null removes the discount). discount / discount_type are ignored when set."},"discount":{"type":"number","description":"Order-level discount amount or percent value"},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"delivery_address":{"type":"string","description":"Delivery address (stored in deliveryDetails.address)"},"delivery_company":{"type":"string","description":"Delivery company (stored in deliveryDetails.company)"},"delivery_method":{"type":"string","description":"Delivery method string (stored in deliveryDetails.method)"},"custom_dropdown_value":{"type":"object","additionalProperties":{},"description":"Free-form JSON map. Each key has { value, label }."},"hand_overed":{"type":"boolean","description":"Mark order as handed over to customer"},"customer_id":{"type":"string","format":"uuid","description":"Associate a customer with this order (e.g. during a table session before payment)"}},"title":"UpdatePosOrderDto"},"UpdateOrdersStatusDto":{"type":"object","properties":{"action":{"enum":["accept","reject"],"type":"string"},"status":{"enum":["PENDING","ACCEPTED","PREPARING","READY","COMPLETED","CANCELLED","VOIDED","REJECTED"],"type":"string"},"reason":{"type":"string"}},"title":"UpdateOrdersStatusDto"},"OrderItemReadyDto":{"type":"object","properties":{"is_ready":{"type":"boolean","description":"Optional; ignored (endpoint always sets ready)"}},"title":"OrderItemReadyDto"},"OrderItemKitchenStatusDto":{"type":"object","properties":{"status":{"enum":["PREPARING","READY"],"type":"string","description":"Kitchen line-item status. Stations start items with PREPARING, then READY."}},"required":["status"],"title":"OrderItemKitchenStatusDto"},"RecordPaymentDto":{"type":"object","properties":{"payments":{"minItems":1,"description":"Payment entries for this order. Each entry uses either a restaurant payment method or a gift card. This replaces any existing payment entries.","type":"array","items":{"$ref":"#/components/schemas/PaymentEntryDto"}},"loyalty_points_to_redeem":{"type":"number","minimum":0,"description":"Loyalty points to redeem against this order"},"customer_id":{"type":"string","format":"uuid","description":"Associate a customer with this order at payment time"},"loyalty_pass_serial":{"type":"string","description":"Loyalty pass serial to award stamps to after payment","example":"2Q2-LME"}},"required":["payments"],"title":"RecordPaymentDto"},"AddOrderPaymentDto":{"type":"object","properties":{"payment_method_id":{"type":"string","format":"uuid","description":"The tender this money came in on."},"amount":{"type":"number","minimum":0.01,"example":10,"description":"Amount received now."},"notes":{"type":"string"}},"required":["payment_method_id","amount"],"title":"AddOrderPaymentDto"},"ChangeOrderPaymentMethodDto":{"type":"object","properties":{"payment_method_id":{"type":"string","format":"uuid","description":"The tender the money actually came in on."}},"required":["payment_method_id"],"title":"ChangeOrderPaymentMethodDto"},"DeferOrderDto":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"Customer to bill, when the order has none yet. Optional — a walk-in tab is still a sale on account. Supplying one snapshots their ZATCA buyer fields before the invoice is issued."}},"title":"DeferOrderDto"},"CancelOrderDto":{"type":"object","properties":{"reason":{"type":"string","maxLength":500,"description":"Reason for cancellation"}},"title":"CancelOrderDto"},"VoidOrderResponseDto":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"title":"VoidOrderResponseDto"},"VoidOrderDto":{"type":"object","properties":{"reason":{"type":"string","maxLength":500,"description":"Reason for voiding (required for audit trail)"}},"required":["reason"],"title":"VoidOrderDto"},"KitchenStatusDto":{"type":"object","properties":{"status":{"enum":["ACCEPTED","PREPARING","READY","COMPLETED","REJECTED","VOIDED","CANCELLED"],"type":"string","description":"Status the kitchen is transitioning the order to. Forward path plus REJECTED / VOIDED / CANCELLED."},"reason":{"type":"string","maxLength":500,"description":"Required when rejecting or voiding. Stored as notes / voidReason."}},"required":["status"],"title":"KitchenStatusDto"},"ReturnItemDto":{"type":"object","properties":{"order_item_id":{"type":"string","format":"uuid","description":"UUID of the OrderItem being returned"},"quantity":{"type":"number","minimum":1,"description":"Quantity being returned (> 0). Supports fractional quantities (e.g. 1.5)."},"refund":{"type":"boolean","default":true,"description":"Whether the customer is refunded money for this item. Independent of the inventory disposition. Defaults to true."},"disposition":{"enum":["NONE","RESTOCK","WASTE"],"type":"string","description":"Inventory effect for this item, independent of `refund`. NONE = stock stays as sold, RESTOCK = put back on shelf, WASTE = record as wastage. Defaults to NONE (or derived from restoreInventory for legacy clients)."}},"required":["order_item_id","quantity"],"title":"ReturnItemDto"},"CreateOrderReturnDto":{"type":"object","properties":{"reason":{"type":"string","maxLength":500,"description":"Reason for the return"},"restore_inventory":{"type":"boolean","deprecated":true,"description":"DEPRECATED — use per-item `disposition` instead. Legacy fallback for items that omit disposition: true → RESTOCK, false → WASTE."},"items":{"minItems":1,"description":"Items and quantities to return","type":"array","items":{"$ref":"#/components/schemas/ReturnItemDto"}}},"required":["items"],"title":"CreateOrderReturnDto"},"RecordRefundDto":{"type":"object","properties":{"amount":{"type":"number","minimum":0.01,"description":"Amount of cash physically returned to the customer.","example":25.5},"payment_method_id":{"type":"string","description":"Restaurant payment method id the money was returned on. Preferred over `method`; when set, the refund is attributed to this method in the shift report."},"method":{"type":"string","description":"Payment method kind used for the refund (e.g. \"CASH\", \"CARD\"). Fallback when `paymentMethodId` is not provided.","example":"CASH"},"notes":{"type":"string","description":"Internal notes for this refund transaction."}},"required":["amount"],"title":"RecordRefundDto"},"UpdateOrderItemDto":{"type":"object","properties":{"quantity":{"type":"number","minimum":1,"description":"New quantity (> 0). Supports fractional quantities (e.g. 1.5). Only allowed while order is PENDING.","example":2},"notes":{"type":"string","maxLength":500,"description":"Item-level notes or special instructions.","example":"No onions"},"allow_oversell":{"type":"boolean","description":"Raise the quantity past the stock count of a product that tracks availability. Same rule as `allow_oversell` on order creation."}},"title":"UpdateOrderItemDto"},"AddTableSessionItemsDto":{"type":"object","properties":{"items":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CreateOrderItemDto"}},"allow_oversell":{"type":"boolean","description":"Sell lines past the stock count of products that track availability. Same rule as `allow_oversell` on order creation."}},"required":["items"],"title":"AddTableSessionItemsDto"},"LedgerPaymentMethodDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"type":{"type":"string"}},"required":["id","name","type"],"title":"LedgerPaymentMethodDto"},"LedgerBranchDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name"],"title":"LedgerBranchDto"},"LedgerCustomerDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true},"phone":{"type":"string"}},"required":["id","phone"],"title":"LedgerCustomerDto"},"LedgerOrderDto":{"type":"object","properties":{"id":{"type":"string"},"serial_number":{"type":"number","nullable":true},"order_type":{"type":"string"},"status":{"type":"string"},"payment_status":{"type":"string"},"deferred_at":{"type":"string","nullable":true,"format":"date-time","description":"When the sale was put on account (آجل). Stays set after the debt is paid off."},"total":{"type":"number","example":125.5},"paid":{"type":"number","description":"Sum of every payment on the order.","example":100},"due":{"type":"number","description":"What the order still owes, floored at zero.","example":25.5},"created_at":{"format":"date-time","type":"string"},"branch":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/LedgerBranchDto"}]},"customer":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/LedgerCustomerDto"}]}},"required":["id","order_type","status","payment_status","total","paid","due","created_at"],"title":"LedgerOrderDto"},"OrderPaymentListItemDto":{"type":"object","properties":{"id":{"type":"string"},"order_id":{"type":"string"},"amount":{"type":"number","example":100},"notes":{"type":"string","nullable":true},"gift_card_id":{"type":"string","nullable":true,"description":"7-char gift card code, when redeemed."},"payment_transaction_id":{"type":"string","nullable":true,"description":"Gateway transaction that captured this money. Its payment method cannot be changed."},"metadata":{"nullable":true,"description":"Gateway references and other per-payment facts; null for cash and most tenders.","type":"object","allOf":[{"$ref":"#/components/schemas/OrderPaymentMetadataDto"}]},"refund":{"nullable":true,"description":"Gateway refunds of this payment; null when none.","type":"object","allOf":[{"$ref":"#/components/schemas/OrderPaymentRefundSummaryDto"}]},"created_at":{"format":"date-time","type":"string","description":"When the money was taken."},"payment_method":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/LedgerPaymentMethodDto"}]},"order":{"$ref":"#/components/schemas/LedgerOrderDto"}},"required":["id","order_id","amount","created_at","order"],"title":"OrderPaymentListItemDto"},"OrderPaymentMethodTotalDto":{"type":"object","properties":{"payment_method_id":{"type":"string","nullable":true,"description":"null for the gift-card row."},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"type":{"type":"string","description":"Tender kind, or GIFT_CARD for the gift-card row."},"payment_count":{"type":"number","example":12},"amount":{"type":"number","example":1450.75}},"required":["name","type","payment_count","amount"],"title":"OrderPaymentMethodTotalDto"},"OrderPaymentTotalsDto":{"type":"object","properties":{"total_amount":{"type":"number","example":4820.25},"payment_count":{"type":"number","example":63},"by_method":{"type":"array","items":{"$ref":"#/components/schemas/OrderPaymentMethodTotalDto"}}},"required":["total_amount","payment_count","by_method"],"title":"OrderPaymentTotalsDto"},"OrderPaymentListResponseDto":{"type":"object","properties":{"payments":{"type":"array","items":{"$ref":"#/components/schemas/OrderPaymentListItemDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"},"totals":{"$ref":"#/components/schemas/OrderPaymentTotalsDto"}},"required":["payments","pagination","totals"],"title":"OrderPaymentListResponseDto"},"OutstandingStatusBreakdownDto":{"type":"object","properties":{"payment_status":{"type":"string","description":"Why the money is missing: DEFERRED (on account), PARTIAL, or UNPAID.","example":"DEFERRED"},"order_count":{"type":"number","example":3},"orders_total":{"type":"number","example":700},"paid_amount":{"type":"number","example":150},"outstanding_amount":{"type":"number","example":550}},"required":["payment_status","order_count","orders_total","paid_amount","outstanding_amount"],"title":"OutstandingStatusBreakdownDto"},"OutstandingSummaryDto":{"type":"object","properties":{"order_count":{"type":"number","description":"Orders still owing money.","example":7},"orders_total":{"type":"number","description":"Sum of those orders’ totals.","example":1200},"paid_amount":{"type":"number","description":"Already recorded against them.","example":310},"outstanding_amount":{"type":"number","description":"What is still owed.","example":890},"by_status":{"description":"The same figures split by payment status — DEFERRED is the credit book.","type":"array","items":{"$ref":"#/components/schemas/OutstandingStatusBreakdownDto"}}},"required":["order_count","orders_total","paid_amount","outstanding_amount","by_status"],"title":"OutstandingSummaryDto"},"FullScheduledSlotsResponseDto":{"type":"object","properties":{"full_slots":{"example":["2026-11-30T15:30:00.000Z"],"description":"UTC starts of the slot steps in [from, to) that have no seat left. Empty when the branch sets no limit or scheduling is off.","type":"array","items":{"type":"string"}}},"required":["full_slots"],"title":"FullScheduledSlotsResponseDto"},"GenerateCsrDto":{"type":"object","properties":{"common_name":{"type":"string","maxLength":200,"description":"Free-text name/asset tag for this solution unit."},"location":{"type":"string","maxLength":200,"description":"Branch/EGS unit physical location or website address."},"industry":{"type":"string","maxLength":200,"description":"Industry/sector the solution issues invoices for."},"group_tin":{"type":"string","example":"1234567890","description":"Required only when the restaurant's VAT number is a VAT Group registration (11th digit = \"1\"): the 10-digit TIN of the specific group member this EGS unit is being onboarded for. Ignored otherwise."},"environment":{"enum":["SANDBOX","PRODUCTION"],"type":"string","default":"SANDBOX","description":"Which ZATCA tier this EGS unit is onboarding against. This is not a cosmetic flag: it picks both the CSR's certificate-template extension (PREZATCA-Code-Signing vs ZATCA-Code-Signing) and the gateway base URL every later call uses (/e-invoicing/simulation vs /e-invoicing/core). OTPs from the Fatoora portal are tier-scoped — a production OTP sent to the simulation gateway comes back as \"The provided OTP is invalid\", so this must match the portal the OTP was generated in. Defaults to the registration's current tier, or SANDBOX for a new one."}},"required":["common_name","location","industry"],"title":"GenerateCsrDto"},"SubmitOtpDto":{"type":"object","properties":{"otp":{"type":"string","maxLength":20,"description":"OTP retrieved from the ZATCA Fatoora portal for this taxpayer."}},"required":["otp"],"title":"SubmitOtpDto"},"RenewCsidDto":{"type":"object","properties":{"common_name":{"type":"string","maxLength":200,"description":"Free-text name/asset tag for this solution unit."},"location":{"type":"string","maxLength":200,"description":"Branch/EGS unit physical location or website address."},"industry":{"type":"string","maxLength":200,"description":"Industry/sector the solution issues invoices for."},"group_tin":{"type":"string","example":"1234567890","description":"Required only when the restaurant's VAT number is a VAT Group registration (11th digit = \"1\"): the 10-digit TIN of the specific group member this EGS unit is being onboarded for. Ignored otherwise."},"environment":{"enum":["SANDBOX","PRODUCTION"],"type":"string","default":"SANDBOX","description":"Which ZATCA tier this EGS unit is onboarding against. This is not a cosmetic flag: it picks both the CSR's certificate-template extension (PREZATCA-Code-Signing vs ZATCA-Code-Signing) and the gateway base URL every later call uses (/e-invoicing/simulation vs /e-invoicing/core). OTPs from the Fatoora portal are tier-scoped — a production OTP sent to the simulation gateway comes back as \"The provided OTP is invalid\", so this must match the portal the OTP was generated in. Defaults to the registration's current tier, or SANDBOX for a new one."},"otp":{"type":"string","maxLength":20,"description":"OTP retrieved from the ZATCA Fatoora portal for this taxpayer."}},"required":["common_name","location","industry","otp"],"title":"RenewCsidDto"},"ZatcaInvoiceStatusResponseDto":{"type":"object","properties":{"id":{"type":"string"},"invoice_type":{"enum":["STANDARD","CREDIT_NOTE","DEBIT_NOTE"],"type":"string"},"submission_type":{"enum":["REPORTING","CLEARANCE"],"type":"string"},"status":{"enum":["PENDING","COMPLIANCE_CHECK_PENDING","COMPLIANCE_CHECK_PASSED","COMPLIANCE_CHECK_FAILED","QUEUED_FOR_SUBMISSION","CLEARANCE_PENDING","REPORTED","CLEARED","WARNING","REJECTED","FAILED","SLA_EXCEEDED"],"type":"string"},"qr_code":{"type":"string","nullable":true},"icv":{"type":"string","nullable":true,"description":"Invoice counter value, stringified (BigInt)."},"reporting_status":{"type":"string","nullable":true},"attempts":{"type":"number"},"next_retry_at":{"format":"date-time","type":"string","nullable":true},"submitted_at":{"format":"date-time","type":"string","nullable":true},"cleared_or_reported_at":{"format":"date-time","type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","invoice_type","submission_type","status","qr_code","icv","reporting_status","attempts","next_retry_at","submitted_at","cleared_or_reported_at","created_at","updated_at"],"title":"ZatcaInvoiceStatusResponseDto"},"ZatcaInvoiceListItemDto":{"type":"object","properties":{"id":{"type":"string"},"order_id":{"type":"string"},"order_serial_number":{"type":"number","nullable":true},"invoice_type":{"enum":["STANDARD","CREDIT_NOTE","DEBIT_NOTE"],"type":"string"},"submission_type":{"enum":["REPORTING","CLEARANCE"],"type":"string"},"status":{"enum":["PENDING","COMPLIANCE_CHECK_PENDING","COMPLIANCE_CHECK_PASSED","COMPLIANCE_CHECK_FAILED","QUEUED_FOR_SUBMISSION","CLEARANCE_PENDING","REPORTED","CLEARED","WARNING","REJECTED","FAILED","SLA_EXCEEDED"],"type":"string"},"environment":{"enum":["SANDBOX","PRODUCTION"],"type":"string"},"icv":{"type":"string","nullable":true,"description":"Invoice counter value, stringified (BigInt)."},"buyer_name":{"type":"string","nullable":true},"total":{"type":"string","description":"Order total, stringified decimal."},"submitted_at":{"format":"date-time","type":"string","nullable":true},"cleared_or_reported_at":{"format":"date-time","type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"}},"required":["id","order_id","order_serial_number","invoice_type","submission_type","status","environment","icv","buyer_name","total","submitted_at","cleared_or_reported_at","created_at"],"title":"ZatcaInvoiceListItemDto"},"ZatcaInvoiceListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ZatcaInvoiceListItemDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ZatcaInvoiceListResponseDto"},"ZatcaInvoiceDetailDto":{"type":"object","properties":{"id":{"type":"string"},"order_id":{"type":"string"},"order_serial_number":{"type":"number","nullable":true},"order_return_id":{"type":"string","nullable":true},"invoice_type":{"enum":["STANDARD","CREDIT_NOTE","DEBIT_NOTE"],"type":"string"},"submission_type":{"enum":["REPORTING","CLEARANCE"],"type":"string"},"status":{"enum":["PENDING","COMPLIANCE_CHECK_PENDING","COMPLIANCE_CHECK_PASSED","COMPLIANCE_CHECK_FAILED","QUEUED_FOR_SUBMISSION","CLEARANCE_PENDING","REPORTED","CLEARED","WARNING","REJECTED","FAILED","SLA_EXCEEDED"],"type":"string"},"environment":{"enum":["SANDBOX","PRODUCTION"],"type":"string"},"uuid":{"type":"string"},"icv":{"type":"string","nullable":true,"description":"Invoice counter value, stringified (BigInt)."},"invoice_hash":{"type":"string","nullable":true},"previous_invoice_hash":{"type":"string","nullable":true},"billing_reference_uuid":{"type":"string","nullable":true},"qr_code":{"type":"string","nullable":true},"buyer_name":{"type":"string","nullable":true},"total":{"type":"string","description":"Order total, stringified decimal."},"reporting_status":{"type":"string","nullable":true},"attempts":{"type":"number"},"next_retry_at":{"format":"date-time","type":"string","nullable":true},"submitted_at":{"format":"date-time","type":"string","nullable":true},"cleared_or_reported_at":{"format":"date-time","type":"string","nullable":true},"zatca_response":{"type":"object","nullable":true,"description":"ZATCA's raw response payload for this invoice."},"signed_xml_available":{"type":"boolean","description":"Whether the signed (unsigned-cleared) XML is available to view."},"cleared_xml_available":{"type":"boolean","description":"Whether the ZATCA-cleared XML (Clearance only) is available."},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","order_id","order_serial_number","order_return_id","invoice_type","submission_type","status","environment","uuid","icv","invoice_hash","previous_invoice_hash","billing_reference_uuid","qr_code","buyer_name","total","reporting_status","attempts","next_retry_at","submitted_at","cleared_or_reported_at","zatca_response","signed_xml_available","cleared_xml_available","created_at","updated_at"],"title":"ZatcaInvoiceDetailDto"},"ResubmitZatcaInvoicesDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid","description":"Limit to one restaurant."},"invoice_ids":{"maxItems":1000,"description":"Explicit OrderZatcaInvoice ids (primary keys). When set, other filters are ignored.","type":"array","items":{"type":"string","format":"uuid"}},"statuses":{"type":"array","items":{"type":"string","enum":["PENDING","QUEUED_FOR_SUBMISSION","CLEARANCE_PENDING","FAILED","SLA_EXCEEDED","REJECTED"]},"description":"Defaults to FAILED, SLA_EXCEEDED, CLEARANCE_PENDING and QUEUED_FOR_SUBMISSION."},"created_from":{"type":"string","description":"Only rows created at or after this instant (ISO 8601)."},"created_to":{"type":"string","description":"Only rows created before this instant (ISO 8601)."},"rebuild":{"type":"boolean","description":"Discard the stored signed XML so the invoice is rebuilt (fresh ICV/PIH) before submission. Credit/debit notes signed without a KSA-10 reason are always rebuilt regardless of this flag.","default":false},"dry_run":{"type":"boolean","description":"Report what would be queued without changing anything.","default":false},"limit":{"type":"number","minimum":1,"maximum":2000,"description":"Maximum rows to process in this call.","default":500}},"title":"ResubmitZatcaInvoicesDto"},"ResubmitZatcaInvoicesResponseDto":{"type":"object","properties":{"matched":{"type":"number","description":"Rows matched by the filter (capped by limit)."},"rebuilt":{"type":"number","description":"Rows whose signed XML was discarded so they rebuild."},"queued":{"type":"number","description":"Rows pushed onto the ZATCA queue."},"dry_run":{"type":"boolean","description":"True when nothing was changed."},"invoice_ids":{"description":"Primary keys of the affected rows.","type":"array","items":{"type":"string"}}},"required":["matched","rebuilt","queued","dry_run","invoice_ids"],"title":"ResubmitZatcaInvoicesResponseDto"},"CustomIconsDto":{"type":"object","properties":{"icon_on":{"type":"string"},"icon_off":{"type":"string"}},"required":["icon_on","icon_off"],"title":"CustomIconsDto"},"ServiceLabelDto":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"title":"ServiceLabelDto"},"CreateThemeSettingDto":{"type":"object","properties":{"total_stamps":{"type":"number","minimum":1,"maximum":30},"is_all_products":{"type":"boolean","default":true},"product_ids":{"default":[],"type":"array","items":{"type":"string"}},"count_method":{"enum":["per_order","per_item"],"type":"string"},"text_color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","default":"#FFFFFF"},"background_color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","default":"#3B82F6"},"hero_bg_color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"icon_id":{"type":"string","format":"uuid"},"custom_icons":{"$ref":"#/components/schemas/CustomIconsDto"},"hero_image":{"type":"string"},"service":{"$ref":"#/components/schemas/ServiceLabelDto"},"header_label":{"type":"string","maxLength":60,"example":"Loyalty Card","description":"Short text at the right edge of the pass header (next to the restaurant name). Defaults to the restaurant's Arabic name when null. Max 60 chars."},"reward_title":{"type":"string","maxLength":120,"example":"Free Coffee","description":"Reward title shown on the back of the pass. Max 120 chars."},"reward_description":{"type":"string","maxLength":500,"example":"Collect 8 stamps for one free coffee of any size.","description":"Reward description shown alongside the reward title."},"terms_and_conditions":{"type":"string","maxLength":1000,"example":"Present this pass at checkout. One stamp per qualifying purchase. Not combinable with other offers.","description":"Terms & conditions text shown on the back of the pass."},"promo_text":{"type":"string","maxLength":200,"example":"Visit on Tuesdays for double stamps!","description":"Always-on promo text shown on the back of the pass. Overridden by an active dynamic promo alert when one is sent."}},"required":["total_stamps","count_method","icon_id"],"title":"CreateThemeSettingDto"},"LoyaltyPassIconDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","nullable":true,"format":"uuid","description":"null = platform-wide public icon; set = restaurant-owned custom icon"},"icon_name":{"type":"string","example":"coffee"},"display_name":{"type":"object","additionalProperties":{"type":"string"},"nullable":true,"example":{"ar":"قهوة","en":"Coffee"}},"icon_light_on":{"type":"string","example":"data:image/svg+xml;base64,..."},"icon_light_off":{"type":"string","example":"data:image/svg+xml;base64,..."},"icon_dark_on":{"type":"string","example":"data:image/svg+xml;base64,..."},"icon_dark_off":{"type":"string","example":"data:image/svg+xml;base64,..."},"default_hero_image":{"type":"string","example":"https://example.com/hero.png"}},"required":["id","icon_name","icon_light_on","icon_light_off","icon_dark_on","icon_dark_off","default_hero_image"],"title":"LoyaltyPassIconDto"},"LoyaltyPassThemeDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"total_stamps":{"type":"number","example":8,"minimum":1,"maximum":30},"is_all_products":{"type":"boolean","example":true},"product_ids":{"example":[],"type":"array","items":{"type":"string"}},"service":{"type":"object","additionalProperties":{"type":"string"},"nullable":true,"example":{"ar":"زيارة","en":"Visit"}},"count_method":{"type":"string","enum":["per_order","per_item"],"example":"per_order"},"text_color":{"type":"string","nullable":true,"example":"#FFFFFF"},"background_color":{"type":"string","nullable":true,"example":"#B45309"},"hero_bg_color":{"type":"string","nullable":true,"example":"#92400E"},"icon_id":{"type":"string","format":"uuid"},"custom_icons":{"type":"object","additionalProperties":{},"nullable":true},"hero_image":{"type":"string","nullable":true},"header_label":{"type":"string","nullable":true},"reward_title":{"type":"string","nullable":true},"reward_description":{"type":"string","nullable":true},"terms_and_conditions":{"type":"string","nullable":true},"promo_text":{"type":"string","nullable":true},"icon":{"$ref":"#/components/schemas/LoyaltyPassIconDto"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"archived_at":{"type":"string","nullable":true,"format":"date-time","description":"When set, the theme is archived (hidden from pickers, blocks new passes)."}},"required":["id","restaurant_id","total_stamps","is_all_products","product_ids","count_method","icon_id","icon","created_at","updated_at"],"title":"LoyaltyPassThemeDto"},"UpdateThemeSettingDto":{"type":"object","properties":{"total_stamps":{"type":"number","minimum":1,"maximum":30},"is_all_products":{"type":"boolean","default":true},"product_ids":{"default":[],"type":"array","items":{"type":"string"}},"count_method":{"enum":["per_order","per_item"],"type":"string"},"text_color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","default":"#FFFFFF"},"background_color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","default":"#3B82F6"},"hero_bg_color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"icon_id":{"type":"string","format":"uuid"},"custom_icons":{"$ref":"#/components/schemas/CustomIconsDto"},"hero_image":{"type":"string"},"service":{"$ref":"#/components/schemas/ServiceLabelDto"},"header_label":{"type":"string","maxLength":60,"example":"Loyalty Card","description":"Short text at the right edge of the pass header (next to the restaurant name). Defaults to the restaurant's Arabic name when null. Max 60 chars."},"reward_title":{"type":"string","maxLength":120,"example":"Free Coffee","description":"Reward title shown on the back of the pass. Max 120 chars."},"reward_description":{"type":"string","maxLength":500,"example":"Collect 8 stamps for one free coffee of any size.","description":"Reward description shown alongside the reward title."},"terms_and_conditions":{"type":"string","maxLength":1000,"example":"Present this pass at checkout. One stamp per qualifying purchase. Not combinable with other offers.","description":"Terms & conditions text shown on the back of the pass."},"promo_text":{"type":"string","maxLength":200,"example":"Visit on Tuesdays for double stamps!","description":"Always-on promo text shown on the back of the pass. Overridden by an active dynamic promo alert when one is sent."}},"title":"UpdateThemeSettingDto"},"LoyaltyPassDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"pass_serial":{"type":"string","example":"AHM-001"},"loyalty_pass_theme_setting_id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","nullable":true,"format":"uuid"},"user_name":{"type":"string","example":"Ahmad Al-Rashid"},"user_phone_no":{"type":"string","example":"+966501000001"},"current_stamps":{"type":"number","example":3},"qr_code_data":{"type":"string","example":"AHM-001"},"dynamic_message":{"type":"string","nullable":true},"voided_at":{"type":"string","nullable":true,"format":"date-time","description":"When set, the pass is voided. Wallet shows it as expired and stamp/redeem are blocked."},"theme_setting":{"$ref":"#/components/schemas/LoyaltyPassThemeDto"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","pass_serial","loyalty_pass_theme_setting_id","user_name","user_phone_no","current_stamps","qr_code_data","theme_setting","created_at","updated_at"],"title":"LoyaltyPassDto"},"LoyaltyPassListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyPassDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"LoyaltyPassListDto"},"AddStampsDto":{"type":"object","properties":{"stamps_to_add":{"type":"number","minimum":1}},"required":["stamps_to_add"],"title":"AddStampsDto"},"LoyaltyPassRedemptionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"loyalty_pass_id":{"type":"string","nullable":true,"format":"uuid"},"pass_serial":{"type":"string","example":"AHM-001"},"user_name":{"type":"string","example":"Ahmad Al-Rashid"},"user_phone_no":{"type":"string","example":"+966501000001"},"stamps_before_redeem":{"type":"number","example":8},"loyalty_pass_service":{"type":"string","nullable":true,"example":"Visit"},"redeemed_at":{"format":"date-time","type":"string"}},"required":["id","pass_serial","user_name","user_phone_no","stamps_before_redeem","redeemed_at"],"title":"LoyaltyPassRedemptionDto"},"PromoAlertDto":{"type":"object","properties":{"message":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":100,"default":"Special Offer"}},"required":["message"],"title":"PromoAlertDto"},"PromoAlertResultDto":{"type":"object","properties":{"sent":{"type":"number","example":0,"description":"Always 0 — the actual send happens in a queue worker."},"failed":{"type":"number","example":0},"pass_count":{"type":"number","example":10,"description":"Number of passes that will be refreshed by the worker."},"device_count":{"type":"number","example":0},"queued":{"type":"boolean","example":true,"description":"Indicates the work was enqueued for background processing."}},"required":["sent","failed","pass_count","device_count","queued"],"title":"PromoAlertResultDto"},"GeoAlertSettingsDto":{"type":"object","properties":{"geo_alert_message":{"type":"string","nullable":true},"max_distance_meters":{"type":"number","example":1000}},"required":["geo_alert_message","max_distance_meters"],"title":"GeoAlertSettingsDto"},"GeoAlertMessageDto":{"type":"object","properties":{"message":{"type":"string","maxLength":200,"description":"Lock-screen message shown when the device is near a branch. Supports {restaurant} and {branch} placeholders."},"max_distance_meters":{"type":"number","minimum":100,"maximum":10000,"description":"Geofence radius around each branch, in metres. Defaults to 1000. Range 100–10000.","default":1000,"example":1500}},"required":["message"],"title":"GeoAlertMessageDto"},"CreateLoyaltyPassDto":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"Staff flow — link pass directly to an existing customer record."},"user_name":{"type":"string","maxLength":255,"description":"Public / guest flow — required when customer_id is absent."},"user_phone_no":{"type":"string","maxLength":20,"description":"Public / guest flow — required when customer_id is absent."}},"title":"CreateLoyaltyPassDto"},"JoinLoyaltyPassDto":{"type":"object","properties":{"phone_no":{"type":"string","maxLength":20,"example":"+966501000001","description":"International phone number in E.164 format (e.g. +966501000001, +201127677496)"},"user_name":{"type":"string","maxLength":255,"example":"Ahmad Al-Rashid","description":"Required only for new customers"}},"required":["phone_no"],"title":"JoinLoyaltyPassDto"},"LoyaltyPassJoinResultDto":{"type":"object","properties":{"status":{"enum":["found","created","needs_registration"],"type":"string","description":"\"found\" = pass already existed, \"created\" = new pass, \"needs_registration\" = customer unknown (frontend should ask for name)"},"pass_serial":{"type":"string","example":"AHM-001"},"user_name":{"type":"string","example":"Ahmad Al-Rashid"}},"required":["status"],"title":"LoyaltyPassJoinResultDto"},"GoogleWalletLinkDto":{"type":"object","properties":{},"title":"GoogleWalletLinkDto"},"PlatformIconDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","nullable":true,"format":"uuid","description":"null = platform-wide public icon; set = restaurant-owned custom icon"},"icon_name":{"type":"string","example":"coffee"},"display_name":{"type":"object","additionalProperties":{"type":"string"},"nullable":true,"example":{"ar":"قهوة","en":"Coffee"}},"icon_light_on":{"type":"string","example":"data:image/svg+xml;base64,..."},"icon_light_off":{"type":"string","example":"data:image/svg+xml;base64,..."},"icon_dark_on":{"type":"string","example":"data:image/svg+xml;base64,..."},"icon_dark_off":{"type":"string","example":"data:image/svg+xml;base64,..."},"default_hero_image":{"type":"string","example":"https://example.com/hero.png"},"archived_at":{"type":"string","nullable":true,"format":"date-time","description":"When set, the icon is retired: hidden from pickers, blocked for new themes."},"themes_count":{"type":"number","description":"How many restaurant themes currently use this icon.","example":3}},"required":["id","icon_name","icon_light_on","icon_light_off","icon_dark_on","icon_dark_off","default_hero_image","themes_count"],"title":"PlatformIconDto"},"UploadResponseDto":{"type":"object","properties":{"url":{"type":"string"},"feature_key":{"type":"string"}},"required":["url","feature_key"],"title":"UploadResponseDto"},"LoyaltyOrderSummaryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"serial_number":{"type":"number","nullable":true},"total":{"type":"number"},"created_at":{"format":"date-time","type":"string"}},"required":["id","serial_number","total","created_at"],"title":"LoyaltyOrderSummaryDto"},"LoyaltyTransactionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"order_id":{"type":"string","nullable":true,"format":"uuid"},"type":{"enum":["EARN","REDEEM","EXPIRE","ADJUSTMENT"],"type":"string"},"points":{"type":"number","description":"Positive = credit (earn/adjustment), negative = debit (redeem/expire)."},"balance_after":{"type":"number","description":"Customer balance immediately after this transaction."},"expires_at":{"type":"string","nullable":true,"format":"date-time"},"expired_at":{"type":"string","nullable":true,"format":"date-time"},"note":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"order":{"description":"Present when `expand=order` is requested.","allOf":[{"$ref":"#/components/schemas/LoyaltyOrderSummaryDto"}]}},"required":["id","customer_id","restaurant_id","order_id","type","points","balance_after","expires_at","expired_at","note","created_at"],"title":"LoyaltyTransactionDto"},"LoyaltyTransactionListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyTransactionDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"LoyaltyTransactionListDto"},"ServiceBookingStaffDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"title":"ServiceBookingStaffDto"},"ServiceBookingCustomerDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"phone":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["id","name","phone","email"],"title":"ServiceBookingCustomerDto"},"ServiceBookingProductDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"type":{"type":"string"},"service_duration":{"type":"number","nullable":true},"service_buffer":{"type":"number","nullable":true}},"required":["id","name","name_ar","type","service_duration","service_buffer"],"title":"ServiceBookingProductDto"},"ServiceBookingDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"order_id":{"type":"string","nullable":true,"format":"uuid"},"staff_id":{"type":"string","nullable":true,"format":"uuid"},"staff_name":{"type":"string","nullable":true},"customer_id":{"type":"string","format":"uuid"},"product_id":{"type":"string","nullable":true,"format":"uuid"},"product_name":{"type":"string","nullable":true},"scheduled_at":{"format":"date-time","type":"string"},"ends_at":{"format":"date-time","type":"string"},"duration_minutes":{"type":"number","example":30,"description":"Actual service time in minutes (excluding buffer)"},"buffer_minutes":{"type":"number","example":10,"description":"Cleanup/prep time after service in minutes"},"status":{"enum":["PENDING_ADVANCE","SCHEDULED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW"],"type":"string"},"notes":{"type":"string","nullable":true},"advance_amount":{"type":"number","nullable":true,"description":"Advance payment amount required"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"advance_paid_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"staff":{"nullable":true,"description":"Present when `expand=staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ServiceBookingStaffDto"}]},"customer":{"description":"Present when `expand=customer` is requested","allOf":[{"$ref":"#/components/schemas/ServiceBookingCustomerDto"}]},"product":{"nullable":true,"description":"Present when `expand=product` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ServiceBookingProductDto"}]}},"required":["id","restaurant_id","branch_id","order_id","staff_id","staff_name","customer_id","product_id","product_name","scheduled_at","ends_at","duration_minutes","buffer_minutes","status","notes","advance_amount","currency","advance_paid_at","created_at","updated_at"],"title":"ServiceBookingDto"},"ServiceBookingListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ServiceBookingDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ServiceBookingListDto"},"AvailableSlotsResponseDto":{"type":"object","properties":{"date":{"type":"string","example":"2026-06-22"},"staff_id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"slots":{"example":["09:00","09:45","10:30"],"description":"Available start times in HH:mm (branch local time)","type":"array","items":{"type":"string"}}},"required":["date","staff_id","product_id","slots"],"title":"AvailableSlotsResponseDto"},"CreateServiceBookingDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid","description":"Customer (must be registered via e-menu)"},"product_id":{"type":"string","format":"uuid","description":"SERVICE product being booked"},"staff_id":{"type":"string","format":"uuid","description":"Staff member — required for scheduled bookings, omit for walk-in"},"scheduled_at":{"type":"string","description":"Scheduled start time — defaults to now for walk-in"},"duration_minutes":{"type":"number","minimum":1,"description":"Overrides product.serviceDuration when provided"},"buffer_minutes":{"type":"number","minimum":0,"description":"Overrides product.serviceBuffer when provided. Total blocked time = durationMinutes + bufferMinutes."},"order_id":{"type":"string","format":"uuid"},"create_order":{"type":"boolean","default":false,"description":"Atomically create a SERVICE order linked to this booking"},"notes":{"type":"string"}},"required":["branch_id","customer_id"],"title":"CreateServiceBookingDto"},"UpdateServiceBookingDto":{"type":"object","properties":{"staff_id":{"type":"string","format":"uuid"},"scheduled_at":{"type":"string"},"duration_minutes":{"type":"number","minimum":1},"buffer_minutes":{"type":"number","minimum":0},"status":{"enum":["PENDING_ADVANCE","SCHEDULED","IN_PROGRESS","COMPLETED","CANCELLED","NO_SHOW"],"type":"string"},"notes":{"type":"string"}},"title":"UpdateServiceBookingDto"},"PublicStaffForServiceDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"title":"PublicStaffForServiceDto"},"AvailableStaffMemberDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slots":{"example":["09:00","09:40","10:20"],"description":"Available start times in HH:mm (branch local time)","type":"array","items":{"type":"string"}}},"required":["id","name","slots"],"title":"AvailableStaffMemberDto"},"AvailableStaffForDateResponseDto":{"type":"object","properties":{"date":{"type":"string","example":"2026-06-22"},"product_id":{"type":"string","format":"uuid"},"staff":{"type":"array","items":{"$ref":"#/components/schemas/AvailableStaffMemberDto"}}},"required":["date","product_id","staff"],"title":"AvailableStaffForDateResponseDto"},"OccupancyBlockDto":{"type":"object","properties":{"start":{"type":"string","example":"2026-06-22T09:00:00.000Z"},"end":{"type":"string","example":"2026-06-22T09:45:00.000Z","description":"start + service duration + buffer"}},"required":["start","end"],"title":"OccupancyBlockDto"},"StaffLessOccupancyResponseDto":{"type":"object","properties":{"capacity":{"type":"number","nullable":true,"example":3,"description":"Bookings one slot can take. null = unlimited, or the service has assigned staff at this branch: hide nothing."},"blocks":{"description":"Live staff-less bookings and holds of this service at this branch touching the date. Hide a start t when the blocks overlapping [t, t + duration + buffer) reach capacity.","type":"array","items":{"$ref":"#/components/schemas/OccupancyBlockDto"}}},"required":["capacity","blocks"],"title":"StaffLessOccupancyResponseDto"},"StaffUserDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Dana Cashier"},"name_ar":{"type":"string","nullable":true,"example":"دانا"},"email":{"type":"string","example":"cashier@burger-palace.com"},"phone":{"type":"string","nullable":true,"example":"+966500000000"},"is_active":{"type":"boolean","example":true}},"required":["id","name","name_ar","email","phone","is_active"],"title":"StaffUserDto"},"StaffMemberBranchDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Burger Palace - Main St"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"StaffMemberBranchDto"},"StaffMemberDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"user_id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"role":{"enum":["RESTAURANT_ADMIN","BRANCH_MANAGER","CASHIER","WAITER","KITCHEN","SERVICE_PROVIDER"],"type":"string","example":"CASHIER"},"permissions":{"type":"array","items":{"type":"string"}},"permissions_version":{"type":"number","example":0},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"user":{"$ref":"#/components/schemas/StaffUserDto"},"branches":{"type":"array","items":{"$ref":"#/components/schemas/StaffMemberBranchDto"}}},"required":["id","user_id","restaurant_id","role","permissions","permissions_version","created_at","updated_at","user","branches"],"title":"StaffMemberDto"},"StaffListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StaffMemberDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"StaffListResponseDto"},"AddMembershipDto":{"type":"object","properties":{"user_id":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["RESTAURANT_ADMIN","BRANCH_MANAGER","CASHIER","WAITER","KITCHEN","SERVICE_PROVIDER"]},"name":{"type":"string","minLength":1,"maxLength":120},"name_ar":{"type":"string","nullable":true,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email"},"phone":{"type":"string","maxLength":32,"pattern":"^\\+?[0-9]{6,20}$"},"password":{"type":"string","minLength":6,"maxLength":128},"is_active":{"type":"boolean"}},"required":["role"],"title":"AddMembershipDto"},"UpdateMembershipRoleDto":{"type":"object","properties":{"role":{"type":"string","enum":["RESTAURANT_ADMIN","BRANCH_MANAGER","CASHIER","WAITER","KITCHEN","SERVICE_PROVIDER"]}},"required":["role"],"title":"UpdateMembershipRoleDto"},"UpdateStaffUserDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"name_ar":{"type":"string","nullable":true,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email"},"phone":{"type":"string","nullable":true,"maxLength":32,"pattern":"^\\+?[0-9]{6,20}$"},"password":{"type":"string","minLength":6,"maxLength":128},"is_active":{"type":"boolean"}},"title":"UpdateStaffUserDto"},"BranchAssignmentUserDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Dana Cashier"},"email":{"type":"string","example":"cashier@burger-palace.com"}},"required":["id","name","email"],"title":"BranchAssignmentUserDto"},"BranchAssignmentDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"user_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"user":{"$ref":"#/components/schemas/BranchAssignmentUserDto"},"branch":{"$ref":"#/components/schemas/BranchSummaryDto"}},"required":["id","user_id","branch_id","created_at","updated_at","user","branch"],"title":"BranchAssignmentDto"},"AssignBranchDto":{"type":"object","properties":{"user_id":{"type":"string","format":"uuid"}},"required":["user_id"],"title":"AssignBranchDto"},"StaffAvailabilityScheduleDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"staff_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"day_of_week":{"enum":["SAT","SUN","MON","TUE","WED","THU","FRI"],"type":"string"},"start_time":{"type":"string","example":"09:00"},"end_time":{"type":"string","example":"18:00"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","staff_id","branch_id","day_of_week","start_time","end_time","is_active","created_at","updated_at"],"title":"StaffAvailabilityScheduleDto"},"StaffAvailabilitySlotDto":{"type":"object","properties":{"day_of_week":{"enum":["SAT","SUN","MON","TUE","WED","THU","FRI"],"type":"string"},"start_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","example":"09:00","description":"Start time HH:mm (24h)"},"end_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","example":"18:00","description":"End time HH:mm (24h)"},"is_active":{"type":"boolean","default":true}},"required":["day_of_week","start_time","end_time"],"title":"StaffAvailabilitySlotDto"},"ReplaceStaffAvailabilityDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"slots":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/StaffAvailabilitySlotDto"}}},"required":["branch_id","slots"],"title":"ReplaceStaffAvailabilityDto"},"ServiceRefDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"title":"ServiceRefDto"},"BranchRefDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"title":"BranchRefDto"},"StaffServiceAssignmentDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"staff_id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"is_active":{"type":"boolean"},"product":{"$ref":"#/components/schemas/ServiceRefDto"},"branch":{"$ref":"#/components/schemas/BranchRefDto"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","staff_id","product_id","branch_id","is_active","product","branch","created_at","updated_at"],"title":"StaffServiceAssignmentDto"},"CreateStaffServiceAssignmentDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"}},"required":["product_id","branch_id"],"title":"CreateStaffServiceAssignmentDto"},"StaffForServiceDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"assignment_id":{"type":"string","format":"uuid","description":"StaffServiceAssignment id (for unlink)"}},"required":["id","name","email","assignment_id"],"title":"StaffForServiceDto"},"GeoJsonPolygonDto":{"type":"object","properties":{"type":{"type":"string","enum":["Polygon"],"example":"Polygon"},"coordinates":{"type":"array","description":"GeoJSON coordinates array: [[[lng, lat], ...]]","items":{"type":"array","items":{"type":"array","items":{"type":"number"}}},"example":[[[46.6,24.7],[46.7,24.7],[46.7,24.8],[46.6,24.8],[46.6,24.7]]]}},"required":["type","coordinates"],"title":"GeoJsonPolygonDto"},"DeliveryZoneResponseDto":{"type":"object","properties":{"id":{"type":"string"},"branch_id":{"type":"string"},"restaurant_id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"polygon":{"description":"GeoJSON Polygon geometry","allOf":[{"$ref":"#/components/schemas/GeoJsonPolygonDto"}]},"delivery_fee":{"type":"number","nullable":true,"description":"Zone-specific fixed delivery fee. Overrides branch fee settings when set."},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","branch_id","restaurant_id","name","polygon","currency","is_active","created_at","updated_at"],"title":"DeliveryZoneResponseDto"},"CreateDeliveryZoneDto":{"type":"object","properties":{"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"polygon":{"$ref":"#/components/schemas/GeoJsonPolygonDto"},"delivery_fee":{"type":"number","minimum":0,"nullable":true,"description":"Zone-specific fixed fee. Overrides branch fee settings when set."},"is_active":{"type":"boolean","default":true}},"required":["name","polygon"],"title":"CreateDeliveryZoneDto"},"UpdateDeliveryZoneDto":{"type":"object","properties":{"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"polygon":{"$ref":"#/components/schemas/GeoJsonPolygonDto"},"delivery_fee":{"type":"number","minimum":0,"nullable":true,"description":"Zone-specific fixed fee. Overrides branch fee settings when set."},"is_active":{"type":"boolean","default":true}},"title":"UpdateDeliveryZoneDto"},"DeliverySettingsResponseDto":{"type":"object","properties":{"branch_id":{"type":"string"},"fee_type":{"nullable":true,"enum":["FIXED","PER_KM"],"type":"string"},"fixed_fee":{"type":"number","nullable":true},"fee_per_km":{"type":"number","nullable":true},"base_fee":{"type":"number"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"}},"required":["branch_id","base_fee","currency"],"title":"DeliverySettingsResponseDto"},"UpsertDeliverySettingsDto":{"type":"object","properties":{"fee_type":{"enum":["FIXED","PER_KM"],"type":"string"},"fixed_fee":{"type":"number","minimum":0,"description":"Required when feeType is FIXED"},"fee_per_km":{"type":"number","minimum":0,"description":"Cost per kilometre. Required when feeType is PER_KM"},"base_fee":{"type":"number","minimum":0,"description":"Base fee added on top of the per-km calculation","default":0}},"required":["fee_type"],"title":"UpsertDeliverySettingsDto"},"PatchDeliverySettingsDto":{"type":"object","properties":{"fee_type":{"enum":["FIXED","PER_KM"],"type":"string"},"fixed_fee":{"type":"number","minimum":0,"description":"Required when feeType is FIXED"},"fee_per_km":{"type":"number","minimum":0,"description":"Cost per kilometre. Required when feeType is PER_KM"},"base_fee":{"type":"number","minimum":0,"description":"Base fee added on top of the per-km calculation","default":0}},"title":"PatchDeliverySettingsDto"},"CheckDeliveryLocationDto":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90,"example":24.7136},"lng":{"type":"number","minimum":-180,"maximum":180,"example":46.6753}},"required":["lat","lng"],"title":"CheckDeliveryLocationDto"},"CheckDeliveryLocationResponseDto":{"type":"object","properties":{"in_zone":{"type":"boolean"},"zone_name":{"type":"string","nullable":true},"zone_name_ar":{"type":"string","nullable":true},"estimated_fee":{"type":"number","nullable":true},"fee_type":{"nullable":true,"enum":["FIXED","PER_KM"],"type":"string"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"}},"required":["in_zone","currency"],"title":"CheckDeliveryLocationResponseDto"},"ScaleBarcodeCollisionResponseDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"variant_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string"},"barcode":{"type":"string"}},"required":["product_id","variant_id","name","barcode"],"title":"ScaleBarcodeCollisionResponseDto"},"ScaleBarcodeFormatResponseDto":{"type":"object","properties":{"symbology":{"enum":["EAN13","UPCA"],"type":"string"},"prefix":{"type":"string"},"item_code_start":{"type":"number","description":"0-based offset into the whole code."},"item_code_length":{"type":"number"},"value_start":{"type":"number","description":"0-based offset into the whole code."},"value_length":{"type":"number"},"value_type":{"enum":["WEIGHT","PRICE"],"type":"string"},"value_unit_id":{"type":"string","nullable":true,"format":"uuid"},"value_unit_symbol":{"type":"string","nullable":true,"example":"g"},"value_unit_dimension":{"nullable":true,"enum":["MASS","VOLUME","LENGTH","COUNT"],"type":"string","example":"MASS"},"value_unit_factor":{"type":"number","nullable":true,"example":1,"description":"The value unit in its base unit (g for mass, ml for volume): kg = 1000."},"value_decimals":{"type":"number","description":"PRICE in halalas = 2."},"has_inner_check_digit":{"type":"boolean"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"preset_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string"},"branch_ids":{"description":"Empty = every branch.","type":"array","items":{"type":"string"}},"collisions":{"description":"Create/update only: existing product barcodes this format would read as scale labels.","type":"array","items":{"$ref":"#/components/schemas/ScaleBarcodeCollisionResponseDto"}}},"required":["symbology","prefix","item_code_start","item_code_length","value_start","value_length","value_type","value_unit_id","value_unit_symbol","value_unit_dimension","value_unit_factor","value_decimals","has_inner_check_digit","is_active","created_at","updated_at","id","restaurant_id","preset_id","name","branch_ids"],"title":"ScaleBarcodeFormatResponseDto"},"ScaleBarcodePresetResponseDto":{"type":"object","properties":{"symbology":{"enum":["EAN13","UPCA"],"type":"string"},"prefix":{"type":"string"},"item_code_start":{"type":"number","description":"0-based offset into the whole code."},"item_code_length":{"type":"number"},"value_start":{"type":"number","description":"0-based offset into the whole code."},"value_length":{"type":"number"},"value_type":{"enum":["WEIGHT","PRICE"],"type":"string"},"value_unit_id":{"type":"string","nullable":true,"format":"uuid"},"value_unit_symbol":{"type":"string","nullable":true,"example":"g"},"value_unit_dimension":{"nullable":true,"enum":["MASS","VOLUME","LENGTH","COUNT"],"type":"string","example":"MASS"},"value_unit_factor":{"type":"number","nullable":true,"example":1,"description":"The value unit in its base unit (g for mass, ml for volume): kg = 1000."},"value_decimals":{"type":"number","description":"PRICE in halalas = 2."},"has_inner_check_digit":{"type":"boolean"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"description_ar":{"type":"string","nullable":true},"sort_order":{"type":"number"}},"required":["symbology","prefix","item_code_start","item_code_length","value_start","value_length","value_type","value_unit_id","value_unit_symbol","value_unit_dimension","value_unit_factor","value_decimals","has_inner_check_digit","is_active","created_at","updated_at","id","name","name_ar","description","description_ar","sort_order"],"title":"ScaleBarcodePresetResponseDto"},"CreateScaleBarcodeFormatFromPresetDto":{"type":"object","properties":{"symbology":{"enum":["EAN13","UPCA"],"type":"string","default":"EAN13"},"prefix":{"type":"string","pattern":"^\\d{1,4}$","example":"2","description":"Leading digits that mark a scale label (1–4 digits)."},"item_code_start":{"type":"number","minimum":0,"maximum":12,"example":1,"description":"0-based offset of the item code."},"item_code_length":{"type":"number","minimum":1,"maximum":10,"example":6},"value_start":{"type":"number","minimum":0,"maximum":12,"example":7,"description":"0-based offset of the weight or price digits."},"value_length":{"type":"number","minimum":1,"maximum":6,"example":5},"value_type":{"enum":["WEIGHT","PRICE"],"type":"string"},"value_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"WEIGHT only: the system mass/volume unit the digits count. Defaults to g. Must be null for PRICE."},"value_decimals":{"type":"number","minimum":0,"maximum":6,"default":0,"description":"Digits after the decimal point. PRICE labels in halalas use 2 (04000 = 40.00)."},"has_inner_check_digit":{"type":"boolean","default":false,"description":"The digit just before the value is a GS1 price check digit (UPC-A price labels)."},"name":{"type":"string","minLength":1,"maxLength":100,"example":"Bakery scale"},"branch_ids":{"description":"Branches the format is limited to. Empty or omitted = every branch.","type":"array","items":{"type":"string","format":"uuid"}},"is_active":{"type":"boolean","default":true}},"title":"CreateScaleBarcodeFormatFromPresetDto"},"CreateScaleBarcodeFormatDto":{"type":"object","properties":{"symbology":{"enum":["EAN13","UPCA"],"type":"string","default":"EAN13"},"prefix":{"type":"string","pattern":"^\\d{1,4}$","example":"2","description":"Leading digits that mark a scale label (1–4 digits)."},"item_code_start":{"type":"number","minimum":0,"maximum":12,"example":1,"description":"0-based offset of the item code."},"item_code_length":{"type":"number","minimum":1,"maximum":10,"example":6},"value_start":{"type":"number","minimum":0,"maximum":12,"example":7,"description":"0-based offset of the weight or price digits."},"value_length":{"type":"number","minimum":1,"maximum":6,"example":5},"value_type":{"enum":["WEIGHT","PRICE"],"type":"string"},"value_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"WEIGHT only: the system mass/volume unit the digits count. Defaults to g. Must be null for PRICE."},"value_decimals":{"type":"number","minimum":0,"maximum":6,"default":0,"description":"Digits after the decimal point. PRICE labels in halalas use 2 (04000 = 40.00)."},"has_inner_check_digit":{"type":"boolean","default":false,"description":"The digit just before the value is a GS1 price check digit (UPC-A price labels)."},"name":{"type":"string","minLength":1,"maxLength":100,"example":"Bakery scale"},"branch_ids":{"description":"Branches the format is limited to. Empty or omitted = every branch.","type":"array","items":{"type":"string","format":"uuid"}},"is_active":{"type":"boolean","default":true}},"required":["prefix","item_code_start","item_code_length","value_start","value_length","value_type","name"],"title":"CreateScaleBarcodeFormatDto"},"UpdateScaleBarcodeFormatDto":{"type":"object","properties":{"symbology":{"enum":["EAN13","UPCA"],"type":"string","default":"EAN13"},"prefix":{"type":"string","pattern":"^\\d{1,4}$","example":"2","description":"Leading digits that mark a scale label (1–4 digits)."},"item_code_start":{"type":"number","minimum":0,"maximum":12,"example":1,"description":"0-based offset of the item code."},"item_code_length":{"type":"number","minimum":1,"maximum":10,"example":6},"value_start":{"type":"number","minimum":0,"maximum":12,"example":7,"description":"0-based offset of the weight or price digits."},"value_length":{"type":"number","minimum":1,"maximum":6,"example":5},"value_type":{"enum":["WEIGHT","PRICE"],"type":"string"},"value_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"WEIGHT only: the system mass/volume unit the digits count. Defaults to g. Must be null for PRICE."},"value_decimals":{"type":"number","minimum":0,"maximum":6,"default":0,"description":"Digits after the decimal point. PRICE labels in halalas use 2 (04000 = 40.00)."},"has_inner_check_digit":{"type":"boolean","default":false,"description":"The digit just before the value is a GS1 price check digit (UPC-A price labels)."},"name":{"type":"string","minLength":1,"maxLength":100,"example":"Bakery scale"},"branch_ids":{"description":"Branches the format is limited to. Empty or omitted = every branch.","type":"array","items":{"type":"string","format":"uuid"}},"is_active":{"type":"boolean","default":true}},"title":"UpdateScaleBarcodeFormatDto"},"CreateScaleBarcodePresetDto":{"type":"object","properties":{"symbology":{"enum":["EAN13","UPCA"],"type":"string","default":"EAN13"},"prefix":{"type":"string","pattern":"^\\d{1,4}$","example":"2","description":"Leading digits that mark a scale label (1–4 digits)."},"item_code_start":{"type":"number","minimum":0,"maximum":12,"example":1,"description":"0-based offset of the item code."},"item_code_length":{"type":"number","minimum":1,"maximum":10,"example":6},"value_start":{"type":"number","minimum":0,"maximum":12,"example":7,"description":"0-based offset of the weight or price digits."},"value_length":{"type":"number","minimum":1,"maximum":6,"example":5},"value_type":{"enum":["WEIGHT","PRICE"],"type":"string"},"value_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"WEIGHT only: the system mass/volume unit the digits count. Defaults to g. Must be null for PRICE."},"value_decimals":{"type":"number","minimum":0,"maximum":6,"default":0,"description":"Digits after the decimal point. PRICE labels in halalas use 2 (04000 = 40.00)."},"has_inner_check_digit":{"type":"boolean","default":false,"description":"The digit just before the value is a GS1 price check digit (UPC-A price labels)."},"name":{"type":"string","minLength":1,"maxLength":150,"example":"EAN-13: 2 + 6-digit item + 5-digit weight (g)"},"name_ar":{"type":"string","nullable":true,"maxLength":150},"description":{"type":"string","nullable":true,"maxLength":500},"description_ar":{"type":"string","nullable":true,"maxLength":500},"sort_order":{"type":"number","default":0},"is_active":{"type":"boolean","default":true}},"required":["prefix","item_code_start","item_code_length","value_start","value_length","value_type","name"],"title":"CreateScaleBarcodePresetDto"},"UpdateScaleBarcodePresetDto":{"type":"object","properties":{"symbology":{"enum":["EAN13","UPCA"],"type":"string","default":"EAN13"},"prefix":{"type":"string","pattern":"^\\d{1,4}$","example":"2","description":"Leading digits that mark a scale label (1–4 digits)."},"item_code_start":{"type":"number","minimum":0,"maximum":12,"example":1,"description":"0-based offset of the item code."},"item_code_length":{"type":"number","minimum":1,"maximum":10,"example":6},"value_start":{"type":"number","minimum":0,"maximum":12,"example":7,"description":"0-based offset of the weight or price digits."},"value_length":{"type":"number","minimum":1,"maximum":6,"example":5},"value_type":{"enum":["WEIGHT","PRICE"],"type":"string"},"value_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"WEIGHT only: the system mass/volume unit the digits count. Defaults to g. Must be null for PRICE."},"value_decimals":{"type":"number","minimum":0,"maximum":6,"default":0,"description":"Digits after the decimal point. PRICE labels in halalas use 2 (04000 = 40.00)."},"has_inner_check_digit":{"type":"boolean","default":false,"description":"The digit just before the value is a GS1 price check digit (UPC-A price labels)."},"name":{"type":"string","minLength":1,"maxLength":150,"example":"EAN-13: 2 + 6-digit item + 5-digit weight (g)"},"name_ar":{"type":"string","nullable":true,"maxLength":150},"description":{"type":"string","nullable":true,"maxLength":500},"description_ar":{"type":"string","nullable":true,"maxLength":500},"sort_order":{"type":"number","default":0},"is_active":{"type":"boolean","default":true}},"title":"UpdateScaleBarcodePresetDto"},"PhosphorIconWeight":{"type":"string","enum":["thin","light","regular","bold","fill","duotone"],"description":"Phosphor weight: thin, light, regular, bold, fill, duotone.","title":"PhosphorIconWeight"},"EmenuPageIcon":{"type":"object","properties":{"name":{"type":"string","example":"FileText","description":"Phosphor icon name in PascalCase."},"weight":{"example":"regular","description":"Phosphor weight: thin, light, regular, bold, fill, duotone.","allOf":[{"$ref":"#/components/schemas/PhosphorIconWeight"}]},"filled":{"type":"boolean","example":false,"deprecated":true,"description":"Use `weight` instead. `true` maps to fill, `false` to regular."}},"required":["name"],"title":"EmenuPageIcon"},"WrapperSettings":{"type":"object","properties":{"class_name":{"type":"string","example":"py-8 bg-muted"},"padding_y":{"enum":["none","sm","md","lg","xl"],"type":"string"},"padding_x":{"enum":["none","sm","md","lg","xl"],"type":"string"},"margin_y":{"enum":["none","sm","md","lg","xl"],"type":"string"},"margin_x":{"enum":["none","sm","md","lg","xl"],"type":"string"},"container":{"type":"boolean","default":false,"description":"When true, content is constrained to the page container width."}},"title":"WrapperSettings"},"ResponsiveStyle":{"type":"object","properties":{"mobile":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"}]},"example":{},"description":"Inline styles for the mobile breakpoint (may be `{}`)"},"tablet":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"}]},"example":{},"description":"Inline styles for the tablet breakpoint (may be `{}`)"},"desktop":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"}]},"example":{},"description":"Inline styles for the desktop breakpoint (may be `{}`)"}},"title":"ResponsiveStyle"},"SectionWrapper":{"type":"object","properties":{"props":{"$ref":"#/components/schemas/WrapperSettings"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["props","style"],"title":"SectionWrapper"},"HeroContentWrapper":{"type":"object","properties":{"show_branding":{"type":"boolean","default":false},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["show_branding","style"],"title":"HeroContentWrapper"},"QuickLinkIcon":{"type":"object","properties":{"name":{"type":"string","example":"Link","description":"Phosphor icon name in PascalCase."},"weight":{"example":"regular","description":"Phosphor weight: thin, light, regular, bold, fill, duotone.","allOf":[{"$ref":"#/components/schemas/PhosphorIconWeight"}]},"filled":{"type":"boolean","example":false,"deprecated":true,"description":"Use `weight` instead. `true` maps to fill, `false` to regular."}},"required":["name"],"title":"QuickLinkIcon"},"SocialLinkType":{"type":"string","enum":["url","phone","email","whatsapp","sms","telegram","skype","map"],"description":"url (https/http), phone (tel:), email (mailto:), whatsapp (wa.me), sms (sms:), telegram (t.me/tg:), skype (skype:), map (geo:/maps URL)","title":"SocialLinkType"},"SocialLink":{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/QuickLinkIcon"},"label":{"type":"string","example":"Instagram"},"label_ar":{"type":"string","example":"انستقرام"},"link":{"type":"string","example":"https://example.com/menu","description":"Raw value; prefixed per `type`."},"type":{"example":"url","description":"url (https/http), phone (tel:), email (mailto:), whatsapp (wa.me), sms (sms:), telegram (t.me/tg:), skype (skype:), map (geo:/maps URL)","allOf":[{"$ref":"#/components/schemas/SocialLinkType"}]},"platform":{"type":"string","example":"instagram","deprecated":true},"url":{"type":"string","format":"uri","example":"https://instagram.com/myrestaurant","deprecated":true}},"required":["icon","label","link","type"],"title":"SocialLink"},"HeroSliderAutoplay":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"duration":{"type":"number","minimum":0,"description":"Autoplay interval in milliseconds"}},"required":["enabled","duration"],"title":"HeroSliderAutoplay"},"HeroSliderMotion":{"type":"object","properties":{"animation_effect":{"enum":["slide","cube","cards"],"type":"string"}},"required":["animation_effect"],"title":"HeroSliderMotion"},"HeroSliderSlide":{"type":"object","properties":{"type":{"enum":["product","category"],"type":"string"},"id":{"type":"string","format":"uuid"}},"required":["type","id"],"title":"HeroSliderSlide"},"HeroSlider":{"type":"object","properties":{"show":{"type":"boolean","default":false},"autoplay":{"$ref":"#/components/schemas/HeroSliderAutoplay"},"slider_motion":{"$ref":"#/components/schemas/HeroSliderMotion"},"slides":{"type":"array","items":{"$ref":"#/components/schemas/HeroSliderSlide"}}},"required":["show","autoplay","slider_motion","slides"],"title":"HeroSlider"},"HeroSectionContentDto":{"type":"object","properties":{"layout":{"enum":[1,2],"type":"number","default":1,"description":"`1` — slider hero (legacy). `2` — static hero without slider. Omitted content is treated as layout `1`."},"title":{"type":"string","example":"Welcome"},"title_ar":{"type":"string","example":"مرحباً"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"content_wrapper":{"$ref":"#/components/schemas/HeroContentWrapper"},"social_icons":{"default":[],"description":"Social links shown in the hero (both layout `1` and `2`).","type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"slider":{"description":"Required when `layout` is `1` or omitted. Not used for layout `2`.","allOf":[{"$ref":"#/components/schemas/HeroSlider"}]}},"required":["wrapper","content_wrapper"],"title":"HeroSectionContentDto"},"CreateHeroEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["HERO"]},"content":{"$ref":"#/components/schemas/HeroSectionContentDto"}},"required":["type","content"],"title":"CreateHeroEmenuSection"},"SectionContentWrapper":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"SectionContentWrapper"},"ProductGridCategoriesButton":{"type":"object","properties":{"type":{"enum":["normal","dropdown","big_image"],"type":"string","default":"normal","description":"`normal` — flat pills. `dropdown` — parent opens menu of child categories. `big_image` — large image chips."},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"ProductGridCategoriesButton"},"ProductGridCategoriesStyle":{"type":"object","properties":{"mobile":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"}]},"example":{},"description":"Inline styles for the mobile breakpoint (may be `{}`)"},"tablet":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"}]},"example":{},"description":"Inline styles for the tablet breakpoint (may be `{}`)"},"desktop":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"}]},"example":{},"description":"Inline styles for the desktop breakpoint (may be `{}`)"},"position":{"enum":["relative","sticky"],"type":"string","default":"relative"}},"required":["position"],"title":"ProductGridCategoriesStyle"},"ProductGridCategories":{"type":"object","properties":{"show":{"type":"boolean","default":true},"button":{"$ref":"#/components/schemas/ProductGridCategoriesButton"},"style":{"$ref":"#/components/schemas/ProductGridCategoriesStyle"}},"required":["show","button","style"],"title":"ProductGridCategories"},"ProductGridSectionContentDto":{"type":"object","properties":{"title":{"type":"string","example":"Featured"},"title_ar":{"type":"string","example":"المميزة"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"include_categories":{"description":"Category UUIDs to include in the category strip / filter.","type":"array","items":{"type":"string","format":"uuid"}},"show_list_button":{"type":"boolean","default":false},"default_layout":{"enum":["grid","list"],"type":"string","default":"grid"},"display_type":{"enum":["grid","list","slide_row"],"type":"string"},"price_display":{"enum":["price","points","both"],"type":"string","default":"price","description":"`price` — currency only. `points` — loyalty points equivalent of the price. `both` — currency and points."},"slide_row":{"type":"boolean","deprecated":true,"description":"Deprecated — use `display_type` instead."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"categories":{"$ref":"#/components/schemas/ProductGridCategories"}},"required":["include_categories","show_list_button","default_layout","wrapper","categories"],"title":"ProductGridSectionContentDto"},"CreateProductGridEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["PRODUCT_GRID"]},"content":{"$ref":"#/components/schemas/ProductGridSectionContentDto"}},"required":["type","content"],"title":"CreateProductGridEmenuSection"},"SliderArrows":{"type":"object","properties":{"enabled":{"type":"boolean","default":true}},"required":["enabled"],"title":"SliderArrows"},"SliderAutoplay":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"duration":{"type":"number","minimum":0,"description":"Autoplay interval in milliseconds"}},"required":["enabled","duration"],"title":"SliderAutoplay"},"SliderAspectRatio":{"type":"object","properties":{"mobile":{"type":"string","example":"16/9"},"desktop":{"type":"string","example":"21/9"}},"title":"SliderAspectRatio"},"SliderMotion":{"type":"object","properties":{"animation_effect":{"enum":["slide","fade","cube","coverflow","flip","creative"],"type":"string"}},"required":["animation_effect"],"title":"SliderMotion"},"SliderBannerButton":{"type":"object","properties":{"text":{"type":"string","example":"Shop now"},"text_ar":{"type":"string","example":"تسوق الآن"},"link":{"type":"string","example":"/menu"},"type":{"enum":["product","category","link"],"type":"string"}},"required":["text","link","type"],"title":"SliderBannerButton"},"SliderBanner":{"type":"object","properties":{"image":{"type":"string","example":"https://cdn.example.com/banner.webp"},"title":{"type":"string","example":"Summer Sale"},"title_ar":{"type":"string","example":"تخفيضات الصيف"},"subtitle":{"type":"string","example":"Limited time offers"},"subtitle_ar":{"type":"string","example":"عروض لفترة محدودة"},"description":{"type":"string"},"description_ar":{"type":"string"},"button":{"$ref":"#/components/schemas/SliderBannerButton"},"text_style":{"$ref":"#/components/schemas/ResponsiveStyle"},"content_style":{"$ref":"#/components/schemas/ResponsiveStyle"},"content_wrapper_style":{"$ref":"#/components/schemas/ResponsiveStyle"},"image_style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["image","button"],"title":"SliderBanner"},"SliderSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Featured"},"title_ar":{"type":"string","example":"المميزة"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"image":{"type":"string","example":"https://cdn.example.com/slider-fallback.webp"},"slider_arrows":{"$ref":"#/components/schemas/SliderArrows"},"slider_autoplay":{"$ref":"#/components/schemas/SliderAutoplay"},"slider_aspect_ratio":{"$ref":"#/components/schemas/SliderAspectRatio"},"slider_motion":{"$ref":"#/components/schemas/SliderMotion"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"slides":{"type":"array","items":{"$ref":"#/components/schemas/SliderBanner"}}},"required":["image","slider_arrows","slider_autoplay","slider_motion","wrapper","slides"],"title":"SliderSectionContent"},"CreateSliderEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["SLIDER"]},"content":{"$ref":"#/components/schemas/SliderSectionContent"}},"required":["type","content"],"title":"CreateSliderEmenuSection"},"FeaturedSliderAutoplay":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"duration":{"type":"number","minimum":0,"description":"Autoplay interval in milliseconds"}},"required":["enabled","duration"],"title":"FeaturedSliderAutoplay"},"FeaturedSliderMotion":{"type":"object","properties":{"animation_effect":{"enum":["slide","fade","coverflow"],"type":"string"}},"required":["animation_effect"],"title":"FeaturedSliderMotion"},"FeaturedSliderSlide":{"type":"object","properties":{"type":{"enum":["product","category"],"type":"string"},"id":{"type":"string","format":"uuid"}},"required":["type","id"],"title":"FeaturedSliderSlide"},"FeaturedSliderSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Featured"},"title_ar":{"type":"string","example":"المميزة"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"autoplay":{"$ref":"#/components/schemas/FeaturedSliderAutoplay"},"slider_motion":{"$ref":"#/components/schemas/FeaturedSliderMotion"},"slides":{"type":"array","items":{"$ref":"#/components/schemas/FeaturedSliderSlide"}}},"required":["wrapper","content_wrapper","autoplay","slider_motion","slides"],"title":"FeaturedSliderSectionContent"},"CreateFeaturedSliderEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["FEATURED_SLIDER"]},"content":{"$ref":"#/components/schemas/FeaturedSliderSectionContent"}},"required":["type","content"],"title":"CreateFeaturedSliderEmenuSection"},"ReviewsGoogleData":{"type":"object","properties":{"place_id":{"type":"string","example":"ChIJN1t_tDeuEmsRUsoyG83frY4"},"exclude_less_than_stars":{"type":"number","minimum":1,"maximum":5,"example":4,"description":"Hide reviews with a star rating below this value."}},"required":["place_id","exclude_less_than_stars"],"title":"ReviewsGoogleData"},"ReviewsCustomReview":{"type":"object","properties":{"author_name":{"type":"string","example":"Sarah M."},"rating":{"type":"number","minimum":1,"maximum":5,"example":5},"relative_time_description":{"type":"string","example":"2 weeks ago"},"text":{"type":"string","example":"Amazing food and fast service!"},"gender":{"enum":["male","female"],"type":"string"}},"required":["author_name","rating","relative_time_description","text","gender"],"title":"ReviewsCustomReview"},"ReviewsCustomData":{"type":"object","properties":{"reviews":{"type":"array","items":{"$ref":"#/components/schemas/ReviewsCustomReview"}}},"required":["reviews"],"title":"ReviewsCustomData"},"ReviewsSectionData":{"type":"object","properties":{"google":{"$ref":"#/components/schemas/ReviewsGoogleData"},"custom":{"$ref":"#/components/schemas/ReviewsCustomData"}},"title":"ReviewsSectionData"},"ReviewsReviewButton":{"type":"object","properties":{"show":{"type":"boolean","default":false},"text":{"type":"string","example":"Leave a review"},"text_ar":{"type":"string","example":"اترك تقييماً"},"link":{"type":"string","example":"https://g.page/r/.../review"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["show","style"],"title":"ReviewsReviewButton"},"ReviewCardWrapperContent":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"ReviewCardWrapperContent"},"ReviewCardWrapper":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"},"content":{"$ref":"#/components/schemas/ReviewCardWrapperContent"}},"required":["style","content"],"title":"ReviewCardWrapper"},"ReviewCardSequenceContentItem":{"type":"object","properties":{"show":{"type":"boolean","default":true},"name":{"enum":["author_name","rating","relative_time_description","text"],"type":"string"}},"required":["show","name"],"title":"ReviewCardSequenceContentItem"},"ReviewCardSequenceImageItem":{"type":"object","properties":{"show":{"type":"boolean","default":true},"name":{"type":"string","enum":["image"],"default":"image"},"position":{"enum":["top","bottom"],"type":"string"}},"required":["show","name","position"],"title":"ReviewCardSequenceImageItem"},"ReviewCardSequence":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/ReviewCardSequenceContentItem"}},"image":{"type":"array","items":{"$ref":"#/components/schemas/ReviewCardSequenceImageItem"}}},"required":["content","image"],"title":"ReviewCardSequence"},"ReviewCardSettings":{"type":"object","properties":{"type":{"enum":["vertical","horizontal"],"type":"string","default":"vertical"},"wrapper":{"$ref":"#/components/schemas/ReviewCardWrapper"},"sequence":{"$ref":"#/components/schemas/ReviewCardSequence"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["type","wrapper","sequence","style"],"title":"ReviewCardSettings"},"ReviewsSectionContentDto":{"type":"object","properties":{"title":{"type":"string","example":"What our guests say"},"title_ar":{"type":"string","example":"ماذا يقول ضيوفنا"},"subtitle":{"type":"string","example":"Real reviews from real customers"},"subtitle_ar":{"type":"string","example":"تقييمات حقيقية من عملائنا"},"description":{"type":"string"},"description_ar":{"type":"string"},"source":{"enum":["google","custom"],"type":"string","default":"google"},"data":{"$ref":"#/components/schemas/ReviewsSectionData"},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"review_button":{"$ref":"#/components/schemas/ReviewsReviewButton"},"review_card":{"$ref":"#/components/schemas/ReviewCardSettings"}},"required":["source","data","wrapper","review_card"],"title":"ReviewsSectionContentDto"},"CreateReviewsEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["REVIEWS"]},"content":{"$ref":"#/components/schemas/ReviewsSectionContentDto"}},"required":["type","content"],"title":"CreateReviewsEmenuSection"},"FaqQuestion":{"type":"object","properties":{"question":{"type":"string","example":"Do you offer delivery?"},"question_ar":{"type":"string","example":"هل تقدمون خدمة التوصيل؟"},"answer":{"type":"string","example":"Yes, we deliver within a 5 km radius."},"answer_ar":{"type":"string","example":"نعم، نوصل ضمن نطاق 5 كم."}},"required":["question","answer"],"title":"FaqQuestion"},"FaqCardWrapper":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"FaqCardWrapper"},"FaqCardSettings":{"type":"object","properties":{"wrapper":{"$ref":"#/components/schemas/FaqCardWrapper"}},"required":["wrapper"],"title":"FaqCardSettings"},"FaqSectionContentDto":{"type":"object","properties":{"title":{"type":"string","example":"Frequently asked questions"},"title_ar":{"type":"string","example":"الأسئلة الشائعة"},"subtitle":{"type":"string","example":"Everything you need to know"},"subtitle_ar":{"type":"string","example":"كل ما تحتاج معرفته"},"description":{"type":"string","example":"Browse common questions about our menu and services."},"description_ar":{"type":"string","example":"تصفح الأسئلة الشائعة حول قائمتنا وخدماتنا."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/FaqQuestion"}},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"faq_card":{"$ref":"#/components/schemas/FaqCardSettings"}},"required":["questions","wrapper","faq_card"],"title":"FaqSectionContentDto"},"CreateFaqEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["FAQ"]},"content":{"$ref":"#/components/schemas/FaqSectionContentDto"}},"required":["type","content"],"title":"CreateFaqEmenuSection"},"QuickLinksLinksWrapper":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"QuickLinksLinksWrapper"},"QuickLinksButtonSettings":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"QuickLinksButtonSettings"},"QuickLinksSectionContentDto":{"type":"object","properties":{"title":{"type":"string","example":"Quick links"},"title_ar":{"type":"string","example":"روابط سريعة"},"subtitle":{"type":"string","example":"Jump to a page"},"subtitle_ar":{"type":"string","example":"انتقل إلى صفحة"},"description":{"type":"string","example":"Shortcuts to popular destinations."},"description_ar":{"type":"string","example":"اختصارات للصفحات الشائعة."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"links":{"type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"links_wrapper":{"$ref":"#/components/schemas/QuickLinksLinksWrapper"},"button":{"$ref":"#/components/schemas/QuickLinksButtonSettings"}},"required":["links","wrapper","links_wrapper","button"],"title":"QuickLinksSectionContentDto"},"CreateQuickLinksEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["QUICK_LINKS"]},"content":{"$ref":"#/components/schemas/QuickLinksSectionContentDto"}},"required":["type","content"],"title":"CreateQuickLinksEmenuSection"},"EnhancedFeatureIcon":{"type":"object","properties":{"name":{"type":"string","example":"Star","description":"Phosphor icon name in PascalCase."},"weight":{"example":"regular","description":"Phosphor weight: thin, light, regular, bold, fill, duotone.","allOf":[{"$ref":"#/components/schemas/PhosphorIconWeight"}]},"filled":{"type":"boolean","example":false,"deprecated":true,"description":"Use `weight` instead. `true` maps to fill, `false` to regular."}},"required":["name"],"title":"EnhancedFeatureIcon"},"EnhancedFeatureItem":{"type":"object","properties":{"title":{"type":"string","example":"Fast delivery"},"title_ar":{"type":"string","example":"توصيل سريع"},"secondary_title":{"type":"string","example":"Under 30 minutes"},"secondary_title_ar":{"type":"string","example":"خلال 30 دقيقة"},"icon":{"$ref":"#/components/schemas/EnhancedFeatureIcon"}},"required":["title"],"title":"EnhancedFeatureItem"},"EnhancedFeatureCardWrapper":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"EnhancedFeatureCardWrapper"},"EnhancedFeatureCardSettings":{"type":"object","properties":{"wrapper":{"$ref":"#/components/schemas/EnhancedFeatureCardWrapper"}},"required":["wrapper"],"title":"EnhancedFeatureCardSettings"},"EnhancedFeaturesSectionContentDto":{"type":"object","properties":{"title":{"type":"string","example":"Why choose us"},"title_ar":{"type":"string","example":"لماذا نحن"},"subtitle":{"type":"string","example":"Everything you need"},"subtitle_ar":{"type":"string","example":"كل ما تحتاجه"},"description":{"type":"string","example":"Highlights of our service."},"description_ar":{"type":"string","example":"أبرز ما نقدمه."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"features":{"type":"array","items":{"$ref":"#/components/schemas/EnhancedFeatureItem"}},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"feature_card":{"$ref":"#/components/schemas/EnhancedFeatureCardSettings"}},"required":["features","wrapper","feature_card"],"title":"EnhancedFeaturesSectionContentDto"},"CreateEnhancedFeaturesEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["ENHANCED_FEATURES"]},"content":{"$ref":"#/components/schemas/EnhancedFeaturesSectionContentDto"}},"required":["type","content"],"title":"CreateEnhancedFeaturesEmenuSection"},"CategoriesGridSectionContentDto":{"type":"object","properties":{"title":{"type":"string","example":"Browse categories"},"title_ar":{"type":"string","example":"تصفح الفئات"},"subtitle":{"type":"string","example":"Shop by category"},"subtitle_ar":{"type":"string","example":"تسوق حسب الفئة"},"description":{"type":"string","example":"Explore our menu categories."},"description_ar":{"type":"string","example":"استكشف فئات قائمتنا."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"include_categories":{"description":"Parent category UUIDs to include. Empty array shows all parent categories.","type":"array","items":{"type":"string","format":"uuid"}},"display_type":{"enum":["all","slide","one_row"],"type":"string","default":"all","description":"Layout mode: full grid, horizontal slide, or single row."},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"}},"required":["include_categories","wrapper"],"title":"CategoriesGridSectionContentDto"},"CreateCategoriesGridEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["CATEGORIES_GRID"]},"content":{"$ref":"#/components/schemas/CategoriesGridSectionContentDto"}},"required":["type","content"],"title":"CreateCategoriesGridEmenuSection"},"PromoBannerSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"20% off everything"},"title_ar":{"type":"string","example":"خصم 20٪ على كل شيء"},"image_url":{"type":"string","example":"https://cdn.example.com/promo.webp"},"link_url":{"type":"string","example":"/promo/summer"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"}},"required":["wrapper"],"title":"PromoBannerSectionContent"},"CreatePromoBannerEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["PROMO_BANNER"]},"content":{"$ref":"#/components/schemas/PromoBannerSectionContent"}},"required":["type","content"],"title":"CreatePromoBannerEmenuSection"},"CreateTextBlockEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["TEXT_BLOCK"]},"content":{"type":"object","additionalProperties":{},"example":{"body":"About us…","body_ar":"…","align":"center"}}},"required":["type","content"],"title":"CreateTextBlockEmenuSection"},"CreateAnnouncementEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["ANNOUNCEMENT"]},"content":{"type":"object","additionalProperties":{}}},"required":["type","content"],"title":"CreateAnnouncementEmenuSection"},"CreateFeaturedItemEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["FEATURED_ITEM"]},"content":{"type":"object","additionalProperties":{}}},"required":["type","content"],"title":"CreateFeaturedItemEmenuSection"},"CreateImageBannerEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["IMAGE_BANNER"]},"content":{"type":"object","additionalProperties":{}}},"required":["type","content"],"title":"CreateImageBannerEmenuSection"},"CreateDividerEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["DIVIDER"]},"content":{"type":"object","additionalProperties":{}}},"required":["type","content"],"title":"CreateDividerEmenuSection"},"OrderTypeButtonSettings":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"OrderTypeButtonSettings"},"OrderTypeSlotWindow":{"type":"object","properties":{"min_hours_ahead":{"type":"number","minimum":0,"example":0,"description":"Minimum hours from now a slot may be selected."},"max_days_ahead":{"type":"number","minimum":0,"example":30,"description":"Maximum days ahead a slot may be selected."}},"title":"OrderTypeSlotWindow"},"OrderTypeBookingFields":{"type":"object","properties":{"party_size":{"type":"boolean","default":true},"time":{"type":"boolean","default":true},"date":{"type":"boolean","default":true},"special_requests":{"type":"boolean","default":false}},"title":"OrderTypeBookingFields"},"OrderTypeItem":{"type":"object","properties":{"label":{"type":"string","example":"Takeaway"},"label_ar":{"type":"string","example":"طلب خارجي"},"excluded_branch_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"slot_window":{"$ref":"#/components/schemas/OrderTypeSlotWindow"},"fields":{"$ref":"#/components/schemas/OrderTypeBookingFields"}},"title":"OrderTypeItem"},"OrderTypeTypes":{"type":"object","properties":{"TAKEAWAY":{"$ref":"#/components/schemas/OrderTypeItem"},"DRIVE_THROUGH":{"$ref":"#/components/schemas/OrderTypeItem"},"DELIVERY":{"$ref":"#/components/schemas/OrderTypeItem"},"DINE_IN":{"$ref":"#/components/schemas/OrderTypeItem"},"BOOKING":{"$ref":"#/components/schemas/OrderTypeItem"},"SERVICE":{"$ref":"#/components/schemas/OrderTypeItem"}},"title":"OrderTypeTypes"},"OrderTypeSectionContentDto":{"type":"object","properties":{"title":{"type":"string","example":"How do you want to receive your order?"},"title_ar":{"type":"string","example":"كيف تريد استلام طلبك؟"},"subtitle":{"type":"string"},"subtitle_ar":{"type":"string"},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"button":{"$ref":"#/components/schemas/OrderTypeButtonSettings"},"types":{"$ref":"#/components/schemas/OrderTypeTypes"}},"required":["wrapper","button","types"],"title":"OrderTypeSectionContentDto"},"CreateOrderTypeEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["ORDER_TYPE"]},"content":{"$ref":"#/components/schemas/OrderTypeSectionContentDto"}},"required":["type","content"],"title":"CreateOrderTypeEmenuSection"},"PlaceOrderSectionContentDto":{"type":"object","properties":{"label":{"type":"string","example":"Place Order"},"label_ar":{"type":"string","example":"تأكيد الطلب"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"required":["style"],"title":"PlaceOrderSectionContentDto"},"CreatePlaceOrderEmenuSection":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"type":{"type":"string","enum":["PLACE_ORDER"]},"content":{"$ref":"#/components/schemas/PlaceOrderSectionContentDto"}},"required":["type","content"],"title":"CreatePlaceOrderEmenuSection"},"UpdateEmenuSectionDto":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"content":{"additionalProperties":true,"description":"Partial section content update. **Shallow-merged** with existing content — send only the keys you want to change. For HERO sections see `UpdateHeroSectionContent`. For PRODUCT_GRID see `UpdateProductGridSectionContent`. For SLIDER see `UpdateSliderSectionContent`. For FEATURED_SLIDER see `UpdateFeaturedSliderSectionContent`. For REVIEWS see `UpdateReviewsSectionContent`. For FAQ see `UpdateFaqSectionContent`. For QUICK_LINKS see `UpdateQuickLinksSectionContent`. For ENHANCED_FEATURES see `UpdateEnhancedFeaturesSectionContent`. For CATEGORIES_GRID see `UpdateCategoriesGridSectionContent`. For PROMO_BANNER see `UpdatePromoBannerSectionContent`.","oneOf":[{"$ref":"#/components/schemas/UpdateHeroSectionContent"},{"$ref":"#/components/schemas/UpdateProductGridSectionContent"},{"$ref":"#/components/schemas/UpdateSliderSectionContent"},{"$ref":"#/components/schemas/UpdateFeaturedSliderSectionContent"},{"$ref":"#/components/schemas/UpdateReviewsSectionContent"},{"$ref":"#/components/schemas/UpdateFaqSectionContent"},{"$ref":"#/components/schemas/UpdateQuickLinksSectionContent"},{"$ref":"#/components/schemas/UpdateEnhancedFeaturesSectionContent"},{"$ref":"#/components/schemas/UpdateCategoriesGridSectionContent"},{"$ref":"#/components/schemas/UpdatePromoBannerSectionContent"},{"$ref":"#/components/schemas/UpdateOrderTypeSectionContent"},{"$ref":"#/components/schemas/UpdatePlaceOrderSectionContent"},{"type":"object","additionalProperties":{},"description":"Partial content for other section types (TEXT_BLOCK, etc.)."}]}},"title":"UpdateEmenuSectionDto"},"UpdateHeroSectionContent":{"type":"object","properties":{"layout":{"enum":[1,2],"type":"number","default":1,"description":"`1` — slider hero (legacy). `2` — static hero without slider. Omitted content is treated as layout `1`."},"title":{"type":"string","example":"Welcome"},"title_ar":{"type":"string","example":"مرحباً"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"content_wrapper":{"$ref":"#/components/schemas/HeroContentWrapper"},"social_icons":{"default":[],"description":"Social links shown in the hero (both layout `1` and `2`).","type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"slider":{"description":"Required when `layout` is `1` or omitted. Not used for layout `2`.","allOf":[{"$ref":"#/components/schemas/HeroSlider"}]}},"title":"UpdateHeroSectionContent"},"UpdateProductGridSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Featured"},"title_ar":{"type":"string","example":"المميزة"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"include_categories":{"description":"Category UUIDs to include in the category strip / filter.","type":"array","items":{"type":"string","format":"uuid"}},"show_list_button":{"type":"boolean","default":false},"default_layout":{"enum":["grid","list"],"type":"string","default":"grid"},"display_type":{"enum":["grid","list","slide_row"],"type":"string"},"price_display":{"enum":["price","points","both"],"type":"string","default":"price","description":"`price` — currency only. `points` — loyalty points equivalent of the price. `both` — currency and points."},"slide_row":{"type":"boolean","deprecated":true,"description":"Deprecated — use `display_type` instead."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"categories":{"$ref":"#/components/schemas/ProductGridCategories"}},"title":"UpdateProductGridSectionContent"},"UpdateSliderSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Featured"},"title_ar":{"type":"string","example":"المميزة"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"image":{"type":"string","example":"https://cdn.example.com/slider-fallback.webp"},"slider_arrows":{"$ref":"#/components/schemas/SliderArrows"},"slider_autoplay":{"$ref":"#/components/schemas/SliderAutoplay"},"slider_aspect_ratio":{"$ref":"#/components/schemas/SliderAspectRatio"},"slider_motion":{"$ref":"#/components/schemas/SliderMotion"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"slides":{"type":"array","items":{"$ref":"#/components/schemas/SliderBanner"}}},"title":"UpdateSliderSectionContent"},"UpdateFeaturedSliderSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Featured"},"title_ar":{"type":"string","example":"المميزة"},"subtitle":{"type":"string","example":"Order online"},"subtitle_ar":{"type":"string","example":"اطلب أونلاين"},"description":{"type":"string"},"description_ar":{"type":"string"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"autoplay":{"$ref":"#/components/schemas/FeaturedSliderAutoplay"},"slider_motion":{"$ref":"#/components/schemas/FeaturedSliderMotion"},"slides":{"type":"array","items":{"$ref":"#/components/schemas/FeaturedSliderSlide"}}},"title":"UpdateFeaturedSliderSectionContent"},"UpdateReviewsSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"What our guests say"},"title_ar":{"type":"string","example":"ماذا يقول ضيوفنا"},"subtitle":{"type":"string","example":"Real reviews from real customers"},"subtitle_ar":{"type":"string","example":"تقييمات حقيقية من عملائنا"},"description":{"type":"string"},"description_ar":{"type":"string"},"source":{"enum":["google","custom"],"type":"string","default":"google"},"data":{"$ref":"#/components/schemas/ReviewsSectionData"},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"review_button":{"$ref":"#/components/schemas/ReviewsReviewButton"},"review_card":{"$ref":"#/components/schemas/ReviewCardSettings"}},"title":"UpdateReviewsSectionContent"},"UpdateFaqSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Frequently asked questions"},"title_ar":{"type":"string","example":"الأسئلة الشائعة"},"subtitle":{"type":"string","example":"Everything you need to know"},"subtitle_ar":{"type":"string","example":"كل ما تحتاج معرفته"},"description":{"type":"string","example":"Browse common questions about our menu and services."},"description_ar":{"type":"string","example":"تصفح الأسئلة الشائعة حول قائمتنا وخدماتنا."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/FaqQuestion"}},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"faq_card":{"$ref":"#/components/schemas/FaqCardSettings"}},"title":"UpdateFaqSectionContent"},"UpdateQuickLinksSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Quick links"},"title_ar":{"type":"string","example":"روابط سريعة"},"subtitle":{"type":"string","example":"Jump to a page"},"subtitle_ar":{"type":"string","example":"انتقل إلى صفحة"},"description":{"type":"string","example":"Shortcuts to popular destinations."},"description_ar":{"type":"string","example":"اختصارات للصفحات الشائعة."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"links":{"type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"links_wrapper":{"$ref":"#/components/schemas/QuickLinksLinksWrapper"},"button":{"$ref":"#/components/schemas/QuickLinksButtonSettings"}},"title":"UpdateQuickLinksSectionContent"},"UpdateEnhancedFeaturesSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Why choose us"},"title_ar":{"type":"string","example":"لماذا نحن"},"subtitle":{"type":"string","example":"Everything you need"},"subtitle_ar":{"type":"string","example":"كل ما تحتاجه"},"description":{"type":"string","example":"Highlights of our service."},"description_ar":{"type":"string","example":"أبرز ما نقدمه."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"features":{"type":"array","items":{"$ref":"#/components/schemas/EnhancedFeatureItem"}},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"feature_card":{"$ref":"#/components/schemas/EnhancedFeatureCardSettings"}},"title":"UpdateEnhancedFeaturesSectionContent"},"UpdateCategoriesGridSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"Browse categories"},"title_ar":{"type":"string","example":"تصفح الفئات"},"subtitle":{"type":"string","example":"Shop by category"},"subtitle_ar":{"type":"string","example":"تسوق حسب الفئة"},"description":{"type":"string","example":"Explore our menu categories."},"description_ar":{"type":"string","example":"استكشف فئات قائمتنا."},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"include_categories":{"description":"Parent category UUIDs to include. Empty array shows all parent categories.","type":"array","items":{"type":"string","format":"uuid"}},"display_type":{"enum":["all","slide","one_row"],"type":"string","default":"all","description":"Layout mode: full grid, horizontal slide, or single row."},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"}},"title":"UpdateCategoriesGridSectionContent"},"UpdatePromoBannerSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"20% off everything"},"title_ar":{"type":"string","example":"خصم 20٪ على كل شيء"},"image_url":{"type":"string","example":"https://cdn.example.com/promo.webp"},"link_url":{"type":"string","example":"/promo/summer"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"}},"title":"UpdatePromoBannerSectionContent"},"UpdateOrderTypeSectionContent":{"type":"object","properties":{"title":{"type":"string","example":"How do you want to receive your order?"},"title_ar":{"type":"string","example":"كيف تريد استلام طلبك؟"},"subtitle":{"type":"string"},"subtitle_ar":{"type":"string"},"content_wrapper":{"$ref":"#/components/schemas/SectionContentWrapper"},"wrapper":{"$ref":"#/components/schemas/SectionWrapper"},"button":{"$ref":"#/components/schemas/OrderTypeButtonSettings"},"types":{"$ref":"#/components/schemas/OrderTypeTypes"}},"title":"UpdateOrderTypeSectionContent"},"UpdatePlaceOrderSectionContent":{"type":"object","properties":{"label":{"type":"string","example":"Place Order"},"label_ar":{"type":"string","example":"تأكيد الطلب"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"UpdatePlaceOrderSectionContent"},"TextBlockSectionContent":{"type":"object","properties":{"body":{"type":"string","example":"Welcome to our restaurant."},"body_ar":{"type":"string","example":"مرحباً بكم في مطعمنا."},"align":{"type":"string","example":"center","description":"\"left\" | \"center\" | \"right\""}},"title":"TextBlockSectionContent"},"AnnouncementSectionContent":{"type":"object","properties":{"message":{"type":"string","example":"We are open until midnight on weekends!"},"message_ar":{"type":"string","example":"نفتح حتى منتصف الليل في عطل نهاية الأسبوع!"},"background_color":{"type":"string","example":"#fff3cd","description":"Background color for the announcement bar"},"text_color":{"type":"string","example":"#856404","description":"Text color"}},"title":"AnnouncementSectionContent"},"FeaturedItemSectionContent":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"Product UUID to feature"},"label":{"type":"string","example":"Chef's Pick"},"label_ar":{"type":"string","example":"اختيار الشيف"}},"title":"FeaturedItemSectionContent"},"ImageBannerSectionContent":{"type":"object","properties":{"image_url":{"type":"string","example":"https://cdn.example.com/banner.webp"},"image_url_mobile":{"type":"string","example":"https://cdn.example.com/banner-mobile.webp"},"link_url":{"type":"string","example":"/menu"},"alt_text":{"type":"string","example":"Promotional banner","description":"Alt text for accessibility"}},"title":"ImageBannerSectionContent"},"DividerSectionContent":{"type":"object","properties":{"color":{"type":"string","example":"#e5e7eb","description":"Divider line color"},"thickness_px":{"type":"number","example":1,"description":"Divider thickness in pixels"},"spacing":{"type":"string","example":"md","description":"Vertical spacing: \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\""}},"title":"DividerSectionContent"},"HeroEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["HERO"]},"content":{"$ref":"#/components/schemas/HeroSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"HeroEmenuSectionResponse"},"ProductGridEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["PRODUCT_GRID"]},"content":{"$ref":"#/components/schemas/ProductGridSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"ProductGridEmenuSectionResponse"},"SliderEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["SLIDER"]},"content":{"$ref":"#/components/schemas/SliderSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"SliderEmenuSectionResponse"},"FeaturedSliderEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["FEATURED_SLIDER"]},"content":{"$ref":"#/components/schemas/FeaturedSliderSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"FeaturedSliderEmenuSectionResponse"},"ReviewsEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["REVIEWS"]},"content":{"$ref":"#/components/schemas/ReviewsSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"ReviewsEmenuSectionResponse"},"FaqEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["FAQ"]},"content":{"$ref":"#/components/schemas/FaqSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"FaqEmenuSectionResponse"},"QuickLinksEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["QUICK_LINKS"]},"content":{"$ref":"#/components/schemas/QuickLinksSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"QuickLinksEmenuSectionResponse"},"EnhancedFeaturesEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["ENHANCED_FEATURES"]},"content":{"$ref":"#/components/schemas/EnhancedFeaturesSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"EnhancedFeaturesEmenuSectionResponse"},"CategoriesGridEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["CATEGORIES_GRID"]},"content":{"$ref":"#/components/schemas/CategoriesGridSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"CategoriesGridEmenuSectionResponse"},"PromoBannerEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["PROMO_BANNER"]},"content":{"$ref":"#/components/schemas/PromoBannerSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"PromoBannerEmenuSectionResponse"},"OrderTypeEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["ORDER_TYPE"]},"content":{"$ref":"#/components/schemas/OrderTypeSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"OrderTypeEmenuSectionResponse"},"PlaceOrderEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["PLACE_ORDER"]},"content":{"$ref":"#/components/schemas/PlaceOrderSectionContentDto"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"PlaceOrderEmenuSectionResponse"},"TextBlockEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["TEXT_BLOCK"]},"content":{"$ref":"#/components/schemas/TextBlockSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"TextBlockEmenuSectionResponse"},"AnnouncementEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["ANNOUNCEMENT"]},"content":{"$ref":"#/components/schemas/AnnouncementSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"AnnouncementEmenuSectionResponse"},"FeaturedItemEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["FEATURED_ITEM"]},"content":{"$ref":"#/components/schemas/FeaturedItemSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"FeaturedItemEmenuSectionResponse"},"ImageBannerEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["IMAGE_BANNER"]},"content":{"$ref":"#/components/schemas/ImageBannerSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"ImageBannerEmenuSectionResponse"},"DividerEmenuSectionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["DIVIDER"]},"content":{"$ref":"#/components/schemas/DividerSectionContent"}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"DividerEmenuSectionResponse"},"EmenuOrderTypesVisibility":{"type":"object","properties":{"takeaway":{"type":"boolean"},"drive_through":{"type":"boolean"},"delivery":{"type":"boolean"},"dine_in":{"type":"boolean"},"booking":{"type":"boolean"},"service":{"type":"boolean"}},"required":["takeaway","drive_through","delivery","dine_in","booking","service"],"title":"EmenuOrderTypesVisibility"},"EmenuPageListItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"page_type":{"enum":["HOME","CHECKOUT","CUSTOM"],"type":"string"},"slug":{"type":"string","example":"about-us"},"title":{"type":"string","nullable":true},"title_ar":{"type":"string","nullable":true},"icon":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/EmenuPageIcon"}]},"is_published":{"type":"boolean"},"sort_order":{"type":"number","minimum":0},"section_count":{"type":"number","minimum":0},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","page_type","slug","is_published","sort_order","section_count","created_at","updated_at"],"title":"EmenuPageListItemResponseDto"},"EmenuPageListResponseDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EmenuPageListItemResponseDto"}}},"required":["items"],"title":"EmenuPageListResponseDto"},"CreateEmenuCustomPageDto":{"type":"object","properties":{"title":{"type":"string","maxLength":120,"example":"About Us"},"title_ar":{"type":"string","maxLength":120,"example":"من نحن"},"slug":{"type":"string","minLength":1,"maxLength":80,"example":"about-us","description":"URL slug (lowercase letters, numbers, hyphens). Reserved: home, checkout."},"icon":{"description":"Phosphor icon shown in storefront navigation for this page.","allOf":[{"$ref":"#/components/schemas/EmenuPageIcon"}]},"is_published":{"type":"boolean","description":"Publish immediately.","default":false},"sort_order":{"type":"number","minimum":0,"default":0}},"required":["title","slug"],"title":"CreateEmenuCustomPageDto"},"EmenuPageResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"page_type":{"enum":["HOME","CHECKOUT","CUSTOM"],"type":"string"},"slug":{"type":"string","example":"about-us"},"title":{"type":"string","nullable":true,"example":"About Us"},"title_ar":{"type":"string","nullable":true,"example":"من نحن"},"icon":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/EmenuPageIcon"}]},"is_published":{"type":"boolean"},"sort_order":{"type":"number","minimum":0},"is_live_default":{"type":"boolean","description":"True when this HOME page is the live platform default theme fallback (not saved on the restaurant). Sections cannot be edited until a theme is applied."},"emenu_order_types":{"description":"Resolved e-menu order-type visibility for the requested branch (or restaurant default). Present on CHECKOUT pages.","allOf":[{"$ref":"#/components/schemas/EmenuOrderTypesVisibility"}]},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"sections":{"type":"array","description":"Ordered list of sections. Each object is discriminated by `type` — see the oneOf variants (HeroEmenuSectionResponse, ProductGridEmenuSectionResponse, …) for per-type content schemas.","items":{"oneOf":[{"$ref":"#/components/schemas/HeroEmenuSectionResponse"},{"$ref":"#/components/schemas/ProductGridEmenuSectionResponse"},{"$ref":"#/components/schemas/SliderEmenuSectionResponse"},{"$ref":"#/components/schemas/FeaturedSliderEmenuSectionResponse"},{"$ref":"#/components/schemas/ReviewsEmenuSectionResponse"},{"$ref":"#/components/schemas/FaqEmenuSectionResponse"},{"$ref":"#/components/schemas/QuickLinksEmenuSectionResponse"},{"$ref":"#/components/schemas/EnhancedFeaturesEmenuSectionResponse"},{"$ref":"#/components/schemas/CategoriesGridEmenuSectionResponse"},{"$ref":"#/components/schemas/PromoBannerEmenuSectionResponse"},{"$ref":"#/components/schemas/OrderTypeEmenuSectionResponse"},{"$ref":"#/components/schemas/PlaceOrderEmenuSectionResponse"},{"$ref":"#/components/schemas/TextBlockEmenuSectionResponse"},{"$ref":"#/components/schemas/AnnouncementEmenuSectionResponse"},{"$ref":"#/components/schemas/FeaturedItemEmenuSectionResponse"},{"$ref":"#/components/schemas/ImageBannerEmenuSectionResponse"},{"$ref":"#/components/schemas/DividerEmenuSectionResponse"}],"discriminator":{"propertyName":"type","mapping":{"HERO":"#/components/schemas/HeroEmenuSectionResponse","PRODUCT_GRID":"#/components/schemas/ProductGridEmenuSectionResponse","SLIDER":"#/components/schemas/SliderEmenuSectionResponse","FEATURED_SLIDER":"#/components/schemas/FeaturedSliderEmenuSectionResponse","REVIEWS":"#/components/schemas/ReviewsEmenuSectionResponse","FAQ":"#/components/schemas/FaqEmenuSectionResponse","QUICK_LINKS":"#/components/schemas/QuickLinksEmenuSectionResponse","ENHANCED_FEATURES":"#/components/schemas/EnhancedFeaturesEmenuSectionResponse","CATEGORIES_GRID":"#/components/schemas/CategoriesGridEmenuSectionResponse","PROMO_BANNER":"#/components/schemas/PromoBannerEmenuSectionResponse","ORDER_TYPE":"#/components/schemas/OrderTypeEmenuSectionResponse","PLACE_ORDER":"#/components/schemas/PlaceOrderEmenuSectionResponse","TEXT_BLOCK":"#/components/schemas/TextBlockEmenuSectionResponse","ANNOUNCEMENT":"#/components/schemas/AnnouncementEmenuSectionResponse","FEATURED_ITEM":"#/components/schemas/FeaturedItemEmenuSectionResponse","IMAGE_BANNER":"#/components/schemas/ImageBannerEmenuSectionResponse","DIVIDER":"#/components/schemas/DividerEmenuSectionResponse"}}}}},"required":["id","restaurant_id","page_type","slug","is_published","sort_order","created_at","updated_at","sections"],"title":"EmenuPageResponseDto"},"UpdateEmenuCustomPageDto":{"type":"object","properties":{"title":{"type":"string","maxLength":120,"example":"About Us"},"title_ar":{"type":"string","maxLength":120,"example":"من نحن"},"slug":{"type":"string","minLength":1,"maxLength":80,"example":"about-us","description":"URL slug (lowercase letters, numbers, hyphens). Reserved: home, checkout."},"icon":{"description":"Phosphor icon shown in storefront navigation for this page.","allOf":[{"$ref":"#/components/schemas/EmenuPageIcon"}]},"is_published":{"type":"boolean","description":"Publish immediately.","default":false},"sort_order":{"type":"number","minimum":0,"default":0}},"title":"UpdateEmenuCustomPageDto"},"EmenuSectionResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"type":{"enum":["HERO","PRODUCT_GRID","SLIDER","FEATURED_SLIDER","REVIEWS","FAQ","QUICK_LINKS","ENHANCED_FEATURES","CATEGORIES_GRID","PROMO_BANNER","TEXT_BLOCK","ANNOUNCEMENT","FEATURED_ITEM","IMAGE_BANNER","DIVIDER","ORDER_TYPE","PLACE_ORDER"],"type":"string"},"content":{"description":"Section content. Shape is determined by `type` — see per-type section response schemas.","oneOf":[{"$ref":"#/components/schemas/HeroSectionContentDto"},{"$ref":"#/components/schemas/ProductGridSectionContentDto"},{"$ref":"#/components/schemas/SliderSectionContent"},{"$ref":"#/components/schemas/FeaturedSliderSectionContent"},{"$ref":"#/components/schemas/ReviewsSectionContentDto"},{"$ref":"#/components/schemas/FaqSectionContentDto"},{"$ref":"#/components/schemas/QuickLinksSectionContentDto"},{"$ref":"#/components/schemas/EnhancedFeaturesSectionContentDto"},{"$ref":"#/components/schemas/CategoriesGridSectionContentDto"},{"$ref":"#/components/schemas/PromoBannerSectionContent"},{"$ref":"#/components/schemas/OrderTypeSectionContentDto"},{"$ref":"#/components/schemas/PlaceOrderSectionContentDto"},{"$ref":"#/components/schemas/TextBlockSectionContent"},{"$ref":"#/components/schemas/AnnouncementSectionContent"},{"$ref":"#/components/schemas/FeaturedItemSectionContent"},{"$ref":"#/components/schemas/ImageBannerSectionContent"},{"$ref":"#/components/schemas/DividerSectionContent"}]}},"required":["id","page_id","sort_order","is_active","created_at","updated_at","type","content"],"title":"EmenuSectionResponseDto"},"SectionOrderItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0}},"required":["id","sort_order"],"title":"SectionOrderItemDto"},"ReorderEmenuSectionsDto":{"type":"object","properties":{"sections":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/SectionOrderItemDto"}}},"required":["sections"],"title":"ReorderEmenuSectionsDto"},"CreateEmenuSectionDto":{"type":"object","properties":{"type":{"enum":["HERO","PRODUCT_GRID","SLIDER","FEATURED_SLIDER","REVIEWS","FAQ","QUICK_LINKS","ENHANCED_FEATURES","CATEGORIES_GRID","PROMO_BANNER","TEXT_BLOCK","ANNOUNCEMENT","FEATURED_ITEM","IMAGE_BANNER","DIVIDER","ORDER_TYPE","PLACE_ORDER"],"type":"string"},"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"content":{"additionalProperties":true,"description":"Section-specific configuration JSON. Shape varies by `type` — pick the matching schema below. For HERO see `HeroSectionContentDto`. For PRODUCT_GRID see `ProductGridSectionContentDto`. For SLIDER see `SliderSectionContent`. For FEATURED_SLIDER see `FeaturedSliderSectionContent`. For REVIEWS see `ReviewsSectionContentDto`. For FAQ see `FaqSectionContentDto`. For QUICK_LINKS see `QuickLinksSectionContentDto`. For ENHANCED_FEATURES see `EnhancedFeaturesSectionContentDto`. For CATEGORIES_GRID see `CategoriesGridSectionContentDto`. For PROMO_BANNER see `PromoBannerSectionContent`.","oneOf":[{"$ref":"#/components/schemas/HeroSectionContentDto"},{"$ref":"#/components/schemas/ProductGridSectionContentDto"},{"$ref":"#/components/schemas/SliderSectionContent"},{"$ref":"#/components/schemas/FeaturedSliderSectionContent"},{"$ref":"#/components/schemas/ReviewsSectionContentDto"},{"$ref":"#/components/schemas/FaqSectionContentDto"},{"$ref":"#/components/schemas/QuickLinksSectionContentDto"},{"$ref":"#/components/schemas/EnhancedFeaturesSectionContentDto"},{"$ref":"#/components/schemas/CategoriesGridSectionContentDto"},{"$ref":"#/components/schemas/PromoBannerSectionContent"},{"$ref":"#/components/schemas/OrderTypeSectionContentDto"},{"$ref":"#/components/schemas/PlaceOrderSectionContentDto"},{"type":"object","additionalProperties":{},"description":"Content for other section types (TEXT_BLOCK, ANNOUNCEMENT, etc.)."}]}},"required":["type","content"],"title":"CreateEmenuSectionDto"},"BatchApplySectionsDto":{"type":"object","properties":{"sections":{"minItems":1,"description":"Full list of sections to apply. All existing sections on this page are deleted and replaced atomically. `sort_order` values are assigned from the array index if omitted.","type":"array","items":{"$ref":"#/components/schemas/CreateEmenuSectionDto"}}},"required":["sections"],"title":"BatchApplySectionsDto"},"UpsertEmenuPageDto":{"type":"object","properties":{"is_published":{"type":"boolean","description":"Publish / unpublish the page."}},"title":"UpsertEmenuPageDto"},"GeneralSettingsDto":{"type":"object","properties":{"address":{"type":"string","nullable":true,"maxLength":500},"address_ar":{"type":"string","nullable":true,"maxLength":500},"city":{"type":"string","nullable":true,"maxLength":100},"city_ar":{"type":"string","nullable":true,"maxLength":100},"country":{"type":"string","maxLength":2,"example":"SA","deprecated":true,"description":"Read-only: the restaurant billing country. Ignored on PATCH (kept so old clients do not get a 400); only super-admin changes it via PUT /super-admin/restaurants/{id}/country."},"time_zone":{"type":"string","maxLength":60,"example":"Asia/Riyadh"},"currency":{"type":"string","maxLength":10,"example":"SAR"},"social_links":{"type":"object","additionalProperties":{},"nullable":true},"tax_number":{"type":"string","nullable":true,"maxLength":50,"example":"300000000000003"},"has_tax":{"type":"boolean"},"tax_rate":{"type":"number","minimum":0,"maximum":1,"example":0.15,"description":"Tax rate as a decimal (e.g. 0.15 = 15%)."},"zatca_mode":{"enum":["NONE","PHASE_1","PHASE_2"],"type":"string","description":"NONE = disabled, PHASE_1 = QR-only (no ZATCA integration), PHASE_2 = full Fatoora integration."},"cr_number":{"type":"string","nullable":true,"maxLength":50,"example":"1010010000","description":"Commercial Registration number, distinct from the VAT tax number."},"building_number":{"type":"string","nullable":true,"pattern":"^\\d{4}$","example":"1234","description":"ZATCA building number (4 digits)."},"plot_identification":{"type":"string","nullable":true,"maxLength":50,"description":"Optional plot/additional identification number."},"district":{"type":"string","nullable":true,"maxLength":100,"description":"District / neighborhood (ZATCA CitySubdivisionName)."},"district_ar":{"type":"string","nullable":true,"maxLength":100},"postal_zone":{"type":"string","nullable":true,"pattern":"^\\d{5}$","example":"12345","description":"ZATCA postal zone (5 digits)."},"ordering_enabled":{"type":"boolean"},"table_reservations_enabled":{"type":"boolean"},"loyalty_enabled":{"type":"boolean"},"show_allergen_info":{"type":"boolean"},"enable_tips":{"type":"boolean"},"default_tip_percentages":{"maxItems":6,"type":"array","items":{"type":"number","maximum":100,"minimum":0}},"service_charge_rate":{"type":"number","minimum":0,"maximum":100},"default_language":{"enum":["en","ar"],"type":"string"},"google_review_url":{"type":"string","nullable":true,"maxLength":500,"format":"uri","example":"https://g.page/r/YOUR_REVIEW_LINK/review","description":"Google review URL."},"logo_url":{"type":"string","nullable":true,"maxLength":2048,"format":"uri","example":"https://cdn.example.com/restaurant-id/logos/abc123.webp","description":"Public CDN URL of the restaurant logo. Upload via POST /restaurants/:id/media/upload?folder=logos."},"cover_image_url":{"type":"string","nullable":true,"maxLength":2048,"format":"uri","example":"https://cdn.example.com/restaurant-id/assets/cover.webp","description":"Public CDN URL of the restaurant cover image. Upload via POST /restaurants/:id/media/upload?folder=assets."}},"title":"GeneralSettingsDto"},"ShiftDto":{"type":"object","properties":{"open":{"type":"string","example":"09:00","description":"Shift start in HH:mm 24-hour format (restaurant timezone)."},"close":{"type":"string","example":"17:00","description":"Shift end in HH:mm 24-hour format. May be earlier than `open` for cross-midnight shifts (e.g. 23:00–02:00)."}},"required":["open","close"],"title":"ShiftDto"},"DayHoursDto":{"type":"object","properties":{"is_open":{"type":"boolean","description":"Whether the restaurant operates on this day."},"shifts":{"maxItems":8,"description":"Ordered list of operating shifts for the day. Maximum 8 shifts. Shifts must not overlap. Cross-midnight shifts are supported (e.g. open: \"23:00\", close: \"02:00\").","type":"array","items":{"$ref":"#/components/schemas/ShiftDto"}}},"title":"DayHoursDto"},"WorkingHoursSettingsDto":{"type":"object","properties":{"monday":{"$ref":"#/components/schemas/DayHoursDto"},"tuesday":{"$ref":"#/components/schemas/DayHoursDto"},"wednesday":{"$ref":"#/components/schemas/DayHoursDto"},"thursday":{"$ref":"#/components/schemas/DayHoursDto"},"friday":{"$ref":"#/components/schemas/DayHoursDto"},"saturday":{"$ref":"#/components/schemas/DayHoursDto"},"sunday":{"$ref":"#/components/schemas/DayHoursDto"}},"title":"WorkingHoursSettingsDto"},"ScheduledOrderSettingsDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When true, the e-menu offers a later time at checkout."},"min_lead_minutes":{"type":"number","minimum":0,"maximum":1440,"description":"Earliest slot, in minutes from now."},"max_days_ahead":{"type":"number","minimum":1,"maximum":60,"description":"Latest slot, in days from now."},"slot_minutes":{"type":"number","enum":[5,10,15,20,30,60],"description":"Step between the times the picker offers, in minutes. UI only: the server does not enforce the grid. Default 15.","default":15},"order_types":{"type":"array","uniqueItems":true,"minItems":1,"items":{"type":"string","enum":["TAKEAWAY","DELIVERY","DRIVE_THROUGH"]},"description":"Order types a customer may schedule. Default: all three."},"max_orders_per_slot":{"type":"number","nullable":true,"minimum":1,"maximum":1000,"description":"Scheduled orders one slot step can take, across every order type. Absent or null = no limit."},"asap_order_types":{"type":"array","uniqueItems":true,"items":{"type":"string","enum":["TAKEAWAY","DELIVERY","DRIVE_THROUGH"]},"description":"Order types a customer may order \"as soon as possible\". A type left out must be scheduled (while scheduling is on for it). Default: all three; may be empty."},"hours":{"nullable":true,"description":"Windows a scheduled time may fall in, per weekday, in the same shape as the working hours. Absent or null = follow the branch opening hours as they are at checkout.","type":"object","allOf":[{"$ref":"#/components/schemas/WorkingHoursSettingsDto"}]}},"required":["enabled","min_lead_minutes","max_days_ahead"],"title":"ScheduledOrderSettingsDto"},"OrderSettingsDto":{"type":"object","properties":{"accept_dine_in":{"type":"boolean"},"accept_takeaway":{"type":"boolean"},"accept_delivery":{"type":"boolean"},"accept_booking":{"type":"boolean"},"accept_drive_through":{"type":"boolean"},"accept_service":{"type":"boolean"},"show_on_emenu_dine_in":{"type":"boolean","description":"When true, dine-in is offered on e-menu checkout."},"show_on_emenu_takeaway":{"type":"boolean","description":"When true, takeaway is offered on e-menu checkout."},"show_on_emenu_delivery":{"type":"boolean","description":"When true, delivery is offered on e-menu checkout."},"show_on_emenu_booking":{"type":"boolean","description":"When true, booking is offered on e-menu checkout."},"show_on_emenu_drive_through":{"type":"boolean","description":"When true, car pickup is offered on e-menu checkout."},"show_on_emenu_service":{"type":"boolean","description":"When true, service is offered as a selectable e-menu type."},"auto_complete_orders":{"type":"boolean","description":"Status jumper: when true, a newly created order of any type — dine-in included — is fast-forwarded straight to COMPLETED. Every intermediate status effect (stock deduction, item statuses, websocket events) still runs, in order. Dine-in and booking orders keep their dining table occupied; the table is freed by closing the session, not by the jump. For counter/quick-service setups with no kitchen queue. Off by default so orders stay on the KDS (PENDING → ACCEPTED → PREPARING → READY → COMPLETED). New restaurants are created with this on; the read-time default stays off so existing restaurants are unaffected.","default":false},"scheduled_orders":{"$ref":"#/components/schemas/ScheduledOrderSettingsDto"},"preparation_time_minutes":{"type":"number","minimum":0,"maximum":1440},"min_order_amount":{"type":"number","minimum":0},"order_number_prefix":{"type":"string","maxLength":10,"deprecated":true},"show_order_notes_field":{"type":"boolean"},"delivery_fee":{"type":"number","nullable":true,"minimum":0,"description":"Flat delivery fee applied to delivery orders."},"delivery_fee_per_km":{"type":"number","nullable":true,"minimum":0,"description":"Per-km delivery fee."},"delivery_max_km":{"type":"number","nullable":true,"minimum":0,"description":"Maximum delivery radius in km."}},"title":"OrderSettingsDto"},"HyperPayEntityIdsDto":{"type":"object","properties":{"visa":{"type":"string","description":"HyperPay entity ID for Visa/Mastercard."},"mada":{"type":"string","description":"HyperPay entity ID for Mada."},"apple_pay":{"type":"string","description":"HyperPay entity ID for Apple Pay."}},"title":"HyperPayEntityIdsDto"},"HyperPayProviderConfigDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"access_token":{"type":"string","description":"HyperPay access token — never returned in GET responses."},"base_url":{"type":"string","format":"uri","description":"Override HyperPay base URL."},"currency":{"type":"string","maxLength":3,"description":"Currency code (ISO 4217, e.g. \"SAR\")."},"entity_ids":{"$ref":"#/components/schemas/HyperPayEntityIdsDto"}},"title":"HyperPayProviderConfigDto"},"TamaraProviderConfigDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"api_token":{"type":"string","description":"Tamara API token — never returned in GET responses."},"notification_token":{"type":"string","description":"Tamara notification token (verifies webhooks) — never returned in GET responses."},"public_key":{"type":"string","description":"Tamara public key (promotional widgets only)."}},"title":"TamaraProviderConfigDto"},"PaymobProviderConfigDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"secret_key":{"type":"string","description":"Paymob secret key — never returned in GET responses."},"public_key":{"type":"string","description":"Paymob public key."},"integration_id":{"type":"number","description":"Paymob integration ID."},"hmac_secret":{"type":"string","description":"Paymob HMAC secret for webhook verification — never returned in GET responses."},"base_url":{"type":"string","format":"uri","description":"Override Paymob base URL."}},"title":"PaymobProviderConfigDto"},"MyfatoorahProviderConfigDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"api_key":{"type":"string","description":"MyFatoorah API key — never returned in GET responses."},"base_url":{"type":"string","format":"uri","description":"MyFatoorah API base URL — determines the environment/region directly (e.g. https://apitest.myfatoorah.com for sandbox, https://api-sa.myfatoorah.com for KSA). Required to initiate payments."},"webhook_secret":{"type":"string","description":"MyFatoorah webhook secret for signature verification — never returned in GET responses."},"supplier_code":{"type":"string","description":"MyFatoorah multi-vendor SupplierCode. When set, the payment invoice is attached to this supplier (the remaining supplier fields are derived from the order amount)."},"card_networks":{"type":"array","items":{"type":"string","enum":["visa","mastercard","mada","amex"]},"description":"Card networks shown in the in-page (embedded) checkout, e.g. [\"mada\",\"visa\",\"mastercard\"]. Omit or send an empty list to accept every network enabled on the MyFatoorah account. Ignored on the hosted MyFatoorah page."},"checkout_methods":{"type":"array","items":{"type":"string","enum":["card","apple_pay","google_pay","stc_pay"]},"description":"Payment methods shown in the in-page (embedded) checkout, e.g. [\"card\",\"apple_pay\"]. Omit or send an empty list to show every method enabled on the account."}},"title":"MyfatoorahProviderConfigDto"},"AfsPayProviderConfigDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"access_token":{"type":"string","description":"AFS Pay access token — never returned in GET responses."},"entity_id":{"type":"string","description":"AFS Pay entity ID."}},"title":"AfsPayProviderConfigDto"},"NeoleapProviderConfigDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"tran_portal_id":{"type":"string","description":"Neoleap transaction portal ID."},"tran_portal_password":{"type":"string","description":"Neoleap transaction portal password — never returned in GET responses."},"resource_key":{"type":"string","description":"Neoleap resource key — never returned in GET responses."}},"title":"NeoleapProviderConfigDto"},"MoyasarProviderConfigDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"secret_key":{"type":"string","description":"Moyasar secret key (sk_…) — never returned in GET responses."},"publishable_key":{"type":"string","description":"Moyasar publishable key (pk_…), handed to the browser."},"webhook_secret":{"type":"string","description":"Webhook shared secret (Moyasar secret_token) — never returned in GET responses."},"base_url":{"type":"string","format":"uri","description":"API base URL. Default https://api.moyasar.com."},"apple_pay_merchant_id":{"type":"string","description":"Turns Apple Pay on: it is offered only when this is set. Moyasar validates the merchant itself (`applepay/initiate`), so the value is not sent anywhere. Set it once the site's domain is verified for Apple Pay in the Moyasar dashboard (the domain must serve Moyasar's apple-developer-merchantid-domain-association file)."},"apple_pay_label":{"type":"string","maxLength":64,"description":"Label shown on the Apple Pay sheet. Latin letters only: Moyasar refuses another script, and the form then falls back to \"twlm\"."}},"title":"MoyasarProviderConfigDto"},"PaymentProvidersDto":{"type":"object","properties":{"hyperpay":{"$ref":"#/components/schemas/HyperPayProviderConfigDto"},"tamara":{"$ref":"#/components/schemas/TamaraProviderConfigDto"},"paymob":{"$ref":"#/components/schemas/PaymobProviderConfigDto"},"myfatoorah":{"$ref":"#/components/schemas/MyfatoorahProviderConfigDto"},"afs_pay":{"$ref":"#/components/schemas/AfsPayProviderConfigDto"},"neoleap":{"$ref":"#/components/schemas/NeoleapProviderConfigDto"},"moyasar":{"$ref":"#/components/schemas/MoyasarProviderConfigDto"}},"title":"PaymentProvidersDto"},"PaymentSettingsDto":{"type":"object","properties":{"enabled_methods":{"type":"array","items":{"type":"string","enum":["cash","card","mada","apple_pay","stc_pay"]},"description":"Payment methods offered at checkout."},"allow_split_payment":{"type":"boolean","description":"Allow customers to split payment across methods."},"require_cash_confirmation":{"type":"boolean","description":"Require staff confirmation for cash payments."},"providers":{"readOnly":true,"description":"Connection status per gateway (secrets stripped). Read-only here — write credentials via PUT /restaurant-settings/payments/providers/{provider}.","allOf":[{"$ref":"#/components/schemas/PaymentProvidersDto"}]}},"title":"PaymentSettingsDto"},"InvoiceSettingsDto":{"type":"object","properties":{"show_zatca_qr":{"type":"boolean","description":"Show the ZATCA e-invoicing QR code on the invoice. Only takes effect when ZATCA is enabled for the restaurant (general.zatcaMode !== NONE) and the order has been stamped with a QR payload."},"show_twlm_qr":{"type":"boolean","description":"Show the TWLM QR code on the invoice. It encodes the public invoice URL, so a customer can scan it to open their digital invoice."},"header_text":{"type":"string","nullable":true,"maxLength":500,"description":"Custom header text printed at the top of the invoice."},"header_text_ar":{"type":"string","nullable":true,"maxLength":500,"description":"Arabic version of the invoice header text."},"footer_text":{"type":"string","nullable":true,"maxLength":500,"description":"Custom footer text printed at the bottom (e.g. \"Thank you for your visit!\")."},"footer_text_ar":{"type":"string","nullable":true,"maxLength":500,"description":"Arabic version of the invoice footer text."},"show_customer_info":{"type":"boolean","description":"Show the customer name and phone on the invoice."},"show_order_notes":{"type":"boolean","description":"Show the order notes section on the invoice."},"show_tax_breakdown":{"type":"boolean","description":"Show tax as a separate line item rather than folding it into the total."},"show_loyalty_points":{"type":"boolean","description":"Show loyalty points earned and redeemed on the invoice."},"invoice_number_start":{"type":"number","minimum":1,"maximum":1000000000,"description":"The number the printed fatora (b2b/b2c invoice) numbering begins from — a cosmetic counter shared across both invoice types, independent of the order reference number (serial_number, which keeps running 1, 2, 3 per shift) and of the ZATCA ICV. The first fatora is this number, then it climbs. Changing it makes the next fatora at every branch start from the new value. Setting a value already passed can repeat printed numbers.","default":1},"reset_invoice_number_per_shift":{"type":"boolean","description":"When true, the fatora number restarts from invoiceNumberStart at the start of each shift session (same trigger as the order reference number). When false, it carries over across shifts and only restarts when invoiceNumberStart is changed.","default":true},"invoice_number_cap":{"type":"number","nullable":true,"minimum":1,"maximum":1000000000,"description":"Optional ceiling for the fatora number. When the number reaches this value, the next one wraps back to invoiceNumberStart (e.g. cap 100 → …99, 100, then back to the start). null means no ceiling — the number only restarts per the shift/day reset. Ignored if below the start. Does NOT affect the ZATCA ICV."},"invoice_number_prefix":{"type":"string","maxLength":10,"description":"Text printed before the fatora number (e.g. \"INV-\" → INV-60). Restaurant-wide; does not change the stored number or the ZATCA ICV, only what is printed."},"invoice_branch_overrides":{"type":"object","additionalProperties":true,"description":"Per-branch overrides of the fatora numbering, keyed by branch id: { \"<branchId>\": { start?, cap?, resetPerShift? } }. Any omitted field inherits the restaurant-wide value above. Prefix is always restaurant-wide and cannot be overridden."}},"title":"InvoiceSettingsDto"},"LoyaltySettingsDto":{"type":"object","properties":{"points_per_unit":{"type":"number","minimum":0,"example":1,"description":"Points earned per 1 currency unit spent on items that have no per-product override."},"point_value":{"type":"number","minimum":0,"example":0.01,"description":"Currency value of 1 redeemed point (e.g. 0.01 = 100 points → 1 unit discount)."},"points_expiry_days":{"type":"number","nullable":true,"minimum":1,"maximum":3650,"example":365,"description":"Days until an earned batch of points expires. null = no expiry. Each EARN event gets its own expiry date computed at earn time."},"max_redemption_points_per_order":{"type":"number","nullable":true,"minimum":1,"example":500,"description":"Maximum points a customer can redeem on a single order. null = unlimited."},"min_order_amount_to_earn":{"type":"number","minimum":0,"example":0,"description":"Minimum order total (SAR) required to earn points. 0 = always earn."}},"title":"LoyaltySettingsDto"},"LoyaltyPassSettingsDto":{"type":"object","properties":{"promo_alert_message":{"type":"string","nullable":true,"maxLength":200},"promo_alert_title":{"type":"string","nullable":true,"maxLength":100},"geo_alert_message":{"type":"string","nullable":true,"maxLength":200}},"title":"LoyaltyPassSettingsDto"},"RestaurantSettingsDto":{"type":"object","properties":{"general":{"$ref":"#/components/schemas/GeneralSettingsDto"},"working_hours":{"$ref":"#/components/schemas/WorkingHoursSettingsDto"},"orders":{"$ref":"#/components/schemas/OrderSettingsDto"},"payments":{"$ref":"#/components/schemas/PaymentSettingsDto"},"invoice":{"$ref":"#/components/schemas/InvoiceSettingsDto"},"loyalty":{"$ref":"#/components/schemas/LoyaltySettingsDto"},"loyalty_pass":{"$ref":"#/components/schemas/LoyaltyPassSettingsDto"}},"title":"RestaurantSettingsDto"},"BranchInvoiceOverrideResponseDto":{"type":"object","properties":{"start":{"type":"number","nullable":true},"cap":{"type":"number","nullable":true},"reset_per_shift":{"type":"boolean","nullable":true}},"title":"BranchInvoiceOverrideResponseDto"},"BranchInvoiceNumberingDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"branch_name":{"type":"string"},"branch_name_ar":{"type":"string","nullable":true},"effective_start":{"type":"number"},"effective_cap":{"type":"number","nullable":true},"effective_reset_per_shift":{"type":"boolean"},"override":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/BranchInvoiceOverrideResponseDto"}]},"current_counter":{"type":"number","nullable":true,"description":"Last assigned number, or null."},"last_reset_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["branch_id","branch_name","branch_name_ar","effective_start","effective_cap","effective_reset_per_shift","override","current_counter","last_reset_at"],"title":"BranchInvoiceNumberingDto"},"InvoiceNumberingResponseDto":{"type":"object","properties":{"branches":{"type":"array","items":{"$ref":"#/components/schemas/BranchInvoiceNumberingDto"}}},"required":["branches"],"title":"InvoiceNumberingResponseDto"},"PaymentProviderConnectionDto":{"type":"object","properties":{"provider":{"type":"string","enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"]},"enabled":{"type":"boolean","description":"Whether this gateway is active for the restaurant."},"environment":{"type":"string","enum":["sandbox","production"]},"configured":{"type":"boolean","description":"True once every credential the gateway needs to transact is stored."},"secret_hint":{"type":"string","nullable":true,"description":"Last 4 characters of the stored primary credential, or null when none is set."},"base_url":{"type":"string","description":"Gateway API base URL. HyperPay, Paymob, MyFatoorah."},"currency":{"type":"string","description":"Currency code (ISO 4217). HyperPay."},"entity_ids":{"description":"HyperPay entity IDs.","allOf":[{"$ref":"#/components/schemas/HyperPayEntityIdsDto"}]},"merchant_id":{"type":"string","description":"Tamara merchant ID."},"notification_key":{"type":"string","description":"Tamara notification key."},"public_key":{"type":"string","description":"Paymob public key."},"integration_id":{"type":"number","description":"Paymob integration ID."},"supplier_code":{"type":"string","description":"MyFatoorah multi-vendor SupplierCode."},"entity_id":{"type":"string","description":"AFS Pay entity ID."},"tran_portal_id":{"type":"string","description":"Neoleap transaction portal ID."}},"required":["provider","enabled","environment","configured","secret_hint"],"title":"PaymentProviderConnectionDto"},"UpdatePaymentProviderDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this provider is active for the restaurant."},"environment":{"enum":["sandbox","production"],"type":"string"},"card_networks":{"type":"array","items":{"type":"string","enum":["visa","mastercard","mada","amex"]},"description":"In-page checkout only: card networks to accept (MyFatoorah). Empty = every network on the account."},"checkout_methods":{"type":"array","items":{"type":"string","enum":["card","apple_pay","google_pay","stc_pay"]},"description":"In-page checkout only: methods to offer (MyFatoorah). Empty = every method on the account."}},"title":"UpdatePaymentProviderDto"},"FoodZoneBranchMappingDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid","description":"Our branch id."},"store_id":{"type":"string","maxLength":64,"description":"Foodizone store id of this branch — the webhook's `store_id`. Belongs to one branch only.","example":"6943e5810e19f23afabcc1fb"}},"required":["branch_id","store_id"],"title":"FoodZoneBranchMappingDto"},"FoodZoneChannelMappingDto":{"type":"object","properties":{"channel_id":{"type":"string","format":"uuid","description":"Our ordering channel id."},"provider":{"type":"string","maxLength":64,"description":"Delivery app as Foodizone names it — the webhook's `provider_name` and `customProviderPrices[].providerName`.","example":"Jahez"}},"required":["channel_id","provider"],"title":"FoodZoneChannelMappingDto"},"FoodZoneIntegrationDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether Foodizone orders are accepted."},"configured":{"type":"boolean","description":"True once an API token is stored."},"secret_hint":{"type":"string","nullable":true,"description":"Last 4 characters of the stored API token, or null when none is set."},"branches":{"description":"Branches that receive Foodizone orders, each with its store id.","type":"array","items":{"$ref":"#/components/schemas/FoodZoneBranchMappingDto"}},"channels":{"description":"Ordering channels paired with a delivery app.","type":"array","items":{"$ref":"#/components/schemas/FoodZoneChannelMappingDto"}}},"required":["enabled","configured","secret_hint","branches","channels"],"title":"FoodZoneIntegrationDto"},"ReplaceFoodZoneIntegrationDto":{"type":"object","properties":{"api_token":{"type":"string","maxLength":2048,"description":"Foodizone API token for this restaurant — never returned in GET responses."},"enabled":{"type":"boolean","description":"Whether Foodizone orders are accepted. Omit to keep the current value (off for a new connection)."}},"required":["api_token"],"title":"ReplaceFoodZoneIntegrationDto"},"UpdateFoodZoneIntegrationDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether Foodizone orders are accepted."}},"required":["enabled"],"title":"UpdateFoodZoneIntegrationDto"},"ReplaceFoodZoneBranchesDto":{"type":"object","properties":{"branches":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/FoodZoneBranchMappingDto"}}},"required":["branches"],"title":"ReplaceFoodZoneBranchesDto"},"ReplaceFoodZoneChannelsDto":{"type":"object","properties":{"channels":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/FoodZoneChannelMappingDto"}}},"required":["channels"],"title":"ReplaceFoodZoneChannelsDto"},"EmenuBuilderThemeGalleryItemDto":{"type":"object","properties":{"type":{"enum":["image","video"],"type":"string"},"url":{"type":"string","maxLength":2000,"format":"uri","example":"https://cdn.example.com/preview.jpg"}},"required":["type","url"],"title":"EmenuBuilderThemeGalleryItemDto"},"EmenuBuilderThemeListItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"gallery":{"type":"array","items":{"$ref":"#/components/schemas/EmenuBuilderThemeGalleryItemDto"}},"preview_image_url":{"type":"string","nullable":true},"sort_order":{"type":"number"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","name","name_ar","gallery","preview_image_url","sort_order","is_active","created_at","updated_at"],"title":"EmenuBuilderThemeListItemResponseDto"},"EmenuCustomScript":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"example":"Google Analytics"},"code":{"type":"string","maxLength":50000,"example":"<script>/* analytics */</script>","description":"Raw HTML/JS injected last on public e-menu pages."}},"required":["code"],"title":"EmenuCustomScript"},"EmenuBuilderThemeSettingsPayloadDto":{"type":"object","properties":{"header":{"type":"object","additionalProperties":true},"footer":{"type":"object","additionalProperties":true},"theme":{"type":"object","additionalProperties":true},"product_card":{"type":"object","additionalProperties":true},"category_card":{"type":"object","additionalProperties":true},"social_links":{"type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"custom_scripts":{"type":"array","items":{"$ref":"#/components/schemas/EmenuCustomScript"}}},"title":"EmenuBuilderThemeSettingsPayloadDto"},"EmenuBuilderThemePayloadDto":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/EmenuBuilderThemeSettingsPayloadDto"},"home_sections":{"minItems":1,"description":"HOME page section snapshot applied when a restaurant selects this theme.","type":"array","items":{"$ref":"#/components/schemas/CreateEmenuSectionDto"}}},"required":["settings","home_sections"],"title":"EmenuBuilderThemePayloadDto"},"CreateEmenuBuilderThemeDto":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"example":"Modern Bistro"},"name_ar":{"type":"string","nullable":true,"maxLength":200,"example":"مطعم عصري"},"gallery":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/EmenuBuilderThemeGalleryItemDto"}},"preview_image_url":{"type":"string","nullable":true,"maxLength":2000},"sort_order":{"type":"number","minimum":0,"default":0},"is_active":{"type":"boolean","default":true},"payload":{"$ref":"#/components/schemas/EmenuBuilderThemePayloadDto"}},"required":["name","payload"],"title":"CreateEmenuBuilderThemeDto"},"EmenuBuilderThemeResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"gallery":{"type":"array","items":{"$ref":"#/components/schemas/EmenuBuilderThemeGalleryItemDto"}},"preview_image_url":{"type":"string","nullable":true},"sort_order":{"type":"number"},"is_active":{"type":"boolean"},"payload":{"$ref":"#/components/schemas/EmenuBuilderThemePayloadDto"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","name","name_ar","gallery","preview_image_url","sort_order","is_active","payload","created_at","updated_at"],"title":"EmenuBuilderThemeResponseDto"},"UpdateEmenuBuilderThemeDto":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"name_ar":{"type":"string","nullable":true,"maxLength":200},"gallery":{"type":"array","items":{"$ref":"#/components/schemas/EmenuBuilderThemeGalleryItemDto"}},"preview_image_url":{"type":"string","nullable":true,"maxLength":2000},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"payload":{"$ref":"#/components/schemas/EmenuBuilderThemePayloadDto"}},"title":"UpdateEmenuBuilderThemeDto"},"EmenuBuilderGalleryDefaultResponseDto":{"type":"object","properties":{"theme_id":{"type":"string","format":"uuid"},"theme_name":{"type":"string"}},"required":["theme_id","theme_name"],"title":"EmenuBuilderGalleryDefaultResponseDto"},"EmenuBuilderGalleryDefaultNullableResponseDto":{"type":"object","properties":{"default":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/EmenuBuilderGalleryDefaultResponseDto"}]}},"title":"EmenuBuilderGalleryDefaultNullableResponseDto"},"UpsertEmenuBuilderGalleryDefaultDto":{"type":"object","properties":{"theme_id":{"type":"string","format":"uuid"}},"required":["theme_id"],"title":"UpsertEmenuBuilderGalleryDefaultDto"},"EmenuBuilderThemeGalleryItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"gallery":{"type":"array","items":{"$ref":"#/components/schemas/EmenuBuilderThemeGalleryItemDto"}},"preview_image_url":{"type":"string","nullable":true},"sort_order":{"type":"number"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"is_default":{"type":"boolean"}},"required":["id","name","name_ar","gallery","preview_image_url","sort_order","is_active","created_at","updated_at","is_default"],"title":"EmenuBuilderThemeGalleryItemResponseDto"},"EmenuBuilderThemeApplyResponseDto":{"type":"object","properties":{"theme_id":{"type":"string","format":"uuid"},"applied_at":{"format":"date-time","type":"string"}},"required":["theme_id","applied_at"],"title":"EmenuBuilderThemeApplyResponseDto"},"GooglePlaceReviewResponseDto":{"type":"object","properties":{"author_name":{"type":"string","example":"Sarah M."},"rating":{"type":"number","minimum":1,"maximum":5,"example":5},"text":{"type":"string","example":"Amazing food and fast service!"},"relative_time_description":{"type":"string","example":"2 weeks ago"},"profile_photo_url":{"type":"string","example":"https://lh3.googleusercontent.com/a/default-user"}},"required":["author_name","rating","text","relative_time_description"],"title":"GooglePlaceReviewResponseDto"},"GooglePlaceReviewsResponseDto":{"type":"object","properties":{"rating":{"type":"number","example":4.6},"user_ratings_total":{"type":"number","example":128},"reviews":{"type":"array","items":{"$ref":"#/components/schemas/GooglePlaceReviewResponseDto"}}},"required":["rating","user_ratings_total","reviews"],"title":"GooglePlaceReviewsResponseDto"},"HeaderWrapper":{"type":"object","properties":{"props":{"$ref":"#/components/schemas/WrapperSettings"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"HeaderWrapper"},"HeaderNavigationBar":{"type":"object","properties":{"type":{"enum":["sidebar","bottom"],"type":"string","example":"bottom"},"position":{"enum":["start","end"],"type":"string","example":"start"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"HeaderNavigationBar"},"HeaderNavigation":{"type":"object","properties":{"bar":{"$ref":"#/components/schemas/HeaderNavigationBar"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"HeaderNavigation"},"HeaderBrandingImage":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"HeaderBrandingImage"},"HeaderBranding":{"type":"object","properties":{"show":{"type":"boolean","default":true},"image":{"$ref":"#/components/schemas/HeaderBrandingImage"}},"title":"HeaderBranding"},"EmenuHeader":{"type":"object","properties":{"accent_color":{"type":"string","example":"#e63946"},"show_restaurant_name":{"type":"boolean","default":true},"wrapper":{"$ref":"#/components/schemas/HeaderWrapper"},"navigation":{"$ref":"#/components/schemas/HeaderNavigation"},"branding":{"$ref":"#/components/schemas/HeaderBranding"}},"title":"EmenuHeader"},"FooterWrapper":{"type":"object","properties":{"props":{"$ref":"#/components/schemas/WrapperSettings"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"FooterWrapper"},"FooterBranding":{"type":"object","properties":{"show":{"type":"boolean","default":true}},"title":"FooterBranding"},"FooterSocialIcons":{"type":"object","properties":{"show":{"type":"boolean","default":true}},"title":"FooterSocialIcons"},"FooterAppButtons":{"type":"object","properties":{"show":{"type":"boolean","default":true},"apple_url":{"type":"string","format":"uri","example":"https://apps.apple.com/app/id123456789","description":"App Store download URL. Button is hidden when empty."},"google_url":{"type":"string","format":"uri","example":"https://play.google.com/store/apps/details?id=com.example.app","description":"Google Play download URL. Button is hidden when empty."}},"title":"FooterAppButtons"},"FooterHeadingText":{"type":"object","properties":{"value":{"type":"string","example":"Stay connected"},"value_ar":{"type":"string","example":"ابق على تواصل"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"FooterHeadingText"},"FooterBottomBar":{"type":"object","properties":{"show":{"type":"boolean","default":true},"text":{"type":"string","example":"All rights reserved © 2026"},"text_ar":{"type":"string","example":"© 2026 جميع الحقوق محفوظة"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"FooterBottomBar"},"EmenuFooter":{"type":"object","properties":{"wrapper":{"$ref":"#/components/schemas/FooterWrapper"},"branding":{"$ref":"#/components/schemas/FooterBranding"},"social_icons":{"$ref":"#/components/schemas/FooterSocialIcons"},"app_buttons":{"$ref":"#/components/schemas/FooterAppButtons"},"title":{"$ref":"#/components/schemas/FooterHeadingText"},"subtitle":{"$ref":"#/components/schemas/FooterHeadingText"},"description":{"$ref":"#/components/schemas/FooterHeadingText"},"bottom_bar":{"$ref":"#/components/schemas/FooterBottomBar"},"text":{"type":"string","example":"All rights reserved © 2026","deprecated":true},"text_ar":{"type":"string","example":"© 2026 جميع الحقوق محفوظة","deprecated":true},"show_social_links":{"type":"boolean","default":false,"deprecated":true},"social_links":{"deprecated":true,"type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"show_contact_info":{"type":"boolean","default":false,"deprecated":true}},"title":"EmenuFooter"},"CardWrapperBlockDto":{"type":"object","properties":{"props":{"type":"object","additionalProperties":{},"description":"Card wrapper props (TBD)"},"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"CardWrapperBlockDto"},"CardStyleBlockDto":{"type":"object","properties":{"style":{"$ref":"#/components/schemas/ResponsiveStyle"}},"title":"CardStyleBlockDto"},"ProductCardSettingsDto":{"type":"object","properties":{"card_wrapper":{"$ref":"#/components/schemas/CardWrapperBlockDto"},"image":{"$ref":"#/components/schemas/CardStyleBlockDto"},"content":{"$ref":"#/components/schemas/CardStyleBlockDto"},"badges":{"$ref":"#/components/schemas/CardStyleBlockDto"},"button":{"$ref":"#/components/schemas/CardStyleBlockDto"}},"title":"ProductCardSettingsDto"},"CategoryCardSettingsDto":{"type":"object","properties":{"card_wrapper":{"$ref":"#/components/schemas/CardWrapperBlockDto"},"image":{"$ref":"#/components/schemas/CardStyleBlockDto"},"content":{"$ref":"#/components/schemas/CardStyleBlockDto"}},"title":"CategoryCardSettingsDto"},"EmenuTheme":{"type":"object","properties":{"primary_color":{"type":"string","example":"#800000"},"secondary_color":{"type":"string","example":"#f5efe8"},"style":{"description":"Responsive shell styles per breakpoint. Common keys: `background_color`, `color` (text), `background_image`, `font_family`.","allOf":[{"$ref":"#/components/schemas/ResponsiveStyle"}]}},"title":"EmenuTheme"},"EmenuSettingsResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"header":{"$ref":"#/components/schemas/EmenuHeader"},"footer":{"$ref":"#/components/schemas/EmenuFooter"},"product_card":{"$ref":"#/components/schemas/ProductCardSettingsDto"},"category_card":{"$ref":"#/components/schemas/CategoryCardSettingsDto"},"theme":{"$ref":"#/components/schemas/EmenuTheme"},"social_links":{"type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"custom_scripts":{"type":"array","items":{"$ref":"#/components/schemas/EmenuCustomScript"}},"is_live_default":{"type":"boolean","description":"True when every shell/config surface is still the live platform default (nothing saved on the restaurant yet)."},"emenu_order_types":{"description":"Resolved e-menu order-type visibility for the requested branch (or restaurant default). Fallback when the CHECKOUT page is unpublished.","allOf":[{"$ref":"#/components/schemas/EmenuOrderTypesVisibility"}]},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","header","footer","product_card","category_card","theme","social_links","custom_scripts","created_at","updated_at"],"title":"EmenuSettingsResponseDto"},"UpdateEmenuSettingsDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/EmenuHeader"},"footer":{"$ref":"#/components/schemas/EmenuFooter"},"product_card":{"$ref":"#/components/schemas/ProductCardSettingsDto"},"category_card":{"$ref":"#/components/schemas/CategoryCardSettingsDto"},"theme":{"description":"Global e-menu theme (responsive background/text colors, background image, font family). Stored in `config.theme`.","allOf":[{"$ref":"#/components/schemas/EmenuTheme"}]},"social_links":{"description":"Shared e-menu social links. Replaces the stored array when sent.","type":"array","items":{"$ref":"#/components/schemas/SocialLink"}},"custom_scripts":{"description":"Custom HTML/JS injected last on public e-menu pages. Replaces the stored array when sent.","type":"array","items":{"$ref":"#/components/schemas/EmenuCustomScript"}}},"title":"UpdateEmenuSettingsDto"},"OfflineDeviceTotalsDto":{"type":"object","properties":{"subtotal":{"type":"number","minimum":0,"example":50},"tax_amount":{"type":"number","minimum":0,"example":6.52},"discount_amount":{"type":"number","minimum":0,"example":0},"total":{"type":"number","minimum":0,"example":50}},"required":["subtotal","tax_amount","discount_amount","total"],"title":"OfflineDeviceTotalsDto"},"OfflineSyncActionDto":{"type":"object","properties":{"action_id":{"type":"string","format":"uuid","description":"Client-generated, unique forever."},"type":{"type":"string","maxLength":64,"example":"order.create","enum":["order.create","shift.open","shift.close","payment.add","order.update","order.defer","order.void","order.cancel","order.return","order.status","payment.record","customer.create","table.open","table.close","order.items.add","order.items.remove","order.send_to_kitchen","booking.create","booking.status"]},"occurred_at":{"type":"string","example":"2026-09-23T18:04:11.201Z","description":"When the cashier did it, already corrected by the device clock offset."},"actor_staff_id":{"type":"string","format":"uuid","description":"The cashier who did it on the device; may differ from the uploader. Must be active, assigned to the branch and allowed the action (else `ACTOR_NOT_ALLOWED`)."},"client_ref":{"type":"string","nullable":true,"format":"uuid","description":"Temporary id on the device of the record the action is about: the order for `order.create`, `table.open` and `booking.create` (required; for a booking, its linked order) and for actions on an existing order (unless `order_id` is sent) and `booking.status` (unless `payload.booking_id` is sent), the shift for `shift.open` (required) and `shift.close` (unless `shift_id` is sent), the customer for `customer.create` (required)."},"order_id":{"type":"string","nullable":true,"format":"uuid","description":"Actions on an existing order (`payment.add`, `payment.record`, `order.update`, `order.defer`, `order.void`, `order.cancel`, `order.return`, `order.status`, `order.items.add`, `order.items.remove`, `order.send_to_kitchen`, `table.close`): its server id, when the device knows it; otherwise the order is found by `client_ref`."},"shift_id":{"type":"string","nullable":true,"format":"uuid","description":"Server id of the shift, when the device knows it. `order.create`: the shift the order was sold under. `payment.add` / `payment.record`: the shift that took the money. `shift.close`: the shift to close."},"shift_client_ref":{"type":"string","nullable":true,"format":"uuid","description":"`order.create` / `table.open` / `payment.add` / `payment.record`: the `client_ref` of the offline `shift.open` the order was sold (or the money taken) under, when the device has no server id for it yet."},"customer_client_ref":{"type":"string","nullable":true,"format":"uuid","description":"`order.create`, `order.update`, `order.defer`, `payment.record`, `booking.create`: the `client_ref` of an offline `customer.create`, when the device has no server id for the customer yet. The server puts that customer's id in the payload's `customer_id`."},"offline_number":{"type":"string","nullable":true,"maxLength":32,"example":"B17"},"completed":{"type":"boolean","nullable":true,"example":true,"description":"`order.create`: true when the device recorded the order as COMPLETED (the restaurant auto-completes orders). The order then ends COMPLETED whatever the setting is at sync time; false keeps it open whatever the setting is. Absent (older builds) follows the setting. Ignored on other actions."},"payload":{"type":"object","additionalProperties":true,"description":"`order.create`: the `POST /restaurants/:rid/orders` body, including inline `payments`. Actions on an existing order: the body of the matching online endpoint. `shift.open`: `{ opening_balance, opening_notes }`. `shift.close`: the `POST /cashier-shifts/:id/close` body. `customer.create`: the `POST /customers` body. `table.open` / `table.close`: `{ table_id }`. `order.items.remove`: `{ item_id }`. `booking.create`: the `POST /service-bookings` body plus `items`. `booking.status`: the `PATCH /service-bookings/:id` body plus optional `booking_id`."},"device_totals":{"nullable":true,"description":"Required for `order.create`.","type":"object","allOf":[{"$ref":"#/components/schemas/OfflineDeviceTotalsDto"}]}},"required":["action_id","type","occurred_at","actor_staff_id","payload"],"title":"OfflineSyncActionDto"},"OfflineSyncBatchDto":{"type":"object","properties":{"batch_id":{"type":"string","format":"uuid"},"installation_id":{"type":"string","format":"uuid","description":"Generated by the app on first launch."},"device_clock_offset_ms":{"type":"number","nullable":true,"example":-420000,"description":"Server time minus device time in ms, measured by the device from the HTTP `Date` header. Beyond ±300000 (5 minutes) the server opens a `clock_drift` issue."},"actions":{"description":"At most 200 actions (413 otherwise). Each is validated on its own: an invalid one is `rejected` in `received` (and stored as failed when its `action_id` is a UUID) without failing the batch.","type":"array","items":{"$ref":"#/components/schemas/OfflineSyncActionDto"}}},"required":["batch_id","installation_id","actions"],"title":"OfflineSyncBatchDto"},"OfflineSyncDeviceDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"B","description":"Letters A … Z, then AA, AB, …; printed in offline receipt numbers (`B17`)."}},"required":["id","code"],"title":"OfflineSyncDeviceDto"},"OfflineSyncErrorDto":{"type":"object","properties":{"code":{"type":"string","example":"VALIDATION","description":"`VALIDATION`, `ACTOR_NOT_ALLOWED`, `ACTION_ID_REUSED`, `UNSUPPORTED_ACTION_TYPE`, `SHIFT_NOT_FOUND`, `FORBIDDEN`, `NOT_FOUND`, `CONFLICT`, `INTERNAL_ERROR`, or a domain error code."},"message":{"type":"string"}},"required":["code","message"],"title":"OfflineSyncErrorDto"},"OfflineReceivedActionDto":{"type":"object","properties":{"action_id":{"type":"string","nullable":true,"format":"uuid","description":"Null without a usable one."},"status":{"enum":["queued","duplicate","rejected"],"type":"string","description":"`queued`: stored, to be applied. `duplicate`: already received with the same payload. `rejected`: see `error` (`ACTION_ID_REUSED`, or `VALIDATION` for a bad envelope)."},"error":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/OfflineSyncErrorDto"}]}},"required":["action_id","status","error"],"title":"OfflineReceivedActionDto"},"OfflineShiftViewDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"staff_id":{"type":"string","format":"uuid"},"status":{"enum":["OPEN","CLOSED"],"type":"string"},"opened_by_staff_id":{"type":"string","nullable":true,"format":"uuid"},"closed_by_staff_id":{"type":"string","nullable":true,"format":"uuid"},"opened_at":{"format":"date-time","type":"string"},"closed_at":{"type":"string","nullable":true,"format":"date-time"},"opening_balance":{"type":"number","example":50},"counted_closing_balance":{"type":"number","nullable":true},"expected_closing_balance":{"type":"number","nullable":true},"variance":{"type":"number","nullable":true},"opening_notes":{"type":"string","nullable":true},"closing_notes":{"type":"string","nullable":true},"closing_counts":{"nullable":true,"description":"Per-payment-method expected vs counted reconciliation, populated once the shift is closed.","type":"array","items":{"$ref":"#/components/schemas/ShiftClosingCountDto"}},"corrected_at":{"format":"date-time","type":"string","nullable":true,"description":"When a manager last corrected the closed figures; null when uncorrected."},"corrected_by_staff_id":{"type":"string","nullable":true},"correction_reason":{"type":"string","nullable":true},"staff":{"nullable":true,"description":"Present when `expand=staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"opened_by_staff":{"nullable":true,"description":"Present when `expand=opened_by_staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"closed_by_staff":{"nullable":true,"description":"Present when `expand=closed_by_staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"corrected_by_staff":{"nullable":true,"description":"Present when `expand=corrected_by_staff` is requested","type":"object","allOf":[{"$ref":"#/components/schemas/ShiftStaffExpandDto"}]},"branch":{"description":"Present when `expand=branch` is requested","allOf":[{"$ref":"#/components/schemas/ShiftBranchExpandDto"}]},"device_id":{"type":"string","nullable":true,"format":"uuid","description":"The POS installation that opened this shift offline; null when opened online."},"amended_after_close":{"type":"boolean","description":"True when offline actions synced onto this shift after it closed; its expected/variance figures were restated."},"amended_at":{"format":"date-time","type":"string","nullable":true,"description":"When the shift was last amended after close."}},"required":["id","branch_id","staff_id","status","opened_by_staff_id","closed_by_staff_id","opened_at","closed_at","opening_balance","counted_closing_balance","expected_closing_balance","variance","opening_notes","closing_notes","closing_counts","corrected_at","corrected_by_staff_id","correction_reason","device_id","amended_after_close","amended_at"],"title":"OfflineShiftViewDto"},"OfflineSyncCustomerDto":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"name":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","enum":["INDIVIDUAL","COMPANY"]},"vat_number":{"type":"string","nullable":true},"is_active":{"type":"boolean"},"loyalty_points":{"type":"number"},"credit_limit":{"type":"number","nullable":true},"updated_at":{"format":"date-time","type":"string"}},"required":["id","phone","name","name_ar","email","type","vat_number","is_active","loyalty_points","credit_limit","updated_at"],"title":"OfflineSyncCustomerDto"},"OfflineSyncResultIssueDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","example":"price_discrepancy"},"status":{"type":"string","example":"open"}},"required":["id","type","status"],"title":"OfflineSyncResultIssueDto"},"OfflineSyncResultDto":{"type":"object","properties":{"action_id":{"type":"string","format":"uuid"},"status":{"enum":["pending","applied","failed"],"type":"string","description":"`pending` until the action is applied or fails for good; poll again."},"waiting_on":{"type":"string","nullable":true,"example":null,"description":"What a pending action waits for: `order:ref:<client_ref>`, `shift:ref:<client_ref>`, `customer:ref:<client_ref>`, or `shift-drain:<shift_id>` (a close waiting for the shift's actions to settle). After 24 h it fails with DEPENDENCY_TIMEOUT."},"order":{"nullable":true,"description":"The order as it is now: same shape as `POST /orders` (which carries `client_ref`, `offline_number` and `synced_at`), plus `offline_device_id` and `offline_totals_discrepancy`.","type":"object","allOf":[{"$ref":"#/components/schemas/OrderResponseDto"}]},"shift":{"nullable":true,"description":"`shift.open` / `shift.close`: the server shift. Null for other actions.","type":"object","allOf":[{"$ref":"#/components/schemas/OfflineShiftViewDto"}]},"customer":{"nullable":true,"description":"`customer.create`: the server customer. Null for other actions.","type":"object","allOf":[{"$ref":"#/components/schemas/OfflineSyncCustomerDto"}]},"booking":{"nullable":true,"description":"`booking.create` / `booking.status`: the booking, same shape as `POST /service-bookings`. Null for other actions.","type":"object","allOf":[{"$ref":"#/components/schemas/ServiceBookingDto"}]},"bookings":{"description":"Every booking the action wrote or changed, `booking` first: an `order.create` with `service_bookings` books one per service. Empty for other actions.","type":"array","items":{"$ref":"#/components/schemas/ServiceBookingDto"}},"resolution":{"type":"string","nullable":true,"enum":["attached","created","closed","already_closed"],"description":"`shift.open`: `attached` (adopted the cashier's open shift) or `created`. `shift.close`: `closed` or `already_closed` (no-op). `customer.create`: `attached` (the restaurant already had this phone) or `created`. Null for other actions."},"issues":{"description":"Sync issues it opened.","type":"array","items":{"$ref":"#/components/schemas/OfflineSyncResultIssueDto"}},"error":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/OfflineSyncErrorDto"}]}},"required":["action_id","status","waiting_on","order","shift","customer","booking","bookings","resolution","issues","error"],"title":"OfflineSyncResultDto"},"OfflineSyncBatchResponseDto":{"type":"object","properties":{"device":{"$ref":"#/components/schemas/OfflineSyncDeviceDto"},"received":{"description":"One per action, as sent.","type":"array","items":{"$ref":"#/components/schemas/OfflineReceivedActionDto"}},"results":{"description":"The batch's actions already settled, in the order they settled.","type":"array","items":{"$ref":"#/components/schemas/OfflineSyncResultDto"}}},"required":["device","received","results"],"title":"OfflineSyncBatchResponseDto"},"OfflineSyncResultsResponseDto":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/OfflineSyncResultDto"}},"next_cursor":{"type":"string","nullable":true,"description":"By `installation_id`: pass as `after` next time (unchanged when nothing new settled). Null by `action_ids`."},"has_more":{"type":"boolean","description":"Whether another page follows right away."}},"required":["results","next_cursor","has_more"],"title":"OfflineSyncResultsResponseDto"},"RegisterOfflineDeviceDto":{"type":"object","properties":{"installation_id":{"type":"string","format":"uuid","description":"Generated by the app on first launch."}},"required":["installation_id"],"title":"RegisterOfflineDeviceDto"},"OfflineCashiersRestaurantDto":{"type":"object","properties":{"id":{"type":"string"},"account_number":{"type":"number","description":"The number typed at login."}},"required":["id","account_number"],"title":"OfflineCashiersRestaurantDto"},"OfflineCashierDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","example":"CASHIER"},"permissions":{"type":"array","items":{"type":"string"}},"permissions_version":{"type":"number"},"password_hash":{"type":"string","example":"$2b$12$…"},"password_algorithm":{"type":"string","enum":["bcrypt"]},"user":{"description":"The same `user` object the login returns.","allOf":[{"$ref":"#/components/schemas/AuthUserResponseDto"}]}},"required":["id","name","email","role","permissions","permissions_version","password_hash","password_algorithm","user"],"title":"OfflineCashierDto"},"OfflineCashiersResponseDto":{"type":"object","properties":{"restaurant":{"$ref":"#/components/schemas/OfflineCashiersRestaurantDto"},"cashiers":{"type":"array","items":{"$ref":"#/components/schemas/OfflineCashierDto"}}},"required":["restaurant","cashiers"],"title":"OfflineCashiersResponseDto"},"OfflineSyncIssueDeviceDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"B"}},"required":["id","code"],"title":"OfflineSyncIssueDeviceDto"},"OfflineSyncIssueDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["rejected_action","price_discrepancy","shift_amended","clock_drift","table_conflict","booking_conflict","stale_action","time_adjusted","negative_stock","credit_limit_exceeded"]},"status":{"type":"string","enum":["open","retried","discarded","acknowledged"]},"branch_id":{"type":"string"},"device":{"$ref":"#/components/schemas/OfflineSyncIssueDeviceDto"},"actor_staff_id":{"type":"string","nullable":true},"action_id":{"type":"string","nullable":true,"format":"uuid"},"action_type":{"type":"string","nullable":true,"example":"order.create"},"order_id":{"type":"string","nullable":true,"format":"uuid"},"shift_id":{"type":"string","nullable":true,"format":"uuid"},"error_code":{"type":"string","nullable":true,"example":"VALIDATION"},"message":{"type":"string","nullable":true},"details":{"type":"object","additionalProperties":true,"description":"`price_discrepancy`: `{ server_totals }`. `shift_amended`: `{ order_ids }`. `clock_drift`: `{ offset_ms, threshold_ms }`. `table_conflict`: `{ table_id, order_id, conflicting_order_id }`. `booking_conflict`: `{ booking_id, staff_id, scheduled_at, reasons }`. After a retry: `order` or `shift` (success) or `retries` (failed attempts)."},"created_at":{"format":"date-time","type":"string"},"resolved_at":{"format":"date-time","type":"string","nullable":true},"resolved_by_staff_id":{"type":"string","nullable":true},"resolution_reason":{"type":"string","nullable":true}},"required":["id","type","status","branch_id","device","actor_staff_id","action_id","action_type","order_id","shift_id","error_code","message","details","created_at","resolved_at","resolved_by_staff_id","resolution_reason"],"title":"OfflineSyncIssueDto"},"OfflineSyncIssueListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OfflineSyncIssueDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"OfflineSyncIssueListDto"},"ResolveOfflineSyncIssueDto":{"type":"object","properties":{"action":{"enum":["retry","discard","acknowledge"],"type":"string","description":"`retry` (rejected actions only) re-applies the stored action with its original `occurred_at` and actor; `discard` drops it (reason required); `acknowledge` marks it seen."},"reason":{"type":"string","nullable":true,"maxLength":500,"pattern":"\\S","description":"Required for `discard`."}},"required":["action"],"title":"ResolveOfflineSyncIssueDto"},"OfflineCustomerPassDto":{"type":"object","properties":{"pass_serial":{"type":"string","example":"AB12CD34"},"current_stamps":{"type":"number"},"total_stamps":{"type":"number"}},"required":["pass_serial","current_stamps","total_stamps"],"title":"OfflineCustomerPassDto"},"OfflineDirectoryCustomerDto":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"name":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","enum":["INDIVIDUAL","COMPANY"]},"vat_number":{"type":"string","nullable":true},"is_active":{"type":"boolean"},"loyalty_points":{"type":"number"},"credit_limit":{"type":"number","nullable":true},"updated_at":{"format":"date-time","type":"string"},"deleted":{"type":"boolean","description":"Deleted since the cursor; the device drops it."},"passes":{"description":"Stamp passes not voided.","type":"array","items":{"$ref":"#/components/schemas/OfflineCustomerPassDto"}}},"required":["id","phone","name","name_ar","email","type","vat_number","is_active","loyalty_points","credit_limit","updated_at","deleted","passes"],"title":"OfflineDirectoryCustomerDto"},"OfflineCustomersResponseDto":{"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/OfflineDirectoryCustomerDto"}},"next_cursor":{"type":"string","nullable":true,"description":"Pass as `cursor` for the next page, and keep the last one for the next incremental download. Null only when nothing was listed and no cursor was sent."},"has_more":{"type":"boolean","description":"Whether another page follows right away."}},"required":["customers","next_cursor","has_more"],"title":"OfflineCustomersResponseDto"},"CreateCustomerDto":{"type":"object","properties":{"phone":{"type":"string","maxLength":30,"example":"+966500000001"},"name":{"type":"string","maxLength":200,"example":"Sara Ali","description":"Required when type=COMPANY — doubles as the registered company name."},"name_ar":{"type":"string","maxLength":200,"example":"سارة علي"},"email":{"type":"string","nullable":true,"maxLength":320,"format":"email","example":"sara@example.com"},"plate_number":{"type":"string","nullable":true,"maxLength":20,"example":"ABC 1234","description":"Car plate number"},"address":{"type":"string","nullable":true,"maxLength":500,"example":"123 King Fahd Rd, Riyadh","description":"Delivery address"},"latitude":{"type":"number","nullable":true,"example":24.7136,"description":"Delivery location latitude"},"longitude":{"type":"number","nullable":true,"example":46.6753,"description":"Delivery location longitude"},"notes":{"type":"string","nullable":true,"maxLength":1000,"example":"Prefers window seat","description":"Internal staff notes"},"credit_limit":{"type":"number","nullable":true,"minimum":1,"example":5000,"description":"Maximum deferred (آجل) balance this customer may carry; null/omitted = no limit."},"branch_id":{"type":"string","format":"uuid","description":"Associate customer with a specific branch"},"type":{"enum":["INDIVIDUAL","COMPANY"],"type":"string","default":"INDIVIDUAL","description":"COMPANY unlocks ZATCA Standard/B2B (Clearance) invoicing for this customer."},"vat_number":{"type":"string","example":"300000000000003","description":"Required when type=COMPANY — ZATCA requires exactly 15 digits, starting and ending with \"3\"."},"cr_number":{"type":"string","maxLength":20,"example":"7001234567","description":"Commercial Registration number"},"building_number":{"type":"string","example":"1234","description":"4-digit ZATCA building number"},"district":{"type":"string","maxLength":100,"example":"Al Olaya"},"district_ar":{"type":"string","maxLength":100,"example":"العليا"},"city":{"type":"string","maxLength":100,"example":"Riyadh"},"postal_zone":{"type":"string","example":"12345","description":"5-digit ZATCA postal zone"}},"required":["phone"],"title":"CreateCustomerDto"},"CustomerStatsDto":{"type":"object","properties":{"lifetime_value":{"type":"number","example":1250.5},"order_count":{"type":"number","example":12},"visit_count":{"type":"number","example":8},"last_visit_at":{"type":"string","nullable":true,"format":"date-time"},"average_order_value":{"type":"number","example":104.21}},"required":["lifetime_value","order_count","visit_count","last_visit_at","average_order_value"],"title":"CustomerStatsDto"},"CustomerLoyaltyPassIconDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"icon_name":{"type":"string","example":"coffee-cup"},"icon_light_on":{"type":"string"},"icon_light_off":{"type":"string"},"icon_dark_on":{"type":"string"},"icon_dark_off":{"type":"string"}},"required":["id","icon_name","icon_light_on","icon_light_off","icon_dark_on","icon_dark_off"],"title":"CustomerLoyaltyPassIconDto"},"CustomerLoyaltyPassThemeDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"total_stamps":{"type":"number","example":10},"count_method":{"type":"string","example":"per_order"},"text_color":{"type":"string","nullable":true,"example":"#FFFFFF"},"background_color":{"type":"string","nullable":true,"example":"#1A1A2E"},"hero_image":{"type":"string","nullable":true},"hero_bg_color":{"type":"string","nullable":true,"example":"#000000"},"header_label":{"type":"string","nullable":true,"example":"Collect 10 stamps"},"reward_title":{"type":"string","nullable":true},"reward_description":{"type":"string","nullable":true},"terms_and_conditions":{"type":"string","nullable":true},"icon":{"$ref":"#/components/schemas/CustomerLoyaltyPassIconDto"}},"required":["id","total_stamps","count_method","text_color","background_color","hero_image","hero_bg_color","header_label","reward_title","reward_description","terms_and_conditions","icon"],"title":"CustomerLoyaltyPassThemeDto"},"CustomerLoyaltyPassDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"pass_serial":{"type":"string","example":"AB12CD34"},"current_stamps":{"type":"number","example":3},"total_stamps":{"type":"number","example":10},"voided_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"},"theme":{"$ref":"#/components/schemas/CustomerLoyaltyPassThemeDto"}},"required":["id","pass_serial","current_stamps","total_stamps","voided_at","created_at"],"title":"CustomerLoyaltyPassDto"},"CustomerLoyaltyTransactionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","example":"EARN"},"points":{"type":"number","example":50},"balance_after":{"type":"number","example":150},"note":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"}},"required":["id","type","points","balance_after","note","created_at"],"title":"CustomerLoyaltyTransactionDto"},"CustomerGiftCardItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"product_name":{"type":"string","example":"Latte"},"product_name_ar":{"type":"string","nullable":true,"example":"لاتيه"},"initial_quantity":{"type":"number","nullable":true,"example":5,"description":"null when unlimited"},"remaining_quantity":{"type":"number","nullable":true,"example":3,"description":"null when unlimited"}},"required":["id","product_id","product_name","product_name_ar","initial_quantity","remaining_quantity"],"title":"CustomerGiftCardItemDto"},"CustomerGiftCardDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"gift_card_id":{"type":"string","example":"GC1A2B3"},"type":{"enum":["BALANCE","ITEMS"],"type":"string","example":"BALANCE"},"cash_in_card":{"type":"number","nullable":true,"example":500,"description":"null for ITEMS cards"},"remaining_balance":{"type":"number","nullable":true,"example":350.5,"description":"null for ITEMS cards"},"currency":{"type":"string","example":"SAR"},"background_color":{"type":"string","nullable":true,"example":"#1F2937"},"text_color":{"type":"string","nullable":true,"example":"#FFFFFF"},"status":{"enum":["ACTIVE","USED","EXPIRED","CANCELLED"],"type":"string","example":"ACTIVE"},"expiry_date":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"},"items":{"description":"Empty for BALANCE cards","type":"array","items":{"$ref":"#/components/schemas/CustomerGiftCardItemDto"}}},"required":["id","gift_card_id","type","cash_in_card","remaining_balance","currency","background_color","text_color","status","expiry_date","created_at","items"],"title":"CustomerGiftCardDto"},"CustomerProfileDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"enum":["INDIVIDUAL","COMPANY"],"type":"string"},"name":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true},"phone":{"type":"string"},"email":{"type":"string","nullable":true},"plate_number":{"type":"string","nullable":true,"example":"ABC 1234"},"address":{"type":"string","nullable":true,"example":"123 King Fahd Rd, Riyadh"},"latitude":{"type":"number","nullable":true,"example":24.7136},"longitude":{"type":"number","nullable":true,"example":46.6753},"notes":{"type":"string","nullable":true,"example":"Prefers window seat"},"credit_limit":{"type":"number","nullable":true,"example":5000,"description":"Maximum deferred (آجل) balance the customer may carry; null = no limit."},"status":{"enum":["active","blocked"],"type":"string"},"created_at":{"format":"date-time","type":"string"},"last_login_at":{"type":"string","nullable":true,"format":"date-time"},"loyalty_points":{"type":"number"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"vat_number":{"type":"string","nullable":true,"example":"300000000000003","description":"ZATCA fields — only meaningful when type=COMPANY."},"cr_number":{"type":"string","nullable":true,"example":"7001234567"},"building_number":{"type":"string","nullable":true,"example":"1234"},"district":{"type":"string","nullable":true,"example":"Al Olaya"},"district_ar":{"type":"string","nullable":true,"example":"العليا"},"city":{"type":"string","nullable":true,"example":"Riyadh"},"postal_zone":{"type":"string","nullable":true,"example":"12345"},"stats":{"$ref":"#/components/schemas/CustomerStatsDto"},"loyalty_passes":{"type":"array","items":{"$ref":"#/components/schemas/CustomerLoyaltyPassDto"}},"loyalty_transactions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerLoyaltyTransactionDto"}},"gift_cards":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGiftCardDto"}}},"required":["id","type","name","name_ar","phone","email","plate_number","address","latitude","longitude","notes","credit_limit","status","created_at","last_login_at","loyalty_points","branch_id","vat_number","cr_number","building_number","district","district_ar","city","postal_zone","stats"],"title":"CustomerProfileDto"},"CustomerListItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"enum":["INDIVIDUAL","COMPANY"],"type":"string"},"name":{"type":"string","nullable":true,"example":"Sara Ali"},"name_ar":{"type":"string","nullable":true,"example":"سارة علي"},"phone":{"type":"string","example":"+966500000001"},"email":{"type":"string","nullable":true,"example":"sara@example.com"},"status":{"enum":["active","blocked"],"type":"string","example":"active"},"loyalty_points":{"type":"number","example":120},"created_at":{"format":"date-time","type":"string"},"last_login_at":{"type":"string","nullable":true,"format":"date-time"},"loyalty_passes":{"type":"array","items":{"$ref":"#/components/schemas/CustomerLoyaltyPassDto"}},"loyalty_transactions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerLoyaltyTransactionDto"}},"gift_cards":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGiftCardDto"}}},"required":["id","type","name","name_ar","phone","email","status","loyalty_points","created_at","last_login_at"],"title":"CustomerListItemDto"},"CustomerListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerListItemDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"CustomerListResponseDto"},"CustomerOrderStatsDto":{"type":"object","properties":{"total_orders":{"type":"number","example":42},"total_spending":{"type":"number","example":5250},"paid_orders":{"type":"number","example":35},"unpaid_orders":{"type":"number","example":7},"unpaid_amount":{"type":"number","example":890.5},"average_order_value":{"type":"number","example":125}},"required":["total_orders","total_spending","paid_orders","unpaid_orders","unpaid_amount","average_order_value"],"title":"CustomerOrderStatsDto"},"CustomerOrdersListResponseDto":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/OrderResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"},"stats":{"$ref":"#/components/schemas/CustomerOrderStatsDto"}},"required":["orders","pagination","stats"],"title":"CustomerOrdersListResponseDto"},"UpdateCustomerDto":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"example":"Sara Ali"},"name_ar":{"type":"string","maxLength":200,"example":"سارة علي"},"email":{"type":"string","nullable":true,"maxLength":320,"format":"email","example":"sara@example.com"},"phone":{"type":"string","maxLength":30,"example":"+966500000001"},"plate_number":{"type":"string","nullable":true,"maxLength":20,"example":"ABC 1234","description":"Car plate number"},"notes":{"type":"string","nullable":true,"maxLength":1000,"example":"Prefers window seat","description":"Internal staff notes"},"credit_limit":{"type":"number","nullable":true,"minimum":1,"example":5000,"description":"Maximum deferred (آجل) balance this customer may carry; null clears the limit."},"address":{"type":"string","nullable":true,"maxLength":500,"example":"123 King Fahd Rd, Riyadh","description":"Delivery address"},"latitude":{"type":"number","nullable":true,"example":24.7136,"description":"Delivery location latitude"},"longitude":{"type":"number","nullable":true,"example":46.6753,"description":"Delivery location longitude"},"status":{"enum":["active","blocked"],"type":"string"},"is_active":{"type":"boolean","description":"Alternative to `status` for block/unblock. Takes precedence when both are supplied."},"type":{"enum":["INDIVIDUAL","COMPANY"],"type":"string","description":"COMPANY unlocks ZATCA Standard/B2B (Clearance) invoicing for this customer."},"vat_number":{"type":"string","example":"300000000000003","description":"ZATCA requires exactly 15 digits, starting and ending with \"3\"."},"cr_number":{"type":"string","maxLength":20,"example":"7001234567","description":"Commercial Registration number"},"building_number":{"type":"string","example":"1234","description":"4-digit ZATCA building number"},"district":{"type":"string","maxLength":100,"example":"Al Olaya"},"district_ar":{"type":"string","maxLength":100,"example":"العليا"},"city":{"type":"string","maxLength":100,"example":"Riyadh"},"postal_zone":{"type":"string","example":"12345","description":"5-digit ZATCA postal zone"}},"title":"UpdateCustomerDto"},"CustomerNoteAuthorDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Ahmed Manager"}},"required":["id","name"],"title":"CustomerNoteAuthorDto"},"CustomerNoteDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"body":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"author":{"$ref":"#/components/schemas/CustomerNoteAuthorDto"}},"required":["id","body","created_at","author"],"title":"CustomerNoteDto"},"CreateCustomerNoteDto":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000,"example":"Prefers window seating; allergic to nuts."}},"required":["body"],"title":"CreateCustomerNoteDto"},"CreditCustomerDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true},"phone":{"type":"string"}},"required":["id","phone"],"title":"CreditCustomerDto"},"CreditBookRowDto":{"type":"object","properties":{"customer":{"$ref":"#/components/schemas/CreditCustomerDto"},"credit_limit":{"type":"number","nullable":true,"example":5000},"deferred_order_count":{"type":"number","example":3},"orders_total":{"type":"number","example":700},"paid_amount":{"type":"number","example":150},"outstanding_amount":{"type":"number","example":550},"oldest_deferred_at":{"format":"date-time","type":"string","nullable":true}},"required":["customer","deferred_order_count","orders_total","paid_amount","outstanding_amount"],"title":"CreditBookRowDto"},"CreditBookPaginationDto":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"total_pages":{"type":"number"},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","limit","total","total_pages","has_next_page","has_previous_page"],"title":"CreditBookPaginationDto"},"CreditBookTotalsDto":{"type":"object","properties":{"customer_count":{"type":"number","example":12},"outstanding_amount":{"type":"number","example":4310.5}},"required":["customer_count","outstanding_amount"],"title":"CreditBookTotalsDto"},"CreditBookResponseDto":{"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/CreditBookRowDto"}},"pagination":{"$ref":"#/components/schemas/CreditBookPaginationDto"},"totals":{"$ref":"#/components/schemas/CreditBookTotalsDto"}},"required":["customers","pagination","totals"],"title":"CreditBookResponseDto"},"StatementPaymentMethodDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name"],"title":"StatementPaymentMethodDto"},"CreditStatementEntryDto":{"type":"object","properties":{"kind":{"type":"string","enum":["sale","payment"],"example":"sale"},"occurred_at":{"format":"date-time","type":"string"},"order_id":{"type":"string"},"order_serial_number":{"type":"number","nullable":true},"amount":{"type":"number","example":120.5,"description":"Positive for a sale (debt up), negative for a payment (debt down)."},"payment_method":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/StatementPaymentMethodDto"}]},"notes":{"type":"string","nullable":true},"running_balance":{"type":"number","example":430}},"required":["kind","occurred_at","order_id","amount","running_balance"],"title":"CreditStatementEntryDto"},"CreditStatementResponseDto":{"type":"object","properties":{"customer":{"$ref":"#/components/schemas/CreditCustomerDto"},"credit_limit":{"type":"number","nullable":true},"outstanding_amount":{"type":"number","example":550},"entries":{"type":"array","items":{"$ref":"#/components/schemas/CreditStatementEntryDto"}}},"required":["customer","outstanding_amount","entries"],"title":"CreditStatementResponseDto"},"SettleCustomerAccountDto":{"type":"object","properties":{"payment_method_id":{"type":"string","format":"uuid","description":"The tender the money came in on."},"amount":{"type":"number","minimum":0.01,"example":250,"description":"Amount received against the whole account. Allocated oldest-first across the customer’s open deferred orders; must not exceed their outstanding balance."},"notes":{"type":"string"}},"required":["payment_method_id","amount"],"title":"SettleCustomerAccountDto"},"SettlementAllocationDto":{"type":"object","properties":{"order_id":{"type":"string"},"serial_number":{"type":"number","nullable":true},"amount":{"type":"number","example":100},"new_payment_status":{"type":"string","example":"PAID"}},"required":["order_id","amount","new_payment_status"],"title":"SettlementAllocationDto"},"SettlementResultDto":{"type":"object","properties":{"allocations":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAllocationDto"}},"remaining_outstanding":{"type":"number","example":120.5,"description":"What the customer still owes after this payment."}},"required":["allocations","remaining_outstanding"],"title":"SettlementResultDto"},"CreateCreditPaymentLinkDto":{"type":"object","properties":{"amount":{"type":"number","minimum":0.01,"example":250,"description":"Amount the link collects. Omitted → the customer’s full outstanding balance at creation time. Must not exceed it."}},"title":"CreateCreditPaymentLinkDto"},"CreditPaymentLinkResponseDto":{"type":"object","properties":{"checkout_url":{"type":"string","description":"Hosted gateway checkout URL to share with the customer."},"transaction_id":{"type":"string","format":"uuid"},"amount":{"type":"number","example":250},"currency":{"type":"string","example":"SAR"}},"required":["checkout_url","transaction_id","amount","currency"],"title":"CreditPaymentLinkResponseDto"},"CreateSubscriptionPaymentDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid","description":"ID of the branch the subscription is purchased for"},"plan_id":{"type":"string","format":"uuid","description":"ID of the subscription plan to purchase"}},"required":["branch_id","plan_id"],"title":"CreateSubscriptionPaymentDto"},"PurchaseSubscriptionChangeDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid","description":"Branch whose subscription is being changed"},"type":{"type":"string","enum":["RENEWAL","PLAN_CHANGE","ADDON"]},"feature_key":{"type":"string","maxLength":64},"quantity":{"type":"number","minimum":1},"plan_id":{"type":"string","format":"uuid"}},"required":["branch_id","type"],"title":"PurchaseSubscriptionChangeDto"},"PaymentProviderSecretStateDto":{"type":"object","properties":{"set":{"type":"boolean","description":"True when a value is stored."},"last4":{"type":"string","nullable":true,"example":"3f9a","description":"Last 4 characters of the stored value, so the admin can tell keys apart. Null when unset or too short to show safely."}},"required":["set","last4"],"title":"PaymentProviderSecretStateDto"},"PlatformPaymentProviderSettingsDto":{"type":"object","properties":{"base_url":{"type":"string","description":"API base URL. MyFatoorah (required), Moyasar, HyperPay, Paymob."},"publishable_key":{"type":"string","description":"Moyasar publishable key (`pk_test_…` / `pk_live_…`); public by design."},"apple_pay_merchant_id":{"type":"string","description":"Moyasar Apple Pay merchant id; Apple Pay is offered only when set."},"apple_pay_label":{"type":"string","description":"Moyasar label on the Apple Pay sheet."},"supplier_code":{"type":"string","description":"MyFatoorah multi-vendor supplier code."},"card_networks":{"type":"array","items":{"type":"string","enum":["visa","mastercard","mada","amex"]},"description":"MyFatoorah in-page checkout card networks."},"checkout_methods":{"type":"array","items":{"type":"string","enum":["card","apple_pay","google_pay","stc_pay"]},"description":"MyFatoorah in-page checkout methods."},"public_key":{"type":"string","description":"Tamara or Paymob public key."},"integration_id":{"type":"number","description":"Paymob integration id."},"currency":{"type":"string","description":"HyperPay currency (ISO 4217)."},"entity_ids":{"description":"HyperPay entity ids.","allOf":[{"$ref":"#/components/schemas/HyperPayEntityIdsDto"}]},"entity_id":{"type":"string","description":"AFS Pay entity id."},"tran_portal_id":{"type":"string","description":"Neoleap Tranportal id."}},"title":"PlatformPaymentProviderSettingsDto"},"PaymentProviderCheckDto":{"type":"object","properties":{"ok":{"type":"boolean","description":"True when the gateway accepted the stored credentials."},"message":{"type":"string","nullable":true,"description":"What the gateway said, in English. Never contains a credential."},"checked_at":{"type":"string","format":"date-time"},"environment":{"enum":["sandbox","production"],"type":"string","description":"The mode the check ran in."}},"required":["ok","message","checked_at","environment"],"title":"PaymentProviderCheckDto"},"PlatformPaymentProviderResponseDto":{"type":"object","properties":{"provider":{"enum":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"type":"string"},"enabled":{"type":"boolean"},"environment":{"enum":["sandbox","production"],"type":"string","description":"`sandbox` is test mode, `production` live."},"configured":{"type":"boolean","description":"True once every credential the gateway needs is stored."},"billing_gateway":{"type":"boolean","description":"True for the gateways platform billing charges with (MyFatoorah for SA, Moyasar elsewhere)."},"settings":{"$ref":"#/components/schemas/PlatformPaymentProviderSettingsDto"},"secrets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PaymentProviderSecretStateDto"},"description":"Every write-only credential of this provider, keyed by its request field name (`secret_key`, `api_key`, `webhook_secret`…).","example":{"secret_key":{"set":true,"last4":"3f9a"},"webhook_secret":{"set":false,"last4":null}}},"check_supported":{"type":"boolean","description":"Whether `POST …/test` can check this provider."},"last_check":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/PaymentProviderCheckDto"}]}},"required":["provider","enabled","environment","configured","billing_gateway","settings","secrets","check_supported","last_check"],"title":"PlatformPaymentProviderResponseDto"},"CreateOrderPaymentDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"order_type":{"enum":["DELIVERY","takeaway","DINE_IN","DRIVE_THROUGH","TABLE_RESERVATION","SERVICE","OTHER"],"type":"string"},"cart_id":{"type":"string","format":"uuid","description":"Active cart for this branch (customer-owned)."},"payment_method":{"enum":["CASH","ONLINE"],"type":"string","description":"CASH: order stays PENDING until staff records payment. ONLINE: payment gateway flow is initiated after order creation.","default":"CASH"},"customer_location":{"description":"Required when `orderType` is `DELIVERY` (WGS84).","allOf":[{"$ref":"#/components/schemas/CustomerLocationDto"}]},"delivery_address":{"type":"string","description":"Delivery address string (for DELIVERY orders)."},"drive_through_details":{"$ref":"#/components/schemas/CustomerDriveThroughDetailsDto"},"reservation_id":{"type":"string","format":"uuid","description":"For `DINE_IN`: optional seated booking to attach. For `TABLE_RESERVATION`: required (validated in service)."},"dine_in_details":{"description":"For QR walk-in `DINE_IN` without `reservation_id`: pass `table_id` to create/reuse a customer TableReservation for that table slot, then attach the order to it.","allOf":[{"$ref":"#/components/schemas/DineInDetailsDto"}]},"notes":{"type":"string"},"custom_fields":{"description":"Values for branch-level custom order fields.","type":"array","items":{"$ref":"#/components/schemas/OrderCustomFieldDto"}},"service_bookings":{"description":"Staff + time selections for SERVICE items in the cart. One entry per service product being booked.","type":"array","items":{"$ref":"#/components/schemas/ServiceBookingAtCheckoutDto"}},"loyalty_points_to_redeem":{"type":"number","minimum":1,"description":"Loyalty points to redeem against this order. Converts to a loyalty_discount and reduces the order total. When the discount covers the full total, payment_status becomes PAID."},"loyalty_pass_serial":{"type":"string","maxLength":8,"description":"Serial of the loyalty card this order should stamp, chosen by the customer from their own cards (`GET /restaurants/:restaurantId/customer/loyalty-passes`). Rejected with 404 when the card is not theirs at this restaurant, and 400 when it has been voided. Omit to earn no stamp.","example":"NZB-RJ6"},"promo_code":{"type":"string","maxLength":40,"description":"Promotion code to apply, as checked against this cart via `POST /restaurants/:restaurantId/customer/promotions/validate`. Rejected with 400 when the code does not apply to this basket, so the customer is never charged a total the checkout screen did not show. At most one promotion per order; it is applied before any loyalty points are redeemed.","example":"SUMMER26"},"scheduled_for":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?(Z|[+-]\\d{2}:\\d{2})$","format":"date-time","description":"When the customer wants the order (ISO 8601 with a `Z` or `±hh:mm` offset). Omit for \"as soon as possible\". Only for TAKEAWAY, DELIVERY and DRIVE_THROUGH, when the restaurant has `orders.scheduled_orders.enabled`; refused with 400 `SCHEDULED_ORDER_REFUSED` when the time is inside the lead time, beyond the max days, or outside the opening hours.","example":"2026-11-26T18:30:00+03:00"},"gateway":{"type":"string","enum":["myfatoorah","tamara"],"description":"Gateway the customer picked (see `gateways` on /options). Omitted → default."},"customer_first_name":{"type":"string","maxLength":60,"description":"Required by Tamara when the customer has no full name on file. Saved."},"customer_last_name":{"type":"string","maxLength":60,"description":"See `customer_first_name`."}},"required":["branch_id","order_type","cart_id","payment_method"],"title":"CreateOrderPaymentDto"},"OrderPaymentUrlResponseDto":{"type":"object","properties":{"mode":{"enum":["EMBEDDED","HOSTED"],"type":"string","description":"EMBEDDED: render the in-page card form with `session_id` + `script_url`, then call `POST /restaurant-payments/confirm`. HOSTED: redirect to `checkout_url`."},"checkout_url":{"type":"string","nullable":true,"description":"Hosted gateway checkout URL (HOSTED mode only)"},"session_id":{"type":"string","nullable":true,"description":"Gateway session (EMBEDDED mode only)"},"script_url":{"type":"string","nullable":true,"description":"Gateway JS library that renders the card form (EMBEDDED mode only)"},"transaction_id":{"type":"string","format":"uuid"},"amount":{"type":"number","example":90.85,"description":"Amount charged, in major currency units"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"}},"required":["mode","checkout_url","session_id","script_url","transaction_id","amount","currency"],"title":"OrderPaymentUrlResponseDto"},"ConfirmOrderPaymentDto":{"type":"object","properties":{"transaction_id":{"type":"string","format":"uuid"}},"required":["transaction_id"],"title":"ConfirmOrderPaymentDto"},"ConfirmOrderPaymentResponseDto":{"type":"object","properties":{"status":{"enum":["PAID","PENDING","FAILED"],"type":"string"},"order_id":{"type":"string","nullable":true,"format":"uuid"},"redirect_url":{"type":"string","description":"Where to send the customer next (order page or back to checkout)"}},"required":["status","order_id","redirect_url"],"title":"ConfirmOrderPaymentResponseDto"},"RefundOnlinePaymentDto":{"type":"object","properties":{"amount":{"type":"number","minimum":1,"example":25.5,"description":"Amount to refund in major units. Omitted → everything still refundable."},"reason":{"type":"string","maxLength":255,"example":"Order rejected by the kitchen"}},"required":["reason"],"title":"RefundOnlinePaymentDto"},"OnlineRefundResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Our refund id"},"transaction_id":{"type":"string","format":"uuid"},"refund_id":{"type":"string","description":"Gateway's refund id; empty until the gateway answers"},"status":{"enum":["REQUESTED","PENDING","REFUNDED","FAILED"],"type":"string","description":"REQUESTED: saved, no answer from the gateway yet. PENDING: the gateway accepted it and executes it later (MyFatoorah). REFUNDED: the money went back to the customer. FAILED: refused or cancelled by the gateway; nothing moved."},"refunded_amount":{"type":"number","example":25.5},"total_refunded":{"type":"number","example":25.5,"description":"All refunds on this payment that have not failed, pending ones included"},"refundable_remaining":{"type":"number","example":64.5},"currency":{"type":"string","example":"SAR"}},"required":["id","transaction_id","refund_id","status","refunded_amount","total_refunded","refundable_remaining","currency"],"title":"OnlineRefundResponseDto"},"PaymentRefundDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Our refund id"},"transaction_id":{"type":"string","format":"uuid"},"provider":{"type":"string","example":"myfatoorah"},"provider_refund_id":{"type":"string","nullable":true,"description":"Gateway's refund id"},"status":{"enum":["REQUESTED","PENDING","REFUNDED","FAILED"],"type":"string","description":"REQUESTED: saved, no answer from the gateway yet. PENDING: the gateway accepted it and executes it later (MyFatoorah). REFUNDED: the money went back to the customer. FAILED: refused or cancelled by the gateway; nothing moved."},"amount":{"type":"number","example":25.5},"currency":{"type":"string","example":"SAR"},"reason":{"type":"string","example":"Order rejected by the kitchen"},"requested_by_id":{"type":"string","nullable":true,"description":"Staff user; null for a system refund"},"failure_reason":{"type":"string","nullable":true,"description":"The gateway's refusal or cancellation reason, safe to show staff"},"created_at":{"format":"date-time","type":"string"},"refunded_at":{"format":"date-time","type":"string","nullable":true}},"required":["id","transaction_id","provider","provider_refund_id","status","amount","currency","reason","requested_by_id","failure_reason","created_at","refunded_at"],"title":"PaymentRefundDto"},"PlanFeatureResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"feature_key":{"type":"string","description":"Stable feature slug — the identifier you pass back as `feature_key` when composing a plan.","example":"PRODUCTS"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"value_type":{"enum":["BOOLEAN","LIMIT"],"type":"string"},"scope":{"enum":["BRANCH","RESTAURANT"],"type":"string","description":"BRANCH (per-branch) or RESTAURANT (pooled)."},"is_active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","feature_key","name","name_ar","description","value_type","scope","is_active","created_at","updated_at"],"title":"PlanFeatureResponseDto"},"PlanFeatureListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlanFeatureResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"PlanFeatureListResponseDto"},"PlanPeriodResponseDto":{"type":"object","properties":{"months":{"type":"number","enum":[1,3,4,6,12]},"discount_percent":{"type":"number","description":"0–100"}},"required":["months","discount_percent"],"title":"PlanPeriodResponseDto"},"PlanPriceResponseDto":{"type":"object","properties":{"country":{"type":"string","example":"EG"},"currency":{"type":"string","example":"EGP"},"base_price":{"type":"string","example":"1500.00"},"branch_price":{"type":"string","example":"900.00"},"periods":{"type":"array","items":{"$ref":"#/components/schemas/PlanPeriodResponseDto"}},"updated_at":{"type":"string","format":"date-time"}},"required":["country","currency","base_price","branch_price","periods","updated_at"],"title":"PlanPriceResponseDto"},"PlanFeatureValueResponseDto":{"type":"object","properties":{"feature_key":{"type":"string"},"value_type":{"enum":["BOOLEAN","LIMIT"],"type":"string"},"bool_value":{"type":"boolean","nullable":true},"limit_value":{"type":"number","nullable":true}},"required":["feature_key","value_type","bool_value","limit_value"],"title":"PlanFeatureValueResponseDto"},"SubscriptionPlanResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"description_ar":{"type":"string","nullable":true},"billing_cycle":{"enum":["MONTHLY","YEARLY"],"type":"string","description":"Deprecated: legacy per-branch module only."},"price":{"type":"string","description":"Deprecated: legacy per-branch module only."},"currency":{"type":"string"},"is_active":{"type":"boolean"},"base_price":{"type":"string","description":"Per month; covers included_branches."},"included_branches":{"type":"number"},"branch_price":{"type":"string","description":"Per month, for each paid branch beyond the included ones."},"min_branches":{"type":"number","nullable":true},"max_branches":{"type":"number","nullable":true},"periods":{"type":"array","items":{"$ref":"#/components/schemas/PlanPeriodResponseDto"}},"alignment":{"enum":["ALIGNED","OWN_DATES"],"type":"string"},"is_public":{"type":"boolean"},"sort_order":{"type":"number"},"subscriber_count":{"type":"number","description":"Restaurants subscribed to this plan now (active or past due)."},"prices":{"description":"Price per country. A plan is sold in a country only with a row there. The plan-level price fields mirror the SA row (deprecated).","type":"array","items":{"$ref":"#/components/schemas/PlanPriceResponseDto"}},"features":{"type":"array","items":{"$ref":"#/components/schemas/PlanFeatureValueResponseDto"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","name_ar","description","description_ar","billing_cycle","price","currency","is_active","base_price","included_branches","branch_price","min_branches","max_branches","periods","alignment","is_public","sort_order","subscriber_count","prices","features","created_at","updated_at"],"title":"SubscriptionPlanResponseDto"},"SubscriptionPlanListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionPlanResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"SubscriptionPlanListResponseDto"},"PlanPeriodDto":{"type":"object","properties":{"months":{"type":"number","enum":[1,3,4,6,12]},"discount_percent":{"type":"number","minimum":0,"maximum":100}},"required":["months","discount_percent"],"title":"PlanPeriodDto"},"PlanFeatureValueInputDto":{"type":"object","properties":{"feature_key":{"type":"string","maxLength":64},"bool_value":{"type":"boolean"},"limit_value":{"type":"number","minimum":-1}},"required":["feature_key"],"title":"PlanFeatureValueInputDto"},"CreateSubscriptionPlanDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"description":{"type":"string"},"description_ar":{"type":"string"},"billing_cycle":{"type":"string","enum":["MONTHLY","YEARLY"]},"price":{"type":"number","minimum":0},"base_price":{"type":"number","minimum":0},"included_branches":{"type":"number","minimum":0,"maximum":1000},"branch_price":{"type":"number","minimum":0},"min_branches":{"type":"number","nullable":true,"minimum":1,"maximum":1000},"max_branches":{"type":"number","nullable":true,"minimum":1,"maximum":1000},"periods":{"minItems":1,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/PlanPeriodDto"}},"alignment":{"type":"string","enum":["ALIGNED","OWN_DATES"]},"is_public":{"type":"boolean"},"sort_order":{"type":"number"},"currency":{"type":"string","maxLength":10},"features":{"type":"array","items":{"$ref":"#/components/schemas/PlanFeatureValueInputDto"}}},"required":["name","features"],"title":"CreateSubscriptionPlanDto"},"UpdateSubscriptionPlanDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"description":{"type":"string"},"description_ar":{"type":"string"},"billing_cycle":{"type":"string","enum":["MONTHLY","YEARLY"]},"price":{"type":"number","minimum":0},"currency":{"type":"string","maxLength":10},"is_active":{"type":"boolean"},"base_price":{"type":"number","minimum":0},"included_branches":{"type":"number","minimum":0,"maximum":1000},"branch_price":{"type":"number","minimum":0},"min_branches":{"type":"number","nullable":true,"minimum":1,"maximum":1000},"max_branches":{"type":"number","nullable":true,"minimum":1,"maximum":1000},"periods":{"minItems":1,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/PlanPeriodDto"}},"alignment":{"type":"string","enum":["ALIGNED","OWN_DATES"]},"is_public":{"type":"boolean"},"sort_order":{"type":"number"},"features":{"type":"array","items":{"$ref":"#/components/schemas/PlanFeatureValueInputDto"}}},"title":"UpdateSubscriptionPlanDto"},"SetPlanPriceDto":{"type":"object","properties":{"base_price":{"type":"number","minimum":0},"branch_price":{"type":"number","minimum":0},"periods":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/PlanPeriodDto"}}},"required":["base_price","branch_price","periods"],"title":"SetPlanPriceDto"},"CreateBranchSubscriptionDto":{"type":"object","properties":{"plan_id":{"type":"string","format":"uuid"},"starts_at":{"type":"string"},"ends_at":{"type":"string"},"auto_renew":{"type":"boolean"}},"required":["plan_id"],"title":"CreateBranchSubscriptionDto"},"SubscriptionEntitlementResponseDto":{"type":"object","properties":{"feature_key":{"type":"string"},"value_type":{"enum":["BOOLEAN","LIMIT"],"type":"string"},"bool_value":{"type":"boolean","nullable":true},"limit_value":{"type":"number","nullable":true}},"required":["feature_key","value_type","bool_value","limit_value"],"title":"SubscriptionEntitlementResponseDto"},"SubscriptionOverrideResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"feature_key":{"type":"string"},"bool_value":{"type":"boolean","nullable":true},"limit_delta":{"type":"number","nullable":true},"effective_from":{"type":"string","format":"date-time"},"effective_until":{"type":"string","nullable":true,"format":"date-time"},"reason":{"type":"string","nullable":true},"price":{"type":"string","nullable":true},"currency":{"type":"string"}},"required":["id","feature_key","bool_value","limit_delta","effective_from","effective_until","reason","price","currency"],"title":"SubscriptionOverrideResponseDto"},"BranchSubscriptionResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"plan_id":{"type":"string","nullable":true,"format":"uuid"},"plan_name_snapshot":{"type":"string"},"status":{"enum":["ACTIVE","TRIALING","PAST_DUE","CANCELLED","EXPIRED"],"type":"string"},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","nullable":true,"format":"date-time"},"price":{"type":"string"},"currency":{"type":"string"},"billing_cycle":{"enum":["MONTHLY","YEARLY"],"type":"string"},"auto_renew":{"type":"boolean"},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionEntitlementResponseDto"}},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionOverrideResponseDto"}},"created_at":{"type":"string","format":"date-time"}},"required":["id","branch_id","plan_id","plan_name_snapshot","status","starts_at","ends_at","price","currency","billing_cycle","auto_renew","entitlements","overrides","created_at"],"title":"BranchSubscriptionResponseDto"},"ChangePlanDto":{"type":"object","properties":{"plan_id":{"type":"string","format":"uuid"},"ends_at":{"type":"string"}},"required":["plan_id"],"title":"ChangePlanDto"},"RenewSubscriptionDto":{"type":"object","properties":{"ends_at":{"type":"string"}},"title":"RenewSubscriptionDto"},"CancelSubscriptionDto":{"type":"object","properties":{"reason":{"type":"string","maxLength":255}},"title":"CancelSubscriptionDto"},"AddOverrideDto":{"type":"object","properties":{"feature_key":{"type":"string","maxLength":64},"bool_value":{"type":"boolean"},"limit_delta":{"type":"number"},"effective_until":{"type":"string"},"reason":{"type":"string","maxLength":255},"amount":{"type":"number","minimum":0}},"required":["feature_key"],"title":"AddOverrideDto"},"BranchBillingStatusResponseDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"has_active_subscription":{"type":"boolean"},"subscription":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/BranchSubscriptionResponseDto"}]}},"required":["branch_id","has_active_subscription","subscription"],"title":"BranchBillingStatusResponseDto"},"BillingLedgerEntryResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"subscription_id":{"type":"string","nullable":true,"format":"uuid"},"type":{"enum":["NEW_SUBSCRIPTION","RENEWAL","PLAN_CHANGE","ADDON_OVERRIDE","CANCELLATION","ADJUSTMENT"],"type":"string"},"description":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string"},"feature_key":{"type":"string","nullable":true},"payment_reference":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","branch_id","subscription_id","type","description","amount","currency","feature_key","payment_reference","created_at"],"title":"BillingLedgerEntryResponseDto"},"FeatureUsageResponseDto":{"type":"object","properties":{"feature_key":{"type":"string"},"name":{"type":"string"},"value_type":{"enum":["BOOLEAN","LIMIT"],"type":"string"},"scope":{"enum":["BRANCH","RESTAURANT"],"type":"string"},"enabled":{"type":"boolean"},"limit":{"type":"number","nullable":true,"description":"Effective limit; -1 = unlimited."},"used":{"type":"number","nullable":true},"remaining":{"type":"number","nullable":true},"unlimited":{"type":"boolean"}},"required":["feature_key","name","value_type","scope","enabled","limit","used","remaining","unlimited"],"title":"FeatureUsageResponseDto"},"BranchUsageGroupResponseDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"branch_name":{"type":"string"},"usage":{"type":"array","items":{"$ref":"#/components/schemas/FeatureUsageResponseDto"}}},"required":["branch_id","branch_name","usage"],"title":"BranchUsageGroupResponseDto"},"RestaurantUsageResponseDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"restaurant":{"description":"Restaurant-scoped (pooled) features.","type":"array","items":{"$ref":"#/components/schemas/FeatureUsageResponseDto"}},"branches":{"type":"array","items":{"$ref":"#/components/schemas/BranchUsageGroupResponseDto"}}},"required":["restaurant_id","restaurant","branches"],"title":"RestaurantUsageResponseDto"},"SubscriptionAccessResponseDto":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","EXPIRED","NONE"],"description":"ACTIVE: at least one branch has a subscription in its window. EXPIRED: it had subscriptions and none is in its window. NONE: never subscribed."},"locked":{"type":"boolean","description":"True when every staff route except billing and the session answers 403."},"access_ends_at":{"type":"string","nullable":true,"format":"date-time","description":"ACTIVE: when access ends unless renewed first (null: open-ended). EXPIRED: when it ended."},"server_time":{"type":"string","format":"date-time","description":"The server's clock. Clients time the lock against this, not their own."}},"required":["status","locked","access_ends_at","server_time"],"title":"SubscriptionAccessResponseDto"},"AccountStandingResponseDto":{"type":"object","properties":{"member_since":{"type":"string","format":"date-time","description":"When the restaurant started: its creation, or its first sale if earlier."},"currency":{"type":"string","description":"ISO 4217 currency of `total_sales`."},"total_sales":{"type":"number","description":"Lifetime sales: the sales report’s figure with no date range."},"orders_count":{"type":"number","description":"Lifetime completed orders."},"customers_count":{"type":"number"}},"required":["member_since","currency","total_sales","orders_count","customers_count"],"title":"AccountStandingResponseDto"},"CountryResponseDto":{"type":"object","properties":{"code":{"type":"string","example":"EG","description":"ISO 3166-1 alpha-2."},"name_ar":{"type":"string","example":"مصر"},"name_en":{"type":"string","example":"Egypt"},"path":{"type":"string","example":"/eg","description":"Landing path. SA is \"/\"."},"display_currency":{"type":"string","example":"EGP","description":"Currency plan prices are shown in."},"charge_currency":{"type":"string","example":"USD","description":"Currency the card is charged in. When it differs from `display_currency` the invoice shows the converted `charge` amount next to the price."},"gateway":{"enum":["MYFATOORAH","MOYASAR"],"type":"string","example":"MOYASAR"},"dial_code":{"type":"string","example":"20","description":"Dialling code without \"+\"."},"contact_whatsapp":{"type":"string","nullable":true,"example":"+201001234567"},"contact_phone":{"type":"string","nullable":true,"example":"+201001234567"},"invoice_tax_rate":{"type":"number","example":0,"description":"Tax rate on twlm's invoices, a fraction (0.15 = 15%)."},"seo_locale":{"type":"string","example":"ar-EG","description":"hreflang / og:locale for the landing."},"sort_order":{"type":"number","example":10},"fx_rate":{"type":"string","example":"0.02026667","description":"Public list only, and only when `display_currency` ≠ `charge_currency`: the current rate (units of charge currency per unit of display currency) invoices would snapshot now. For \"≈ X USD will be charged\" next to listed prices; the invoice is authoritative."},"enabled":{"type":"boolean","description":"Listed publicly and accepted at sign-up."},"restaurant_count":{"type":"number","description":"Restaurants billed in this country."},"priced_plan_count":{"type":"number","description":"Plans with a price in this country."},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["code","name_ar","name_en","path","display_currency","charge_currency","gateway","dial_code","contact_whatsapp","contact_phone","invoice_tax_rate","seo_locale","sort_order","enabled","restaurant_count","priced_plan_count","created_at","updated_at"],"title":"CountryResponseDto"},"BackfillExceptionResponseDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"account_number":{"type":"number"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"country":{"type":"string","example":"SA","description":"The billing country column now."},"settings_country":{"type":"string","nullable":true,"example":"Saudi","description":"Raw `settings.general.country`, as the restaurant typed it."},"settings_currency":{"type":"string","nullable":true,"example":"SAR","description":"POS selling currency."},"subscription_currency":{"type":"string","nullable":true,"description":"Live subscription currency, if any."},"card_providers":{"nullable":true,"description":"Providers of the restaurant’s active saved cards.","type":"array","items":{"type":"string"}},"reasons":{"type":"array","items":{"type":"string","enum":["SETTINGS_COUNTRY_NOT_SA","UNKNOWN_SETTINGS_COUNTRY","COLUMN_SETTINGS_MISMATCH","SUBSCRIPTION_CURRENCY_MISMATCH","CARD_GATEWAY_MISMATCH","POS_CURRENCY_DIFFERS"]},"description":"SETTINGS_COUNTRY_NOT_SA: settings name a country other than SA. UNKNOWN_SETTINGS_COUNTRY: settings hold a value that is not a country row (backfilled to SA). COLUMN_SETTINGS_MISMATCH: the column and the settings disagree. SUBSCRIPTION_CURRENCY_MISMATCH: the live subscription is priced in another currency than the country. CARD_GATEWAY_MISMATCH: a saved card belongs to another gateway than the country’s. POS_CURRENCY_DIFFERS: informational, the POS sells in another currency than the country’s."}},"required":["restaurant_id","account_number","name","name_ar","country","settings_country","settings_currency","subscription_currency","card_providers","reasons"],"title":"BackfillExceptionResponseDto"},"CreateCountryDto":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z]{2}$","example":"AE","description":"ISO 3166-1 alpha-2. Cannot change later."},"name_ar":{"type":"string","maxLength":100,"example":"الإمارات"},"name_en":{"type":"string","maxLength":100,"example":"United Arab Emirates"},"enabled":{"type":"boolean","default":false,"description":"Listed publicly and accepted at sign-up."},"path":{"type":"string","pattern":"^\\/([a-z0-9-]{1,30})?$","example":"/ae","description":"Landing path: \"/\" or \"/\" + lowercase letters, digits and dashes. Unique."},"display_currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"AED","description":"ISO 4217: the currency prices are set in."},"charge_currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"AED","description":"ISO 4217: the currency cards are charged in. Different from display_currency → invoices carry an FX snapshot. Flip to the display currency once the gateway supports it."},"gateway":{"enum":["MYFATOORAH","MOYASAR"],"type":"string"},"dial_code":{"type":"string","pattern":"^\\d{1,4}$","example":"971","description":"Dialling code without \"+\"."},"contact_whatsapp":{"type":"string","nullable":true,"maxLength":20,"example":"+971501234567"},"contact_phone":{"type":"string","nullable":true,"maxLength":20,"example":"+971501234567"},"invoice_tax_rate":{"type":"number","minimum":0,"maximum":1,"example":0,"description":"Fraction; default 0."},"seo_locale":{"type":"string","pattern":"^[a-z]{2}-[A-Z]{2}$","example":"ar-AE"},"sort_order":{"type":"number","example":20}},"required":["code","name_ar","name_en","path","display_currency","charge_currency","gateway","dial_code","seo_locale"],"title":"CreateCountryDto"},"UpdateCountryDto":{"type":"object","properties":{"name_ar":{"type":"string","maxLength":100,"example":"الإمارات"},"name_en":{"type":"string","maxLength":100,"example":"United Arab Emirates"},"enabled":{"type":"boolean","default":false,"description":"Listed publicly and accepted at sign-up."},"path":{"type":"string","pattern":"^\\/([a-z0-9-]{1,30})?$","example":"/ae","description":"Landing path: \"/\" or \"/\" + lowercase letters, digits and dashes. Unique."},"display_currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"AED","description":"ISO 4217: the currency prices are set in."},"charge_currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"AED","description":"ISO 4217: the currency cards are charged in. Different from display_currency → invoices carry an FX snapshot. Flip to the display currency once the gateway supports it."},"gateway":{"enum":["MYFATOORAH","MOYASAR"],"type":"string"},"dial_code":{"type":"string","pattern":"^\\d{1,4}$","example":"971","description":"Dialling code without \"+\"."},"contact_whatsapp":{"type":"string","nullable":true,"maxLength":20,"example":"+971501234567"},"contact_phone":{"type":"string","nullable":true,"maxLength":20,"example":"+971501234567"},"invoice_tax_rate":{"type":"number","minimum":0,"maximum":1,"example":0,"description":"Fraction; default 0."},"seo_locale":{"type":"string","pattern":"^[a-z]{2}-[A-Z]{2}$","example":"ar-AE"},"sort_order":{"type":"number","example":20}},"title":"UpdateCountryDto"},"ProductNutritionResponseDto":{"type":"object","properties":{"protein":{"type":"number"},"total_fat":{"type":"number"},"saturated_fat":{"type":"number"},"trans_fat":{"type":"number"},"total_carbohydrates":{"type":"number"},"sugar":{"type":"number"},"added_sugar":{"type":"number"},"dietary_fiber":{"type":"number"},"polyols":{"type":"number"},"cholesterol":{"type":"number"},"sodium":{"type":"number"},"salt":{"type":"number"},"caffeine":{"type":"number"}},"title":"ProductNutritionResponseDto"},"ProductAvailableHourResponseDto":{"type":"object","properties":{"day":{"type":"number","example":0,"description":"0 = Sunday … 6 = Saturday"},"from":{"type":"string","example":"09:00"},"to":{"type":"string","example":"23:00"}},"required":["day","from","to"],"title":"ProductAvailableHourResponseDto"},"ProductExtraInfoResponseDto":{"type":"object","properties":{"nutrition":{"$ref":"#/components/schemas/ProductNutritionResponseDto"},"allergens":{"type":"array","items":{"type":"string","enum":["MILK_OR_LACTOSE","EGG","PEANUT","TREE_NUTS","CRUSTACEANS","FISH","GLUTEN","SOYA","SESAME_SEEDS","CELERY","MUSTARD","SULFITES","LUPINS","MOLLUSKS"]}},"preparation_minutes":{"type":"number","nullable":true},"is_liquid":{"type":"boolean"},"available_hours":{"type":"array","items":{"$ref":"#/components/schemas/ProductAvailableHourResponseDto"}}},"required":["nutrition","allergens","preparation_minutes","is_liquid","available_hours"],"title":"ProductExtraInfoResponseDto"},"ProductSaleMode":{"type":"string","enum":["UNIT","MEASURED"],"description":"UNIT sells whole pieces. MEASURED sells a weight or volume of `sale_unit`; prices are per sale unit and line quantities may have up to 3 decimals.","title":"ProductSaleMode"},"ProductSaleUnitResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"symbol":{"type":"string","example":"kg"},"name":{"type":"string","example":"Kilogram"},"name_ar":{"type":"string","nullable":true,"example":"كيلوجرام"},"dimension":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/UnitDimension"}]},"factor_to_base":{"type":"number","nullable":true,"example":1000,"description":"How many base units (g, ml) one of this unit is, to show 0.25 kg as 250 g"}},"required":["id","symbol","name","name_ar","dimension","factor_to_base"],"title":"ProductSaleUnitResponseDto"},"ProductVariantNetUnitResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"symbol":{"type":"string","example":"kg"}},"required":["id","symbol"],"title":"ProductVariantNetUnitResponseDto"},"ProductBranchAvailabilityResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"is_available":{"type":"boolean","example":true}},"required":["id","branch_id","is_available"],"title":"ProductBranchAvailabilityResponseDto"},"ProductVariantResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Large"},"name_ar":{"type":"string","nullable":true,"example":"كبير"},"sku":{"type":"string","nullable":true,"example":"CLS-BUR-L"},"barcode":{"type":"string","nullable":true},"price":{"type":"number","example":28,"description":"Resolved price: base, then override, then promotion."},"base_price":{"type":"number","example":28,"description":"The authored price before any override or promotion. Equals `price` when nothing discounted it; when a promotion did, this is the old price a menu card strikes through."},"final_price":{"type":"number","example":32.2,"description":"Resolved variant price with the parent product's VAT folded in."},"cost_price":{"type":"number","nullable":true,"example":10},"stock_item_id":{"type":"string","nullable":true,"format":"uuid"},"sold_out":{"type":"boolean","example":false,"description":"Out of stock at `branch_id`, for products that track availability. Computed only by the product list when `branch_id` is given; false elsewhere."},"available_quantity":{"type":"number","nullable":true,"example":4,"description":"Units left at `branch_id`. Staff callers only; null for the public menu."},"available_max_quantity":{"type":"number","nullable":true,"example":2.5,"description":"The most one line may ask for at `branch_id`: `max_quantity` cut to the stock left and floored to `quantity_step`. 0 when sold out; null when there is no max and no stock count."},"net_quantity":{"type":"number","nullable":true,"example":2,"description":"What one piece of this variant holds, in `net_unit` (a \"2 kg\" bag). Stock is deducted by it. Null for ordinary variants."},"net_unit":{"nullable":true,"description":"The unit of `net_quantity`","type":"object","allOf":[{"$ref":"#/components/schemas/ProductVariantNetUnitResponseDto"}]},"calories":{"type":"number","nullable":true,"example":760},"is_default":{"type":"boolean","example":false},"sort_order":{"type":"number","example":1},"is_active":{"type":"boolean","example":true},"branch_availabilities":{"type":"array","items":{"$ref":"#/components/schemas/ProductBranchAvailabilityResponseDto"}}},"required":["id","name","name_ar","sku","barcode","price","base_price","final_price","cost_price","stock_item_id","sold_out","available_quantity","available_max_quantity","net_quantity","net_unit","calories","is_default","sort_order","is_active","branch_availabilities"],"title":"ProductVariantResponseDto"},"ProductOptionValueResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"option_group_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Extra Cheese"},"name_ar":{"type":"string","nullable":true,"example":"جبنة إضافية"},"price_delta":{"type":"number","example":3},"final_price_delta":{"type":"number","example":3.45,"description":"Resolved price delta with the parent product's VAT folded in."},"cost_price":{"type":"number","nullable":true,"example":0.3},"stock_item_id":{"type":"string","nullable":true,"format":"uuid"},"calories":{"type":"number","nullable":true,"example":70},"multiply":{"type":"boolean","example":true},"max_multiply":{"type":"number","nullable":true,"example":3},"is_default":{"type":"boolean","example":false},"sort_order":{"type":"number","example":0},"is_active":{"type":"boolean","example":true}},"required":["id","option_group_id","name","name_ar","price_delta","final_price_delta","cost_price","stock_item_id","calories","multiply","max_multiply","is_default","sort_order","is_active"],"title":"ProductOptionValueResponseDto"},"ProductOptionGroupResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_option_group_id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Extras"},"name_ar":{"type":"string","nullable":true,"example":"إضافات"},"selection_type":{"enum":["SINGLE","MULTI"],"type":"string","example":"MULTI"},"required":{"type":"boolean","example":false},"override_required":{"type":"boolean","nullable":true},"effective_required":{"type":"boolean","example":false},"min_selections":{"type":"number","example":0},"max_selections":{"type":"number","nullable":true,"example":5},"is_snoozed":{"type":"boolean","example":false},"sort_order":{"type":"number","example":0},"product_sort_order":{"type":"number","example":0},"is_active":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"values":{"type":"array","items":{"$ref":"#/components/schemas/ProductOptionValueResponseDto"}}},"required":["id","product_option_group_id","restaurant_id","name","name_ar","selection_type","required","override_required","effective_required","min_selections","max_selections","is_snoozed","sort_order","product_sort_order","is_active","created_at","updated_at","values"],"title":"ProductOptionGroupResponseDto"},"ProductResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"category_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","example":"Classic Burger"},"name_ar":{"type":"string","nullable":true,"example":"برغر كلاسيك"},"description":{"type":"string","nullable":true},"description_ar":{"type":"string","nullable":true},"type":{"enum":["PRODUCT","SERVICE"],"type":"string","example":"PRODUCT"},"status":{"enum":["ACTIVE","INACTIVE","ARCHIVED"],"type":"string","example":"ACTIVE"},"base_price":{"type":"number","example":25},"cost_price":{"type":"number","nullable":true,"example":8.5},"vat_percentage":{"type":"number","example":0},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"discount":{"type":"number","nullable":true},"discount_type":{"nullable":true,"enum":["FIXED","PERCENTAGE"],"type":"string"},"effective_price":{"type":"number","nullable":true,"example":25},"final_price":{"type":"number","example":28.75,"description":"Unit price the customer pays: the resolved price (effective_price ?? base_price) with this product's VAT folded in. The restaurant's order-level VAT is applied separately at checkout."},"images":{"type":"array","items":{"type":"string"}},"barcode":{"type":"string","nullable":true},"scale_code":{"type":"string","nullable":true,"description":"The item code scale labels carry."},"sku":{"type":"string","nullable":true},"calories":{"type":"number","nullable":true,"example":620},"loyalty_points":{"type":"number","nullable":true,"description":"Fixed loyalty points earned when this product is purchased. null = use restaurant default rate."},"is_loyalty_eligible":{"type":"boolean","description":"True when purchasing this product earns a loyalty stamp under the restaurant's active theme."},"service_duration":{"type":"number","nullable":true},"service_buffer":{"type":"number","nullable":true,"description":"Cleanup/prep time after this service (minutes). Total blocked time = serviceDuration + serviceBuffer."},"slot_capacity":{"type":"number","nullable":true,"description":"Bookings one slot can take when booked without staff. Null = unlimited. Ignored where the service has assigned staff."},"requires_booking":{"type":"boolean","description":"Whether this SERVICE product requires staff/slot availability booking. False for flat services sold like a product (e.g. tickets, play-zone entry)."},"advance_payment_type":{"enum":["NONE","FIXED","PERCENTAGE"],"type":"string"},"advance_payment_amount":{"type":"string","nullable":true,"description":"Currency value for FIXED type; percentage 0-100 for PERCENTAGE type."},"sort_order":{"type":"number","example":0},"show_in_menu":{"type":"boolean","example":true,"description":"When false, hidden from the e-menu/website but still sellable in the cashier"},"is_active":{"type":"boolean","example":true},"available_all_branches":{"type":"boolean","example":true,"description":"When false, only listed branches see this product"},"track_availability":{"type":"boolean","example":false,"description":"Sold out once the branch runs out of stock"},"exclude_from_delivery_apps":{"type":"boolean","example":false,"description":"Left out of the menu sent to delivery apps"},"extra_info":{"$ref":"#/components/schemas/ProductExtraInfoResponseDto"},"sale_mode":{"example":"UNIT","description":"UNIT sells whole pieces. MEASURED sells a weight or volume of `sale_unit`; prices are per sale unit and line quantities may have up to 3 decimals.","allOf":[{"$ref":"#/components/schemas/ProductSaleMode"}]},"sale_unit":{"nullable":true,"description":"The unit a MEASURED product is sold in; null for UNIT products","type":"object","allOf":[{"$ref":"#/components/schemas/ProductSaleUnitResponseDto"}]},"min_quantity":{"type":"number","nullable":true,"example":0.25,"description":"Least one line may ask for (pieces, or `sale_unit`). Null: no minimum."},"max_quantity":{"type":"number","nullable":true,"example":3,"description":"Most one line may ask for. Null: no maximum."},"quantity_step":{"type":"number","nullable":true,"example":0.25,"description":"Line quantities must be multiples of this. Always 1 for UNIT; null for a MEASURED product means any amount with up to 3 decimals."},"quantity_presets":{"example":[0.25,0.5,1],"description":"Quick-pick quantities to offer, each within min/max and on the step.","type":"array","items":{"type":"number"}},"sold_out":{"type":"boolean","example":false,"description":"Out of stock at `branch_id`, for products that track availability. Computed only by the product list when `branch_id` is given; false elsewhere."},"available_quantity":{"type":"number","nullable":true,"example":4,"description":"Units left at `branch_id`. Staff callers only; null for the public menu."},"available_max_quantity":{"type":"number","nullable":true,"example":2.5,"description":"The most one line may ask for at `branch_id`: `max_quantity` cut to the stock left and floored to `quantity_step`. 0 when sold out; null when there is no max and no stock count."},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariantResponseDto"}},"option_groups":{"type":"array","items":{"$ref":"#/components/schemas/ProductOptionGroupResponseDto"}},"branch_availabilities":{"type":"array","items":{"$ref":"#/components/schemas/ProductBranchAvailabilityResponseDto"}}},"required":["id","restaurant_id","category_id","name","name_ar","description","description_ar","type","status","base_price","cost_price","vat_percentage","currency","discount","discount_type","effective_price","final_price","images","barcode","scale_code","sku","calories","loyalty_points","is_loyalty_eligible","service_duration","service_buffer","slot_capacity","requires_booking","sort_order","show_in_menu","is_active","available_all_branches","track_availability","exclude_from_delivery_apps","extra_info","sale_mode","sale_unit","min_quantity","max_quantity","quantity_step","quantity_presets","sold_out","available_quantity","available_max_quantity","created_at","updated_at","variants","option_groups","branch_availabilities"],"title":"ProductResponseDto"},"ProductListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ProductListResponseDto"},"ProductNutritionDto":{"type":"object","properties":{"protein":{"type":"number","minimum":0},"total_fat":{"type":"number","minimum":0},"saturated_fat":{"type":"number","minimum":0},"trans_fat":{"type":"number","minimum":0},"total_carbohydrates":{"type":"number","minimum":0},"sugar":{"type":"number","minimum":0},"added_sugar":{"type":"number","minimum":0},"dietary_fiber":{"type":"number","minimum":0},"polyols":{"type":"number","minimum":0},"cholesterol":{"type":"number","minimum":0},"sodium":{"type":"number","minimum":0},"salt":{"type":"number","minimum":0},"caffeine":{"type":"number","minimum":0}},"title":"ProductNutritionDto"},"ProductAvailableHourDto":{"type":"object","properties":{"day":{"type":"number","minimum":0,"maximum":6,"description":"0 = Sunday … 6 = Saturday"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","example":"09:00"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","example":"23:00"}},"title":"ProductAvailableHourDto"},"ProductExtraInfoDto":{"type":"object","properties":{"nutrition":{"$ref":"#/components/schemas/ProductNutritionDto"},"allergens":{"type":"array","items":{"type":"string","enum":["MILK_OR_LACTOSE","EGG","PEANUT","TREE_NUTS","CRUSTACEANS","FISH","GLUTEN","SOYA","SESAME_SEEDS","CELERY","MUSTARD","SULFITES","LUPINS","MOLLUSKS"]}},"preparation_minutes":{"type":"number","nullable":true,"minimum":0,"maximum":20},"is_liquid":{"type":"boolean"},"available_hours":{"maxItems":42,"description":"Time slots the product is offered. Empty: whenever the branch is open.","type":"array","items":{"$ref":"#/components/schemas/ProductAvailableHourDto"}}},"title":"ProductExtraInfoDto"},"CreateProductVariantDto":{"type":"object","properties":{"net_quantity":{"type":"number","nullable":true,"minimum":0.001,"example":2,"description":"A fixed pack's content: one sold piece of this variant takes this much from stock (a \"2 kg\" pack). Needs `net_unit_id`. Only for products sold by the piece."},"net_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"The unit of `net_quantity`: a unit with a dimension (kg, g, L, ml)."},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"sku":{"type":"string","maxLength":100},"barcode":{"type":"string","maxLength":100},"price":{"type":"number","minimum":0},"cost_price":{"type":"number","minimum":0},"stock_item_id":{"type":"string","format":"uuid"},"calories":{"type":"number","minimum":0},"is_default":{"type":"boolean"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"}},"required":["name","price"],"title":"CreateProductVariantDto"},"CreateProductDto":{"type":"object","properties":{"type":{"enum":["PRODUCT","SERVICE"],"type":"string"},"status":{"enum":["ACTIVE","INACTIVE","ARCHIVED"],"type":"string"},"slot_capacity":{"type":"number","nullable":true,"minimum":1,"maximum":1000,"description":"Bookings one slot of this SERVICE can take when booked without staff (same at every branch). Null = unlimited. Ignored at a branch where the service has assigned staff."},"requires_booking":{"type":"boolean","description":"Whether this SERVICE product requires staff/slot availability booking. False for flat services sold like a product (e.g. tickets, play-zone entry)."},"advance_payment_type":{"enum":["NONE","FIXED","PERCENTAGE"],"type":"string","description":"How the advance deposit is calculated for SERVICE products."},"advance_payment_amount":{"type":"number","minimum":0,"description":"Advance amount: currency value for FIXED, percentage 0-100 for PERCENTAGE. Ignored when type is NONE."},"show_in_menu":{"type":"boolean","description":"When false, hidden from the e-menu/website but still sellable in the cashier."},"track_availability":{"type":"boolean","description":"Refuse e-menu orders (and warn on the POS) once the branch runs out of stock. Needs a sales recipe or a stock-linked variant."},"exclude_from_delivery_apps":{"type":"boolean","description":"Leave this product out of the menu sent to delivery apps. It stays sellable on the POS and the e-menu."},"extra_info":{"nullable":true,"description":"Replaces the whole extra information; null clears it.","type":"object","allOf":[{"$ref":"#/components/schemas/ProductExtraInfoDto"}]},"sale_mode":{"description":"UNIT sells whole pieces. MEASURED sells a weight or volume: `base_price` is then the price of one `sale_unit` (per kg) and line quantities may be fractional.","allOf":[{"$ref":"#/components/schemas/ProductSaleMode"}]},"sale_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"The unit a MEASURED product is sold in: a system MASS or VOLUME unit (g, kg, ml, L). Required for MEASURED, cleared for UNIT."},"scale_code":{"type":"string","nullable":true,"pattern":"^\\d{1,10}$","example":"010008","description":"The item code a scale prints into its labels (1–10 digits, leading zeros kept). Unique per business: PRODUCT_SCALE_CODE_TAKEN otherwise. Null or \"\" clears it."},"min_quantity":{"type":"number","nullable":true,"minimum":0.001,"example":0.25,"description":"Least quantity one line may have, in the sale unit (pieces for UNIT products). Null for no limit."},"max_quantity":{"type":"number","nullable":true,"minimum":0.001,"example":3,"description":"Most one line may have, in the sale unit (pieces for UNIT products). Null for no limit."},"quantity_step":{"type":"number","nullable":true,"minimum":0.001,"example":0.25,"description":"MEASURED only: a line must be a multiple of this (0.25 kg). UNIT products always step by 1, so send null or 1 for them."},"quantity_presets":{"maxItems":10,"example":[0.25,0.5,1],"description":"Quick picks the e-menu offers, in the sale unit. Each must be within min/max and on the step.","type":"array","items":{"type":"number","minimum":0.001}},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"description":{"type":"string"},"description_ar":{"type":"string"},"base_price":{"type":"number","minimum":0},"cost_price":{"type":"number","minimum":0},"vat_percentage":{"type":"number","minimum":0,"maximum":100},"category_id":{"type":"string","format":"uuid"},"images":{"type":"array","items":{"type":"string"}},"barcode":{"type":"string","maxLength":100},"sku":{"type":"string","maxLength":100},"calories":{"type":"number","minimum":0},"loyalty_points":{"type":"number","nullable":true,"minimum":0},"service_duration":{"type":"number","minimum":1},"service_buffer":{"type":"number","minimum":0},"sort_order":{"type":"number","minimum":0},"variants":{"type":"array","items":{"$ref":"#/components/schemas/CreateProductVariantDto"}},"option_group_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"available_all_branches":{"type":"boolean"}},"required":["name","base_price"],"title":"CreateProductDto"},"LegacyVariantSummaryResponseDto":{"type":"object","properties":{"count":{"type":"number","example":47,"description":"Deletable products only."}},"required":["count"],"title":"LegacyVariantSummaryResponseDto"},"LegacyVariantResponseDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"product_name":{"type":"string","example":"Chicken Shawarma"},"product_name_ar":{"type":"string","nullable":true,"example":"شاورما دجاج"},"variant_id":{"type":"string","format":"uuid"},"variant_price":{"type":"number","example":18.5},"base_price":{"type":"number","example":18.5},"eligible":{"type":"boolean","example":true,"description":"False when `skip_reasons` is non-empty. Such rows are read-only."},"skip_reasons":{"type":"array","items":{"type":"string","enum":["PRICE_EDITED","HAS_STOCK_ITEM","HAS_RECIPE","HAS_PRICE_OVERRIDE","NO_LONGER_MATCHES"]},"example":[]}},"required":["product_id","product_name","product_name_ar","variant_id","variant_price","base_price","eligible","skip_reasons"],"title":"LegacyVariantResponseDto"},"LegacyVariantListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyVariantResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"LegacyVariantListResponseDto"},"CleanupLegacyVariantsDto":{"type":"object","properties":{"product_ids":{"description":"The products to clean up. Omit to clean up every eligible product. Ids are re-validated server-side, so anything that stopped matching is reported under `skipped` rather than deleted.","type":"array","items":{"type":"string","format":"uuid"}}},"title":"CleanupLegacyVariantsDto"},"LegacyVariantSkippedResponseDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"reason":{"enum":["PRICE_EDITED","HAS_STOCK_ITEM","HAS_RECIPE","HAS_PRICE_OVERRIDE","NO_LONGER_MATCHES"],"type":"string"}},"required":["product_id","reason"],"title":"LegacyVariantSkippedResponseDto"},"LegacyVariantCleanupResponseDto":{"type":"object","properties":{"deleted":{"type":"number","example":43},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/LegacyVariantSkippedResponseDto"}}},"required":["deleted","skipped"],"title":"LegacyVariantCleanupResponseDto"},"UpdateProductDto":{"type":"object","properties":{"type":{"enum":["PRODUCT","SERVICE"],"type":"string"},"status":{"enum":["ACTIVE","INACTIVE","ARCHIVED"],"type":"string"},"is_active":{"type":"boolean","description":"When false, hidden from POS and e-menu. Soft-delete sets this false."},"slot_capacity":{"type":"number","nullable":true,"minimum":1,"maximum":1000,"description":"Bookings one slot of this SERVICE can take when booked without staff (same at every branch). Null = unlimited. Ignored at a branch where the service has assigned staff."},"requires_booking":{"type":"boolean","description":"Whether this SERVICE product requires staff/slot availability booking. False for flat services sold like a product (e.g. tickets, play-zone entry)."},"advance_payment_type":{"enum":["NONE","FIXED","PERCENTAGE"],"type":"string","description":"How the advance deposit is calculated for SERVICE products."},"advance_payment_amount":{"type":"number","minimum":0,"description":"Advance amount: currency value for FIXED, percentage 0-100 for PERCENTAGE. Ignored when type is NONE."},"show_in_menu":{"type":"boolean","description":"When false, hidden from the e-menu/website but still sellable in the cashier."},"track_availability":{"type":"boolean","description":"Refuse e-menu orders (and warn on the POS) once the branch runs out of stock. Needs a sales recipe or a stock-linked variant."},"exclude_from_delivery_apps":{"type":"boolean","description":"Leave this product out of the menu sent to delivery apps. It stays sellable on the POS and the e-menu."},"extra_info":{"nullable":true,"description":"Replaces the whole extra information; null clears it.","type":"object","allOf":[{"$ref":"#/components/schemas/ProductExtraInfoDto"}]},"sale_mode":{"description":"UNIT sells whole pieces. MEASURED sells a weight or volume: `base_price` is then the price of one `sale_unit` (per kg) and line quantities may be fractional.","allOf":[{"$ref":"#/components/schemas/ProductSaleMode"}]},"sale_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"The unit a MEASURED product is sold in: a system MASS or VOLUME unit (g, kg, ml, L). Required for MEASURED, cleared for UNIT."},"scale_code":{"type":"string","nullable":true,"pattern":"^\\d{1,10}$","example":"010008","description":"The item code a scale prints into its labels (1–10 digits, leading zeros kept). Unique per business: PRODUCT_SCALE_CODE_TAKEN otherwise. Null or \"\" clears it."},"min_quantity":{"type":"number","nullable":true,"minimum":0.001,"example":0.25,"description":"Least quantity one line may have, in the sale unit (pieces for UNIT products). Null for no limit."},"max_quantity":{"type":"number","nullable":true,"minimum":0.001,"example":3,"description":"Most one line may have, in the sale unit (pieces for UNIT products). Null for no limit."},"quantity_step":{"type":"number","nullable":true,"minimum":0.001,"example":0.25,"description":"MEASURED only: a line must be a multiple of this (0.25 kg). UNIT products always step by 1, so send null or 1 for them."},"quantity_presets":{"maxItems":10,"example":[0.25,0.5,1],"description":"Quick picks the e-menu offers, in the sale unit. Each must be within min/max and on the step.","type":"array","items":{"type":"number","minimum":0.001}},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"description":{"type":"string"},"description_ar":{"type":"string"},"base_price":{"type":"number","minimum":0},"cost_price":{"type":"number","minimum":0},"vat_percentage":{"type":"number","minimum":0,"maximum":100},"category_id":{"type":"string","format":"uuid"},"images":{"type":"array","items":{"type":"string"}},"barcode":{"type":"string","maxLength":100},"sku":{"type":"string","maxLength":100},"calories":{"type":"number","minimum":0},"loyalty_points":{"type":"number","nullable":true,"minimum":0},"service_duration":{"type":"number","minimum":1},"service_buffer":{"type":"number","minimum":0},"sort_order":{"type":"number","minimum":0},"variants":{"type":"array","items":{"$ref":"#/components/schemas/CreateProductVariantDto"}},"option_group_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"available_all_branches":{"type":"boolean"}},"title":"UpdateProductDto"},"PriceAdjustmentScopeDto":{"type":"object","properties":{"all":{"type":"boolean","description":"Every product in the restaurant."},"category_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"product_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"title":"PriceAdjustmentScopeDto"},"PriceAdjustmentDto":{"type":"object","properties":{"operation":{"enum":["MARKUP","MARKDOWN","EXTRACT"],"type":"string"},"percentage":{"type":"number","minimum":0,"maximum":100,"description":"Percentage, e.g. 15 for 15%."},"scope":{"$ref":"#/components/schemas/PriceAdjustmentScopeDto"},"targets":{"minItems":1,"type":"array","items":{"type":"string","enum":["PRODUCT_BASE","VARIANT","OPTION_DELTA","PRICE_OVERRIDE"]}},"rounding":{"enum":["NEAREST_01","NEAREST_05","NEAREST_25","NEAREST_100"],"type":"string","default":"NEAREST_01"}},"required":["operation","percentage","scope","targets"],"title":"PriceAdjustmentDto"},"PriceAdjustmentLineDto":{"type":"object","properties":{"target":{"enum":["PRODUCT_BASE","VARIANT","OPTION_DELTA","PRICE_OVERRIDE"],"type":"string"},"entity_id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"old_value":{"type":"number"},"new_value":{"type":"number"}},"required":["target","entity_id","label","field","old_value","new_value"],"title":"PriceAdjustmentLineDto"},"PriceAdjustmentPreviewDto":{"type":"object","properties":{"confirm_token":{"type":"string"},"line_count":{"type":"number"},"total_delta":{"type":"number","description":"Sum of newValue - oldValue across every line."},"lines":{"type":"array","items":{"$ref":"#/components/schemas/PriceAdjustmentLineDto"}}},"required":["confirm_token","line_count","total_delta","lines"],"title":"PriceAdjustmentPreviewDto"},"ApplyPriceAdjustmentDto":{"type":"object","properties":{"operation":{"enum":["MARKUP","MARKDOWN","EXTRACT"],"type":"string"},"percentage":{"type":"number","minimum":0,"maximum":100,"description":"Percentage, e.g. 15 for 15%."},"scope":{"$ref":"#/components/schemas/PriceAdjustmentScopeDto"},"targets":{"minItems":1,"type":"array","items":{"type":"string","enum":["PRODUCT_BASE","VARIANT","OPTION_DELTA","PRICE_OVERRIDE"]}},"rounding":{"enum":["NEAREST_01","NEAREST_05","NEAREST_25","NEAREST_100"],"type":"string","default":"NEAREST_01"},"confirm_token":{"type":"string"}},"required":["operation","percentage","scope","targets","confirm_token"],"title":"ApplyPriceAdjustmentDto"},"BulkPriceUpdateItemDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"base_price":{"type":"number","minimum":0}},"required":["product_id","base_price"],"title":"BulkPriceUpdateItemDto"},"BulkPriceUpdateDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BulkPriceUpdateItemDto"}}},"required":["items"],"title":"BulkPriceUpdateDto"},"BulkPriceUpdateResponseDto":{"type":"object","properties":{"updated":{"type":"number","example":3}},"required":["updated"],"title":"BulkPriceUpdateResponseDto"},"BulkDeleteProductsDto":{"type":"object","properties":{"product_ids":{"minItems":1,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["product_ids"],"title":"BulkDeleteProductsDto"},"BulkDeleteProductsResponseDto":{"type":"object","properties":{"deleted":{"type":"number","example":3,"description":"How many products were soft-deleted."}},"required":["deleted"],"title":"BulkDeleteProductsResponseDto"},"UpdateProductVariantDto":{"type":"object","properties":{"stock_item_id":{"type":"string","nullable":true,"format":"uuid"},"net_quantity":{"type":"number","nullable":true,"minimum":0.001,"example":2,"description":"A fixed pack's content: one sold piece of this variant takes this much from stock (a \"2 kg\" pack). Needs `net_unit_id`. Only for products sold by the piece."},"net_unit_id":{"type":"string","nullable":true,"format":"uuid","description":"The unit of `net_quantity`: a unit with a dimension (kg, g, L, ml)."},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"sku":{"type":"string","maxLength":100},"barcode":{"type":"string","maxLength":100},"price":{"type":"number","minimum":0},"cost_price":{"type":"number","minimum":0},"calories":{"type":"number","minimum":0},"is_default":{"type":"boolean"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"}},"title":"UpdateProductVariantDto"},"LinkOptionGroupsDto":{"type":"object","properties":{"option_group_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["option_group_ids"],"title":"LinkOptionGroupsDto"},"ReorderProductOptionGroupsDto":{"type":"object","properties":{"option_group_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["option_group_ids"],"title":"ReorderProductOptionGroupsDto"},"UpsertBranchAvailabilityDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"is_available":{"type":"boolean"}},"required":["branch_id","is_available"],"title":"UpsertBranchAvailabilityDto"},"ImportRowErrorResponseDto":{"type":"object","properties":{"row":{"type":"number","example":2},"field":{"type":"string","example":"basePrice"},"message":{"type":"string","example":"basePrice must be a positive number"}},"required":["row","field","message"],"title":"ImportRowErrorResponseDto"},"ProductImportResponseDto":{"type":"object","properties":{"imported":{"type":"number","example":12},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ImportRowErrorResponseDto"}}},"required":["imported","errors"],"title":"ProductImportResponseDto"},"RecipeEffectItemDto":{"type":"object","properties":{"id":{"type":"string"},"stock_item_id":{"type":"string"},"stock_item_name":{"type":"string","nullable":true},"effect_type":{"type":"string"},"quantity":{"type":"number"},"unit_id":{"type":"string"}},"required":["id","stock_item_id","stock_item_name","effect_type","quantity","unit_id"],"title":"RecipeEffectItemDto"},"OptionValueResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"option_group_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"price_delta":{"type":"number"},"cost_price":{"type":"number","nullable":true},"stock_item_id":{"type":"string","nullable":true,"format":"uuid"},"stock_item_name":{"type":"string","nullable":true},"calories":{"type":"number","nullable":true},"multiply":{"type":"boolean"},"max_multiply":{"type":"number","nullable":true},"is_default":{"type":"boolean"},"sort_order":{"type":"number"},"is_active":{"type":"boolean"},"recipe_effects":{"type":"array","items":{"$ref":"#/components/schemas/RecipeEffectItemDto"}}},"required":["id","option_group_id","name","name_ar","price_delta","cost_price","stock_item_id","calories","multiply","max_multiply","is_default","sort_order","is_active"],"title":"OptionValueResponseDto"},"OptionGroupResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"selection_type":{"enum":["SINGLE","MULTI"],"type":"string"},"required":{"type":"boolean"},"min_selections":{"type":"number"},"max_selections":{"type":"number","nullable":true},"is_snoozed":{"type":"boolean"},"sort_order":{"type":"number"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValueResponseDto"}}},"required":["id","restaurant_id","name","name_ar","selection_type","required","min_selections","max_selections","is_snoozed","sort_order","is_active","created_at","updated_at","values"],"title":"OptionGroupResponseDto"},"CreateOptionValueDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"price_delta":{"type":"number","minimum":0,"default":0},"cost_price":{"type":"number","minimum":0},"stock_item_id":{"type":"string","format":"uuid"},"calories":{"type":"number","minimum":0},"multiply":{"type":"boolean","default":false},"max_multiply":{"type":"number","minimum":1},"is_default":{"type":"boolean","default":false},"sort_order":{"type":"number","minimum":0,"default":0}},"required":["name"],"title":"CreateOptionValueDto"},"CreateOptionGroupDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"selection_type":{"enum":["SINGLE","MULTI"],"type":"string","default":"SINGLE"},"required":{"type":"boolean","default":false},"min_selections":{"type":"number","minimum":0,"default":0},"max_selections":{"type":"number","minimum":1},"sort_order":{"type":"number","minimum":0,"default":0},"values":{"type":"array","items":{"$ref":"#/components/schemas/CreateOptionValueDto"}}},"required":["name"],"title":"CreateOptionGroupDto"},"UpdateOptionGroupDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"selection_type":{"enum":["SINGLE","MULTI"],"type":"string"},"required":{"type":"boolean"},"min_selections":{"type":"number","minimum":0},"max_selections":{"type":"number","minimum":1},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"},"values":{"type":"array","items":{"$ref":"#/components/schemas/CreateOptionValueDto"}}},"title":"UpdateOptionGroupDto"},"UpdateSortOrderDto":{"type":"object","properties":{"sort_order":{"type":"number","minimum":0}},"required":["sort_order"],"title":"UpdateSortOrderDto"},"OptionReorderItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0}},"required":["id","sort_order"],"title":"OptionReorderItemDto"},"ReorderOptionValuesDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OptionReorderItemDto"}}},"required":["items"],"title":"ReorderOptionValuesDto"},"UpdateOptionValueDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"price_delta":{"type":"number","minimum":0},"cost_price":{"type":"number","minimum":0},"stock_item_id":{"type":"string","format":"uuid"},"calories":{"type":"number","minimum":0},"multiply":{"type":"boolean"},"max_multiply":{"type":"number","minimum":1},"is_default":{"type":"boolean"},"sort_order":{"type":"number","minimum":0},"is_active":{"type":"boolean"}},"title":"UpdateOptionValueDto"},"CategoryBranchAvailabilityResponseDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"}},"required":["branch_id"],"title":"CategoryBranchAvailabilityResponseDto"},"CategoryResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"parent_id":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","example":"Burgers"},"name_ar":{"type":"string","nullable":true,"example":"برغر"},"image_url":{"type":"string","nullable":true},"show_in_menu":{"type":"boolean","example":true},"sort_order":{"type":"number","example":0},"is_active":{"type":"boolean","example":true},"available_all_branches":{"type":"boolean","example":true,"description":"When false, only listed branches see this category (root categories only)"},"branch_availabilities":{"type":"array","items":{"$ref":"#/components/schemas/CategoryBranchAvailabilityResponseDto"}},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/CategoryResponseDto"}}},"required":["id","restaurant_id","parent_id","name","name_ar","image_url","show_in_menu","sort_order","is_active","available_all_branches","branch_availabilities","created_at","updated_at","children"],"title":"CategoryResponseDto"},"CategoryListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CategoryResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"CategoryListResponseDto"},"CreateCategoryDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"image_url":{"type":"string","nullable":true},"parent_id":{"type":"string","format":"uuid"},"show_in_menu":{"type":"boolean"},"is_active":{"type":"boolean"},"available_all_branches":{"type":"boolean"}},"required":["name"],"title":"CreateCategoryDto"},"ReorderItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sort_order":{"type":"number","minimum":0},"parent_id":{"type":"string","nullable":true,"format":"uuid"}},"required":["id","sort_order"],"title":"ReorderItemDto"},"ReorderCategoriesDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReorderItemDto"}}},"required":["items"],"title":"ReorderCategoriesDto"},"UpdateCategoryDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"image_url":{"type":"string","nullable":true},"parent_id":{"type":"string","nullable":true,"format":"uuid"},"show_in_menu":{"type":"boolean"},"is_active":{"type":"boolean"},"available_all_branches":{"type":"boolean"}},"title":"UpdateCategoryDto"},"AddCategoryBranchDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"}},"required":["branch_id"],"title":"AddCategoryBranchDto"},"DiscountResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"applies_to":{"enum":["ORDERS","PRODUCTS","BOTH"],"type":"string"},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"value":{"type":"number"},"max_discount_amount":{"type":"number","nullable":true},"reference_code":{"type":"string","nullable":true},"taxable_discount":{"type":"boolean"},"applies_all_branches":{"type":"boolean"},"branch_ids":{"type":"array","items":{"type":"string"}},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","applies_to","discount_type","value","max_discount_amount","reference_code","taxable_discount","applies_all_branches","branch_ids","is_active","created_at","updated_at"],"title":"DiscountResponseDto"},"CreateDiscountDto":{"type":"object","properties":{"name":{"type":"string","maxLength":150,"example":"Summer Sale"},"name_ar":{"type":"string","maxLength":150,"example":"خصم الصيف"},"applies_to":{"enum":["ORDERS","PRODUCTS","BOTH"],"type":"string"},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"value":{"type":"number","minimum":0.01,"example":10},"max_discount_amount":{"type":"number","minimum":0,"example":50},"reference_code":{"type":"string","maxLength":100,"example":"SUMMER2026"},"taxable_discount":{"type":"boolean","default":false},"applies_all_branches":{"type":"boolean","default":true},"branch_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["name","applies_to","discount_type","value"],"title":"CreateDiscountDto"},"UpdateDiscountDto":{"type":"object","properties":{"name":{"type":"string","maxLength":150,"example":"Summer Sale"},"name_ar":{"type":"string","maxLength":150,"example":"خصم الصيف"},"applies_to":{"enum":["ORDERS","PRODUCTS","BOTH"],"type":"string"},"discount_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"value":{"type":"number","minimum":0.01,"example":10},"max_discount_amount":{"type":"number","minimum":0,"example":50},"reference_code":{"type":"string","maxLength":100,"example":"SUMMER2026"},"taxable_discount":{"type":"boolean","default":false},"applies_all_branches":{"type":"boolean","default":true},"branch_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"is_active":{"type":"boolean"}},"title":"UpdateDiscountDto"},"RestaurantResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"account_number":{"type":"number","description":"Sequential public account number","example":1001},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code for this restaurant. Defaults to \"SAR\" until configured."},"settings":{"type":"object","additionalProperties":{},"description":"Restaurant settings (general, workingHours, orders, payments, …). Contains address, tax, currency, logo, working hours, and all other restaurant configuration. Payment provider credentials are never included."},"is_active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","account_number","name","name_ar","phone","email","currency","settings","is_active","created_at","updated_at"],"title":"RestaurantResponseDto"},"CreateRestaurantDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"phone":{"type":"string","maxLength":30},"email":{"type":"string","format":"email"}},"required":["name"],"title":"CreateRestaurantDto"},"UpdateRestaurantDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"phone":{"type":"string","maxLength":30},"email":{"type":"string","format":"email"},"is_active":{"type":"boolean"}},"title":"UpdateRestaurantDto"},"TagResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"VIP Clients"},"name_ar":{"type":"string","nullable":true},"slug":{"type":"string","example":"vip-clients"},"color":{"type":"string","nullable":true,"example":"#FF6B6B"},"description":{"type":"string","nullable":true},"assignment_count":{"type":"number","description":"Number of entities this tag is attached to."},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","name","name_ar","slug","color","description","assignment_count","created_at","updated_at"],"title":"TagResponseDto"},"TagSummaryResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"slug":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["id","name","name_ar","slug","color"],"title":"TagSummaryResponseDto"},"TaggedEntityResponseDto":{"type":"object","properties":{"entity_type":{"enum":["RESTAURANT","CUSTOMER","BRANCH","STAFF"],"type":"string"},"entity_id":{"type":"string","format":"uuid"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagSummaryResponseDto"}}},"required":["entity_type","entity_id","tags"],"title":"TaggedEntityResponseDto"},"CreateTagDto":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"example":"VIP Clients"},"name_ar":{"type":"string","maxLength":80,"example":"عملاء مميزون"},"color":{"type":"string","pattern":"^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$","example":"#FF6B6B","description":"Hex colour used as a UI hint."},"description":{"type":"string","maxLength":500,"example":"High-value restaurants under key-account care."}},"required":["name"],"title":"CreateTagDto"},"UpdateTagDto":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"example":"VIP Clients"},"name_ar":{"type":"string","maxLength":80,"example":"عملاء مميزون"},"color":{"type":"string","pattern":"^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$","example":"#FF6B6B","description":"Hex colour used as a UI hint."},"description":{"type":"string","maxLength":500,"example":"High-value restaurants under key-account care."}},"title":"UpdateTagDto"},"AssignTagDto":{"type":"object","properties":{"entity_type":{"enum":["RESTAURANT","CUSTOMER","BRANCH","STAFF"],"type":"string"},"entity_ids":{"minItems":1,"example":["b3f1…","a90c…"],"type":"array","items":{"type":"string","format":"uuid"}}},"required":["entity_type","entity_ids"],"title":"AssignTagDto"},"RestaurantResetTargetDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Burger House"},"account_number":{"type":"number","example":1042,"description":"Value the caller must echo as `account_number` to confirm the reset."}},"required":["id","name","account_number"],"title":"RestaurantResetTargetDto"},"RestaurantResetPreviewResponseDto":{"type":"object","properties":{"restaurant":{"$ref":"#/components/schemas/RestaurantResetTargetDto"},"counts":{"type":"object","additionalProperties":{"type":"integer"},"example":{"orders":128,"order_returns":3,"cashier_shifts":12,"stock_transactions":640,"inventory_levels":41,"loyalty_transactions":87,"customers":25},"description":"Rows that would be removed, keyed by database table name."},"total":{"type":"number","example":936,"description":"Sum of every count above."}},"required":["restaurant","counts","total"],"title":"RestaurantResetPreviewResponseDto"},"ResetRestaurantDto":{"type":"object","properties":{"account_number":{"type":"number","minimum":1}},"required":["account_number"],"title":"ResetRestaurantDto"},"RestaurantResetSummaryResponseDto":{"type":"object","properties":{"restaurant":{"$ref":"#/components/schemas/RestaurantResetTargetDto"},"deleted":{"type":"object","additionalProperties":{"type":"integer"},"example":{"orders":128,"order_returns":3,"cashier_shifts":12,"stock_transactions":640,"inventory_levels":41,"loyalty_transactions":87,"customers":25},"description":"Rows actually removed, keyed by database table name."},"total":{"type":"number","example":936,"description":"Sum of every count above."},"reset_at":{"type":"string","format":"date-time"}},"required":["restaurant","deleted","total","reset_at"],"title":"RestaurantResetSummaryResponseDto"},"DeleteRestaurantDto":{"type":"object","properties":{"account_number":{"type":"number","minimum":1}},"required":["account_number"],"title":"DeleteRestaurantDto"},"RestaurantDeletionSummaryResponseDto":{"type":"object","properties":{"restaurant":{"$ref":"#/components/schemas/RestaurantResetTargetDto"},"deleted":{"type":"object","additionalProperties":{"type":"integer"},"example":{"orders":12,"customers":4,"stock_items":30,"restaurants":1,"users":2},"description":"Rows removed by explicit deletes, keyed by database table name. Rows cascaded from the restaurant are not listed."},"total":{"type":"number","example":49,"description":"Sum of every count above."},"deleted_at":{"type":"string","format":"date-time"}},"required":["restaurant","deleted","total","deleted_at"],"title":"RestaurantDeletionSummaryResponseDto"},"MigratedOrderVatTargetDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Burger House"},"account_number":{"type":"number","example":1042,"description":"Value the caller must echo to apply."}},"required":["id","name","account_number"],"title":"MigratedOrderVatTargetDto"},"MigratedOrderVatMonthDto":{"type":"object","properties":{"month":{"type":"string","example":"2026-03"},"with_vat":{"type":"number","example":412},"without_vat":{"type":"number","example":1830}},"required":["month","with_vat","without_vat"],"title":"MigratedOrderVatMonthDto"},"MigratedOrderVatSummaryResponseDto":{"type":"object","properties":{"restaurant":{"$ref":"#/components/schemas/MigratedOrderVatTargetDto"},"currency":{"type":"string","example":"SAR"},"rate":{"type":"number","example":0.15},"missing_count":{"type":"number","example":14354,"description":"Fixable orders across the whole history."},"first_missing_at":{"type":"string","nullable":true,"format":"date-time"},"last_missing_at":{"type":"string","nullable":true,"format":"date-time"},"first_vat_at":{"type":"string","nullable":true,"format":"date-time","description":"Earliest order that already records VAT."},"months":{"type":"array","items":{"$ref":"#/components/schemas/MigratedOrderVatMonthDto"}}},"required":["restaurant","currency","rate","missing_count","first_missing_at","last_missing_at","first_vat_at","months"],"title":"MigratedOrderVatSummaryResponseDto"},"MigratedOrderVatSampleDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"serial_number":{"type":"number","nullable":true,"example":1532},"created_at":{"type":"string","format":"date-time"},"total":{"type":"number","example":25},"vat":{"type":"number","example":3.26}},"required":["id","serial_number","created_at","total","vat"],"title":"MigratedOrderVatSampleDto"},"MigratedOrderVatPreviewResponseDto":{"type":"object","properties":{"from":{"type":"string","example":"2026-01-01"},"to":{"type":"string","example":"2026-09-02"},"rate":{"type":"number","example":0.15},"count":{"type":"number","example":14354},"vat_to_add":{"type":"number","example":48210.55},"total_unchanged":{"type":"number","example":369614.2,"description":"Sum of the affected totals; unchanged."},"skipped_zatca":{"type":"number","example":0,"description":"Left alone: a ZATCA invoice or QR exists."},"samples":{"type":"array","items":{"$ref":"#/components/schemas/MigratedOrderVatSampleDto"}}},"required":["from","to","rate","count","vat_to_add","total_unchanged","skipped_zatca","samples"],"title":"MigratedOrderVatPreviewResponseDto"},"ApplyMigratedOrderVatDto":{"type":"object","properties":{"from":{"type":"string","example":"2026-01-01","description":"First day, inclusive (Asia/Riyadh)."},"to":{"type":"string","example":"2026-09-02","description":"Last day, inclusive (Asia/Riyadh)."},"account_number":{"type":"number","minimum":1,"example":1042}},"required":["from","to","account_number"],"title":"ApplyMigratedOrderVatDto"},"MigratedOrderVatResultResponseDto":{"type":"object","properties":{"from":{"type":"string","example":"2026-01-01"},"to":{"type":"string","example":"2026-09-02"},"rate":{"type":"number","example":0.15},"updated":{"type":"number","example":14354},"vat_added":{"type":"number","example":48210.55},"applied_at":{"type":"string","format":"date-time"}},"required":["from","to","rate","updated","vat_added","applied_at"],"title":"MigratedOrderVatResultResponseDto"},"ScheduledOrderSettingsResponseDto":{"type":"object","properties":{"enabled":{"type":"boolean"},"min_lead_minutes":{"type":"number","minimum":0,"maximum":1440},"max_days_ahead":{"type":"number","minimum":1,"maximum":60},"slot_minutes":{"type":"number","enum":[5,10,15,20,30,60]},"order_types":{"type":"array","items":{"type":"string","enum":["TAKEAWAY","DELIVERY","DRIVE_THROUGH"]}},"max_orders_per_slot":{"type":"number","nullable":true,"minimum":1,"maximum":1000,"description":"Scheduled orders one slot step can take; null = no limit."},"asap_order_types":{"type":"array","items":{"type":"string","enum":["TAKEAWAY","DELIVERY","DRIVE_THROUGH"]},"description":"Order types that may be ordered \"as soon as possible\"; may be empty."},"hours":{"additionalProperties":true,"nullable":true,"description":"Custom scheduling windows; null = follow the opening hours.","type":"object","allOf":[{"$ref":"#/components/schemas/WorkingHoursSettingsDto"}]}},"required":["enabled","min_lead_minutes","max_days_ahead","slot_minutes","order_types","max_orders_per_slot","asap_order_types","hours"],"title":"ScheduledOrderSettingsResponseDto"},"BranchDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Burger Palace - Main St"},"name_ar":{"type":"string","nullable":true,"example":"برجر بالاس - الشارع الرئيسي"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"address":{"type":"string","nullable":true},"address_ar":{"type":"string","nullable":true},"city":{"type":"string","nullable":true,"example":"Riyadh"},"city_ar":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true,"example":"+966500000000"},"whatsapp_number":{"type":"string","nullable":true,"example":"+966500000000","description":"WhatsApp number for order notifications."},"latitude":{"type":"string","nullable":true,"description":"WGS84 latitude as decimal string."},"longitude":{"type":"string","nullable":true,"description":"WGS84 longitude as decimal string."},"timezone":{"type":"string","nullable":true,"example":"Asia/Riyadh"},"is_24h":{"type":"boolean","example":false},"working_hours":{"type":"object","nullable":true,"additionalProperties":{},"description":"Per-day opening hours (free-form JSON)."},"scheduled_orders":{"nullable":true,"description":"This branch's e-menu scheduled-order rules, every key filled. null = the branch follows the restaurant's `orders.scheduled_orders`.","type":"object","allOf":[{"$ref":"#/components/schemas/ScheduledOrderSettingsResponseDto"}]},"cover_image_url":{"type":"string","nullable":true},"is_main_branch":{"type":"boolean","example":false},"is_active":{"type":"boolean","example":true},"enabled_order_types":{"type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]},"example":["DINE_IN","TAKEAWAY","DELIVERY"],"description":"POS order types when this branch is specialised. Both lists empty = inherit restaurant Settings → Orders."},"enabled_emenu_order_types":{"type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]},"example":["DINE_IN","TAKEAWAY"],"description":"E-menu order types when this branch is specialised. Both lists empty = inherit restaurant Settings → Orders."},"pos_order_types":{"description":"Resolved POS order-type visibility for this branch. Same shape as public `emenu_order_types`. Inherit restaurant `accept_*` while both allow-lists are empty; otherwise the POS list.","allOf":[{"$ref":"#/components/schemas/EmenuOrderTypesVisibility"}]},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","currency","address","address_ar","city","city_ar","phone","whatsapp_number","latitude","longitude","timezone","is_24h","working_hours","scheduled_orders","cover_image_url","is_main_branch","is_active","enabled_order_types","enabled_emenu_order_types","pos_order_types","created_at","updated_at"],"title":"BranchDto"},"BranchListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BranchDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"BranchListResponseDto"},"CreateBranchDto":{"type":"object","properties":{"working_hours":{"type":"object","additionalProperties":{}},"enabled_emenu_order_types":{"type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]},"description":"E-menu list when specialised. Both POS and e-menu lists empty = inherit restaurant Settings → Orders. May include types the restaurant default has off."},"scheduled_orders":{"nullable":true,"description":"E-menu scheduled-order rules for this branch, replacing the restaurant's `orders.scheduled_orders` whole (no per-key merge). null = follow the restaurant.","type":"object","allOf":[{"$ref":"#/components/schemas/ScheduledOrderSettingsDto"}]},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"address":{"type":"string"},"address_ar":{"type":"string"},"city":{"type":"string","maxLength":100},"city_ar":{"type":"string","maxLength":100},"phone":{"type":"string","maxLength":30},"whatsapp_number":{"type":"string","maxLength":30},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"timezone":{"type":"string","maxLength":50},"is_24h":{"type":"boolean"},"cover_image_url":{"type":"string"},"is_main_branch":{"type":"boolean"},"enabled_order_types":{"type":"array","items":{"type":"string","enum":["SERVICE","DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING"]}}},"required":["name"],"title":"CreateBranchDto"},"UpdateBranchDto":{"type":"object","properties":{"working_hours":{"type":"object","additionalProperties":{}},"enabled_emenu_order_types":{"type":"array","items":{"type":"string","enum":["DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING","SERVICE"]},"description":"E-menu list when specialised. Both POS and e-menu lists empty = inherit restaurant Settings → Orders. May include types the restaurant default has off."},"scheduled_orders":{"nullable":true,"description":"E-menu scheduled-order rules for this branch, replacing the restaurant's `orders.scheduled_orders` whole (no per-key merge). null = follow the restaurant.","type":"object","allOf":[{"$ref":"#/components/schemas/ScheduledOrderSettingsDto"}]},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"address":{"type":"string"},"address_ar":{"type":"string"},"city":{"type":"string","maxLength":100},"city_ar":{"type":"string","maxLength":100},"phone":{"type":"string","maxLength":30},"whatsapp_number":{"type":"string","maxLength":30},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"timezone":{"type":"string","maxLength":50},"is_24h":{"type":"boolean"},"cover_image_url":{"type":"string"},"is_main_branch":{"type":"boolean"},"enabled_order_types":{"type":"array","items":{"type":"string","enum":["SERVICE","DINE_IN","TAKEAWAY","DELIVERY","DRIVE_THROUGH","BOOKING"]}},"is_active":{"type":"boolean"}},"title":"UpdateBranchDto"},"FieldOptionDto":{"type":"object","properties":{"value":{"type":"string","description":"Stored value key (used in OrderFieldValue.value)"},"label_ar":{"type":"string","description":"Arabic display label for this option"}},"required":["value"],"title":"FieldOptionDto"},"CreateBranchOrderFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"English label displayed to staff when creating an order"},"label_ar":{"type":"string","description":"Arabic label"},"type":{"enum":["TEXT","DROPDOWN"],"type":"string","description":"TEXT or DROPDOWN"},"options":{"description":"Required when type is DROPDOWN. Each entry has a value key and optional Arabic label.","type":"array","items":{"$ref":"#/components/schemas/FieldOptionDto"}},"is_required":{"type":"boolean","default":false},"sort_order":{"type":"number","minimum":0,"default":0,"description":"Display order (ascending)"}},"required":["label","type"],"title":"CreateBranchOrderFieldDto"},"BranchOrderFieldResponseDto":{"type":"object","properties":{"id":{"type":"string"},"restaurant_id":{"type":"string"},"branch_id":{"type":"string"},"label":{"type":"string"},"label_ar":{"type":"string","nullable":true},"type":{"enum":["TEXT","DROPDOWN"],"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"labelAr":{"type":"string"}},"required":["value"]}},"is_required":{"type":"boolean"},"sort_order":{"type":"number"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","branch_id","label","type","options","is_required","sort_order","is_active","created_at","updated_at"],"title":"BranchOrderFieldResponseDto"},"UpdateBranchOrderFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"English label displayed to staff when creating an order"},"label_ar":{"type":"string","description":"Arabic label"},"type":{"enum":["TEXT","DROPDOWN"],"type":"string","description":"TEXT or DROPDOWN"},"options":{"description":"Required when type is DROPDOWN. Each entry has a value key and optional Arabic label.","type":"array","items":{"$ref":"#/components/schemas/FieldOptionDto"}},"is_required":{"type":"boolean","default":false},"sort_order":{"type":"number","minimum":0,"default":0,"description":"Display order (ascending)"}},"title":"UpdateBranchOrderFieldDto"},"PublicPlanPeriodDto":{"type":"object","properties":{"months":{"type":"number","enum":[1,3,4,6,12]},"discount_percent":{"type":"number","example":15,"description":"0–100."}},"required":["months","discount_percent"],"title":"PublicPlanPeriodDto"},"PublicPlanFeatureDto":{"type":"object","properties":{"feature_key":{"type":"string","example":"kitchen_display"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"value_type":{"type":"string","enum":["BOOLEAN","LIMIT"]},"bool_value":{"type":"boolean","nullable":true},"limit_value":{"type":"number","nullable":true,"description":"-1 = unlimited."}},"required":["feature_key","name","name_ar","value_type","bool_value","limit_value"],"title":"PublicPlanFeatureDto"},"PublicPlanResponseDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"description_ar":{"type":"string","nullable":true},"country":{"type":"string","example":"EG","description":"Country this price is for."},"currency":{"type":"string","example":"EGP","description":"Price currency (the country’s display currency)."},"base_price":{"type":"string","example":"1500.00","description":"Per month, covers `included_branches`."},"included_branches":{"type":"number"},"branch_price":{"type":"string","example":"900.00","description":"Per month per extra branch."},"min_branches":{"type":"number","nullable":true},"max_branches":{"type":"number","nullable":true},"alignment":{"type":"string","enum":["ALIGNED","OWN_DATES"]},"periods":{"type":"array","items":{"$ref":"#/components/schemas/PublicPlanPeriodDto"}},"sort_order":{"type":"number"},"features":{"type":"array","items":{"$ref":"#/components/schemas/PublicPlanFeatureDto"}}},"required":["id","name","name_ar","description","description_ar","country","currency","base_price","included_branches","branch_price","min_branches","max_branches","alignment","periods","sort_order","features"],"title":"PublicPlanResponseDto"},"PublicQuoteDto":{"type":"object","properties":{"plan_id":{"type":"string","maxLength":100,"description":"Plan id"},"branches":{"type":"number","minimum":1,"maximum":1000},"period_months":{"type":"number","enum":[1,3,4,6,12]},"country":{"type":"string","pattern":"^[A-Z]{2}$","example":"EG","default":"SA","description":"Country to price in (default SA). Must be enabled and the plan priced there."}},"required":["plan_id","branches","period_months"],"title":"PublicQuoteDto"},"CreateSubscriptionRequestDto":{"type":"object","properties":{"name":{"type":"string","maxLength":120,"example":"محمد العتيبي"},"phone":{"type":"string","maxLength":20,"example":"0551234567","description":"Mobile number. Saudi numbers are normalised to +9665XXXXXXXX, Egyptian ones to +201XXXXXXXXX (by `country`)."},"restaurant_name":{"type":"string","maxLength":150,"example":"مطعم الذواقة","description":"Business (activity) name."},"email":{"type":"string","maxLength":200,"format":"email"},"plan_id":{"type":"string","maxLength":100,"description":"Plan id"},"branches":{"type":"number","minimum":1,"maximum":1000,"description":"Branches to pay for (at least the plan minimum)."},"period_months":{"type":"number","enum":[1,3,4,6,12],"description":"One of the periods the plan offers."},"request_id":{"type":"string","format":"uuid","description":"The request id this browser got earlier. Only then is the request reused (same phone, still unpaid); otherwise a new request is recorded."},"source":{"type":"string","maxLength":100,"description":"Campaign / page the visitor came from."},"country":{"type":"string","pattern":"^[A-Z]{2}$","example":"EG","default":"SA","description":"Country the visitor is signing up from (`/` = SA, `/eg` = EG). Must be enabled; the plan must have a price there. Decides the currency, the phone format and the gateway."}},"required":["name","phone","restaurant_name","plan_id","branches","period_months"],"title":"CreateSubscriptionRequestDto"},"StartCheckoutDto":{"type":"object","properties":{"language":{"enum":["ar","en"],"type":"string"},"save_card":{"type":"boolean","description":"Save the card for automatic renewals. Default true."},"return_to":{"enum":["pay_link","dashboard"],"type":"string","description":"Where a hosted checkout returns the browser. Default pay_link."}},"title":"StartCheckoutDto"},"InvoiceChargeDto":{"type":"object","properties":{"amount":{"type":"string","example":"50.67","description":"What the card is charged."},"currency":{"type":"string","example":"USD"},"fx_rate":{"type":"string","example":"0.02026667","description":"Units of the charge currency per unit of the invoice currency."},"fx_source":{"type":"string","example":"STATIC_TABLE","description":"`STATIC_TABLE` (built-in rates) or `SETTINGS` (super-admin override)."},"fx_rate_at":{"format":"date-time","type":"string","description":"When the rate was taken (invoice creation)."}},"required":["amount","currency","fx_rate","fx_source","fx_rate_at"],"title":"InvoiceChargeDto"},"MoyasarApplePayDto":{"type":"object","properties":{"country_code":{"type":"string","example":"SA","description":"Merchant country Moyasar registered (always SA)."},"label":{"type":"string","example":"twlm","description":"Label shown on the Apple Pay sheet."},"validate_merchant_url":{"type":"string","example":"https://api.moyasar.com/v1/applepay/initiate","description":"Merchant validation endpoint the browser calls with the publishable key."},"supported_networks":{"example":["visa","mastercard","mada"],"type":"array","items":{"type":"string"}}},"required":["country_code","label","validate_merchant_url","supported_networks"],"title":"MoyasarApplePayDto"},"MoyasarIntentDto":{"type":"object","properties":{"publishable_api_key":{"type":"string","example":"pk_test_…","description":"Publishable key (safe to expose)."},"given_id":{"type":"string","format":"uuid","description":"Send as `given_id`: Moyasar uses it as the payment id, which makes the POST idempotent and lets the server look the payment up. Equals `transaction_id`."},"amount":{"type":"number","example":5067,"description":"Minor units of `currency` (cents, halalas)."},"currency":{"type":"string","example":"USD","description":"Charge currency (not necessarily the invoice’s)."},"description":{"type":"string","example":"TW-2026-000123 — Renewal — Basic"},"callback_url":{"type":"string","example":"https://api.twlm.solutions/billing/callback?tx=…","description":"Where Moyasar returns the browser after 3DS (our server; it 302s on to the app)."},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Send as-is as `metadata` (string values only)."},"save_card":{"type":"boolean","description":"Send as `source.save_card`."},"manual":{"type":"boolean","description":"Send as `source.manual`. True for a card-only verification: the amount is authorised, then voided by the server — never captured."},"methods":{"example":["creditcard","applepay"],"type":"array","items":{"type":"string"}},"supported_networks":{"example":["visa","mastercard","mada"],"type":"array","items":{"type":"string"}},"apple_pay":{"nullable":true,"description":"Null: no Apple Pay.","type":"object","allOf":[{"$ref":"#/components/schemas/MoyasarApplePayDto"}]}},"required":["publishable_api_key","given_id","amount","currency","description","callback_url","metadata","save_card","manual","methods","supported_networks","apple_pay"],"title":"MoyasarIntentDto"},"CheckoutStartResponseDto":{"type":"object","properties":{"mode":{"enum":["EMBEDDED","HOSTED","MOYASAR"],"type":"string"},"provider":{"enum":["myfatoorah","moyasar"],"type":"string"},"transaction_id":{"type":"string","format":"uuid"},"amount":{"type":"string","example":"2500.00","description":"Invoice amount, in `currency`."},"currency":{"type":"string","example":"EGP","description":"Invoice (price) currency."},"charge":{"nullable":true,"description":"Set when the card is charged in another currency: show \"charged as 50.67 USD\".","type":"object","allOf":[{"$ref":"#/components/schemas/InvoiceChargeDto"}]},"session_id":{"type":"string","description":"EMBEDDED: MyFatoorah session id."},"script_url":{"type":"string","description":"EMBEDDED: MyFatoorah script to load."},"checkout_url":{"type":"string","description":"HOSTED: redirect here."},"moyasar":{"description":"MOYASAR: the payment intent.","allOf":[{"$ref":"#/components/schemas/MoyasarIntentDto"}]}},"required":["mode","provider","transaction_id","amount","currency","charge"],"title":"CheckoutStartResponseDto"},"ConfirmCheckoutDto":{"type":"object","properties":{"transaction_id":{"type":"string","format":"uuid"}},"required":["transaction_id"],"title":"ConfirmCheckoutDto"},"QuoteDto":{"type":"object","properties":{"action":{"enum":["SUBSCRIBE","ADD_BRANCHES","CHANGE","RENEW"],"type":"string"},"plan_id":{"type":"string","maxLength":100,"description":"SUBSCRIBE, CHANGE: plan id"},"period_months":{"type":"number","enum":[1,3,4,6,12],"description":"SUBSCRIBE, CHANGE"},"branch_ids":{"maxItems":100,"description":"SUBSCRIBE, ADD_BRANCHES","type":"array","items":{"type":"string","format":"uuid"}},"branches":{"type":"number","minimum":1,"maximum":1000,"description":"SUBSCRIBE: branches to pay for when more than `branch_ids`."}},"required":["action"],"title":"QuoteDto"},"SubscribeDto":{"type":"object","properties":{"plan_id":{"type":"string","maxLength":100,"description":"Plan id"},"period_months":{"type":"number","enum":[1,3,4,6,12]},"branch_ids":{"maxItems":100,"description":"Branches to put on the subscription.","type":"array","items":{"type":"string","format":"uuid"}},"branches":{"type":"number","minimum":1,"maximum":1000,"description":"Branches to pay for, when more than `branch_ids` (the plan minimum is applied anyway)."}},"required":["plan_id","period_months","branch_ids"],"title":"SubscribeDto"},"AddBranchesDto":{"type":"object","properties":{"branch_ids":{"minItems":1,"maxItems":100,"description":"Branches of this restaurant not yet covered.","type":"array","items":{"type":"string","format":"uuid"}}},"required":["branch_ids"],"title":"AddBranchesDto"},"BranchRenewalDto":{"type":"object","properties":{"renewing":{"type":"boolean","description":"false: stop renewing this branch (it runs to its paid date)."}},"required":["renewing"],"title":"BranchRenewalDto"},"ChangeSubscriptionDto":{"type":"object","properties":{"plan_id":{"type":"string","maxLength":100,"description":"New plan id"},"period_months":{"type":"number","enum":[1,3,4,6,12],"description":"New period (from the next renewal)"}},"title":"ChangeSubscriptionDto"},"UpdateMySubscriptionDto":{"type":"object","properties":{"auto_renew":{"type":"boolean"}},"title":"UpdateMySubscriptionDto"},"PayWithSavedCardDto":{"type":"object","properties":{"payment_method_id":{"type":"string","format":"uuid","description":"Defaults to the default card."}},"title":"PayWithSavedCardDto"},"CardSessionDto":{"type":"object","properties":{"language":{"enum":["ar","en"],"type":"string"}},"title":"CardSessionDto"},"CardVerificationUsageDto":{"type":"object","properties":{"used_today":{"type":"number","example":1},"limit_per_day":{"type":"number","example":3},"used_this_month":{"type":"number","example":2,"description":"Rolling 30 days."},"limit_per_month":{"type":"number","example":5},"next_allowed_at":{"format":"date-time","type":"string","nullable":true,"description":"Null when a card can be added now."}},"required":["used_today","limit_per_day","used_this_month","limit_per_month","next_allowed_at"],"title":"CardVerificationUsageDto"},"UpdateRequestDto":{"type":"object","properties":{"notes":{"type":"string","maxLength":5000},"contacted":{"type":"boolean","description":"Mark as contacted (true) or not yet (false)."},"cancelled":{"type":"boolean","description":"Cancel an unpaid request."}},"title":"UpdateRequestDto"},"FulfillRequestDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid","description":"Restaurant data entry created for this request."},"branch_ids":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["restaurant_id"],"title":"FulfillRequestDto"},"ReviewNoteDto":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}},"title":"ReviewNoteDto"},"RejectTransferDto":{"type":"object","properties":{"note":{"type":"string","maxLength":2000,"description":"Shown to the customer."}},"required":["note"],"title":"RejectTransferDto"},"CreateRenewalFollowUpDto":{"type":"object","properties":{"channel":{"enum":["PHONE","WHATSAPP","SMS","EMAIL","IN_PERSON","OTHER"],"type":"string"},"outcome":{"enum":["NO_ANSWER","CALL_BACK","WILL_RENEW","PAID","WANTS_CHANGE","WILL_CANCEL","WRONG_CONTACT","OTHER"],"type":"string"},"note":{"type":"string","maxLength":2000},"next_follow_up_at":{"type":"string","description":"When to try again (ISO date-time)."}},"required":["channel","outcome"],"title":"CreateRenewalFollowUpDto"},"VoidInvoiceDto":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}},"required":["reason"],"title":"VoidInvoiceDto"},"ActivateSubscriptionDto":{"type":"object","properties":{"plan_id":{"type":"string","maxLength":100,"description":"Plan id (any plan, public or not)"},"period_months":{"type":"number","enum":[1,3,4,6,12],"description":"One of the periods the plan offers."},"branch_ids":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid"}},"branches":{"type":"number","minimum":1,"maximum":1000,"description":"Paid branches; default: the branches given (or the plan minimum)."},"starts_at":{"type":"string","description":"Defaults to now."},"period_end":{"type":"string","description":"Defaults to one period after the start."},"auto_renew":{"type":"boolean","default":false,"description":"Staff activations default to manual renewal."}},"required":["plan_id","period_months","branch_ids"],"title":"ActivateSubscriptionDto"},"AdminUpdateSubscriptionDto":{"type":"object","properties":{"period_end":{"type":"string","description":"Move the paid-through date (extension / correction)."},"auto_renew":{"type":"boolean"}},"title":"AdminUpdateSubscriptionDto"},"AdminCancelSubscriptionDto":{"type":"object","properties":{"immediately":{"type":"boolean","description":"true: end access now. false (default): cancel at period end."}},"title":"AdminCancelSubscriptionDto"},"BankAccountDto":{"type":"object","properties":{"bank_name":{"type":"string","maxLength":120},"account_name":{"type":"string","maxLength":200},"iban":{"type":"string","maxLength":34},"account_number":{"type":"string","maxLength":40}},"required":["bank_name","account_name","iban"],"title":"BankAccountDto"},"FxRateOverrideDto":{"type":"object","properties":{"from":{"type":"string","pattern":"^[A-Z]{3}$","example":"EGP","description":"Price (display) currency."},"to":{"type":"string","pattern":"^[A-Z]{3}$","example":"USD","description":"Charge currency."},"rate":{"type":"number","minimum":1e-8,"example":0.0202,"description":"Units of `to` per unit of `from` (> 0)."}},"required":["from","to","rate"],"title":"FxRateOverrideDto"},"BillingSettingsDto":{"type":"object","properties":{"grace_days":{"type":"number","minimum":0,"maximum":90},"retry_schedule_hours":{"maxItems":20,"description":"Renewal retries, in hours after the period end (e.g. [0, 24, 72, 120]).","type":"array","items":{"type":"number","maximum":2160,"minimum":0}},"renewal_invoice_lead_days":{"type":"number","minimum":0,"maximum":60},"bank_accounts":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/BankAccountDto"}},"alert_phones":{"maxItems":20,"description":"Staff phones alerted on paid sign-ups and receipts.","type":"array","items":{"type":"string"}},"customer_notices_enabled":{"type":"boolean","description":"Send text messages (renewal due, payment failed, ended…) to restaurants and sign-ups."},"checkout_mode":{"enum":["EMBEDDED","HOSTED"],"type":"string","description":"EMBEDDED renders the card form inside our pages (subscriptions and every e-menu). HOSTED sends customers to the MyFatoorah page — the fallback if the in-page form misbehaves."},"fx_rates":{"maxItems":50,"description":"Exchange rates that override the built-in table when an invoice converts its price into the charge currency (e.g. EGP → USD). Replaces the whole list.","type":"array","items":{"$ref":"#/components/schemas/FxRateOverrideDto"}}},"title":"BillingSettingsDto"},"ChangeRestaurantCountryDto":{"type":"object","properties":{"country":{"type":"string","pattern":"^[A-Z]{2}$","example":"EG","description":"An existing country code (enabled or not)."},"note":{"type":"string","maxLength":500,"description":"Why (kept in the server log)."}},"required":["country"],"title":"ChangeRestaurantCountryDto"},"RestaurantCountrySubscriptionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"ACTIVE"},"gateway":{"enum":["MYFATOORAH","MOYASAR"],"type":"string"},"auto_renew":{"type":"boolean","description":"Unchanged. With no card, the next renewal is a pay link."},"default_payment_method_id":{"type":"string","nullable":true,"format":"uuid"}},"required":["id","status","gateway","auto_renew","default_payment_method_id"],"title":"RestaurantCountrySubscriptionDto"},"RestaurantCountryChangeResponseDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"previous_country":{"type":"string","example":"SA"},"country":{"type":"string","example":"EG"},"gateway":{"enum":["MYFATOORAH","MOYASAR"],"type":"string","description":"Gateway of the new country."},"disconnected_card_ids":{"description":"Saved cards removed (they belong to the old gateway).","type":"array","items":{"type":"string"}},"subscription":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/RestaurantCountrySubscriptionDto"}]}},"required":["restaurant_id","previous_country","country","gateway","disconnected_card_ids","subscription"],"title":"RestaurantCountryChangeResponseDto"},"PublicCountryResponseDto":{"type":"object","properties":{"code":{"type":"string","example":"EG","description":"ISO 3166-1 alpha-2."},"name_ar":{"type":"string","example":"مصر"},"name_en":{"type":"string","example":"Egypt"},"path":{"type":"string","example":"/eg","description":"Landing path. SA is \"/\"."},"display_currency":{"type":"string","example":"EGP","description":"Currency plan prices are shown in."},"charge_currency":{"type":"string","example":"USD","description":"Currency the card is charged in. When it differs from `display_currency` the invoice shows the converted `charge` amount next to the price."},"gateway":{"enum":["MYFATOORAH","MOYASAR"],"type":"string","example":"MOYASAR"},"dial_code":{"type":"string","example":"20","description":"Dialling code without \"+\"."},"contact_whatsapp":{"type":"string","nullable":true,"example":"+201001234567"},"contact_phone":{"type":"string","nullable":true,"example":"+201001234567"},"invoice_tax_rate":{"type":"number","example":0,"description":"Tax rate on twlm's invoices, a fraction (0.15 = 15%)."},"seo_locale":{"type":"string","example":"ar-EG","description":"hreflang / og:locale for the landing."},"sort_order":{"type":"number","example":10},"fx_rate":{"type":"string","example":"0.02026667","description":"Public list only, and only when `display_currency` ≠ `charge_currency`: the current rate (units of charge currency per unit of display currency) invoices would snapshot now. For \"≈ X USD will be charged\" next to listed prices; the invoice is authoritative."}},"required":["code","name_ar","name_en","path","display_currency","charge_currency","gateway","dial_code","contact_whatsapp","contact_phone","invoice_tax_rate","seo_locale","sort_order"],"title":"PublicCountryResponseDto"},"AppScreenshotResponseDto":{"type":"object","properties":{"url":{"type":"string","example":"/apps-media/customer-pager/display.webp"},"caption_ar":{"type":"string","nullable":true},"caption_en":{"type":"string","nullable":true}},"required":["url","caption_ar","caption_en"],"title":"AppScreenshotResponseDto"},"AppPriceResponseDto":{"type":"object","properties":{"currency":{"type":"string","example":"SAR"},"monthly_price":{"type":"string","nullable":true,"example":"49.00","description":"Per branch per month; null when not sold monthly."},"yearly_price":{"type":"string","nullable":true,"example":"490.00","description":"Per branch for 12 months; null when not sold yearly."}},"required":["currency","monthly_price","yearly_price"],"title":"AppPriceResponseDto"},"AppBranchResponseDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"active_until":{"type":"string","nullable":true,"format":"date-time","description":"The branch has the app until then; in the past = ended; null = never had it."},"trial_available":{"type":"boolean","description":"The branch can still start the free trial."}},"required":["branch_id","name","name_ar","active_until","trial_available"],"title":"AppBranchResponseDto"},"AppListingResponseDto":{"type":"object","properties":{"app_key":{"type":"string","example":"CUSTOMER_PAGER"},"name_ar":{"type":"string"},"name_en":{"type":"string"},"summary_ar":{"type":"string","nullable":true},"summary_en":{"type":"string","nullable":true},"description_ar":{"type":"string","nullable":true},"description_en":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true,"description":"An https URL, or a path on the dashboard (`/apps-media/...`)."},"screenshots":{"description":"The app page's gallery, in order.","type":"array","items":{"$ref":"#/components/schemas/AppScreenshotResponseDto"}},"trial_days":{"type":"number","description":"Length of the free trial; 0 = none."},"price":{"nullable":true,"description":"Null when the app is not sold here yet.","type":"object","allOf":[{"$ref":"#/components/schemas/AppPriceResponseDto"}]},"branches":{"description":"The restaurant's active branches.","type":"array","items":{"$ref":"#/components/schemas/AppBranchResponseDto"}}},"required":["app_key","name_ar","name_en","summary_ar","summary_en","description_ar","description_en","icon_url","screenshots","trial_days","price","branches"],"title":"AppListingResponseDto"},"StartAppTrialDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid","description":"The branch to start the trial on."}},"required":["branch_id"],"title":"StartAppTrialDto"},"AppInstallationResponseDto":{"type":"object","properties":{"app_key":{"type":"string","example":"CUSTOMER_PAGER"},"branch_id":{"type":"string","format":"uuid"},"active_until":{"type":"string","format":"date-time","description":"The branch has the app until then."},"trial_started_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["app_key","branch_id","active_until","trial_started_at"],"title":"AppInstallationResponseDto"},"PurchaseAppDto":{"type":"object","properties":{"branch_ids":{"minItems":1,"maxItems":200,"description":"Branches to buy the app for.","type":"array","items":{"type":"string","format":"uuid"}},"period":{"enum":["MONTHLY","YEARLY"],"type":"string"}},"required":["branch_ids","period"],"title":"PurchaseAppDto"},"AppPurchaseResponseDto":{"type":"object","properties":{"invoice_id":{"type":"string","format":"uuid","description":"Pay it with the billing invoice checkout."},"number":{"type":"string"},"amount":{"type":"string","example":"98.00"},"currency":{"type":"string","example":"SAR"},"status":{"type":"string","example":"OPEN"}},"required":["invoice_id","number","amount","currency","status"],"title":"AppPurchaseResponseDto"},"AppScreenshotDto":{"type":"object","properties":{"url":{"type":"string","example":"https://cdn.example.com/app/screen-1.jpg"},"caption_ar":{"type":"string","nullable":true,"maxLength":160},"caption_en":{"type":"string","nullable":true,"maxLength":160}},"required":["url"],"title":"AppScreenshotDto"},"UpdateAppListingDto":{"type":"object","properties":{"name_ar":{"type":"string","maxLength":120},"name_en":{"type":"string","maxLength":120},"summary_ar":{"type":"string","nullable":true,"maxLength":300},"summary_en":{"type":"string","nullable":true,"maxLength":300},"description_ar":{"type":"string","nullable":true,"maxLength":5000,"description":"Markdown."},"description_en":{"type":"string","nullable":true,"maxLength":5000,"description":"Markdown."},"icon_url":{"type":"string","nullable":true,"description":"An https URL, or a path the dashboard ships (`/apps-media/...`)."},"screenshots":{"maxItems":8,"description":"Replaces the whole gallery; [] clears it.","type":"array","items":{"$ref":"#/components/schemas/AppScreenshotDto"}},"status":{"enum":["DRAFT","PUBLISHED"],"type":"string"},"trial_days":{"type":"number","minimum":0,"maximum":90,"description":"0 = no trial."},"sort_order":{"type":"number","minimum":0,"maximum":10000}},"title":"UpdateAppListingDto"},"SetAppPriceDto":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"SAR"},"monthly_price":{"type":"string","nullable":true,"example":"49.00","description":"null = not sold monthly"},"yearly_price":{"type":"string","nullable":true,"example":"490.00","description":"null = not sold yearly"}},"required":["currency","monthly_price","yearly_price"],"title":"SetAppPriceDto"},"GrantAppDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"branch_ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid"}},"days":{"type":"number","minimum":1,"maximum":3660,"description":"Added to the current end (or to now). Send this or `until`."},"until":{"type":"string","format":"date-time","description":"The exact new end, replacing what each branch has (may shorten it). Must be in the future; to end access now use the revoke route. Send this or `days`."}},"required":["restaurant_id","branch_ids"],"title":"GrantAppDto"},"RevokeAppDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"branch_ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["restaurant_id","branch_ids"],"title":"RevokeAppDto"},"PagerMonitorItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sequence":{"type":"string","example":"1042","description":"Server order of issue (bigint as string)."},"kind":{"enum":["order","standalone"],"type":"string"},"number":{"type":"number","example":7,"description":"The pager's number for the branch's business day."},"order_number":{"type":"string","nullable":true,"example":"#12"},"note":{"type":"string","nullable":true,"example":"Blue shirt"},"state":{"enum":["waiting","preparing","ready"],"type":"string"},"order_status":{"nullable":true,"enum":["PENDING","ACCEPTED","PREPARING","READY","COMPLETED","CANCELLED","VOIDED","REJECTED"],"type":"string"},"call_count":{"type":"number","example":1},"last_called_at":{"type":"string","nullable":true,"format":"date-time"},"callable_at":{"type":"string","nullable":true,"format":"date-time","description":"When \"call again\" is next accepted; null while it already is."},"tracking_url":{"type":"string","example":"https://v2.twlm.solutions/o/0bR2x…"},"created_at":{"type":"string","format":"date-time"},"version":{"type":"number","example":1762862400000}},"required":["id","sequence","kind","number","order_number","note","state","order_status","call_count","last_called_at","callable_at","tracking_url","created_at","version"],"title":"PagerMonitorItemResponseDto"},"PagerMonitorSnapshotResponseDto":{"type":"object","properties":{"display_id":{"type":"string","format":"uuid"},"display_name":{"type":"string","example":"Kitchen pass"},"branch_id":{"type":"string","format":"uuid"},"service_active":{"type":"boolean","description":"False when the app lapsed: show the \"service inactive\" screen."},"server_time":{"type":"string","format":"date-time"},"branding":{"$ref":"#/components/schemas/PagerBrandingResponseDto"},"pagers":{"description":"Open pagers, oldest first.","type":"array","items":{"$ref":"#/components/schemas/PagerMonitorItemResponseDto"}}},"required":["display_id","display_name","branch_id","service_active","server_time","branding","pagers"],"title":"PagerMonitorSnapshotResponseDto"},"CreatePagerDto":{"type":"object","properties":{"note":{"type":"string","maxLength":120,"example":"Blue shirt, two coffees","description":"For staff only; the customer never sees it."}},"title":"CreatePagerDto"},"PaymentMethodResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Cash"},"name_ar":{"type":"string","nullable":true,"example":"نقد"},"type":{"enum":["CASH","CARD","DIGITAL_WALLET","ONLINE","OTHER"],"type":"string","example":"CASH"},"code":{"type":"string","nullable":true,"example":"CASH_01"},"auto_open_drawer":{"type":"boolean","example":true},"is_active":{"type":"boolean","example":true},"index":{"type":"number","example":0},"is_deletable":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","type","code","auto_open_drawer","is_active","index","is_deletable","created_at","updated_at"],"title":"PaymentMethodResponseDto"},"CreatePaymentMethodDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Cash"},"name_ar":{"type":"string","maxLength":100,"example":"نقد"},"type":{"enum":["CASH","CARD","DIGITAL_WALLET","ONLINE","OTHER"],"type":"string","example":"CASH"},"code":{"type":"string","maxLength":50,"example":"CASH_01"},"auto_open_drawer":{"type":"boolean","example":true,"default":false},"is_active":{"type":"boolean","example":true,"default":true},"index":{"type":"number","minimum":0,"example":0,"default":0}},"required":["name","type"],"title":"CreatePaymentMethodDto"},"UpdatePaymentMethodDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Cash"},"name_ar":{"type":"string","maxLength":100,"example":"نقد"},"type":{"enum":["CASH","CARD","DIGITAL_WALLET","ONLINE","OTHER"],"type":"string","example":"CASH"},"code":{"type":"string","maxLength":50,"example":"CASH_01"},"auto_open_drawer":{"type":"boolean","example":true,"default":false},"is_active":{"type":"boolean","example":true,"default":true},"index":{"type":"number","minimum":0,"example":0,"default":0}},"title":"UpdatePaymentMethodDto"},"CreateGiftCardItemDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","description":"Product ID"},"quantity":{"type":"number","minimum":1,"example":2,"description":"Number of free units for this product. Required unless unlimited is true."},"unlimited":{"type":"boolean","default":false,"description":"When true the product is free on every order; quantity is ignored."}},"required":["product_id"],"title":"CreateGiftCardItemDto"},"CreateGiftCardDto":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","description":"Customer to receive the gift card"},"type":{"enum":["BALANCE","ITEMS"],"type":"string","description":"BALANCE for a cash-value card, ITEMS for a product-quantity card"},"cash_in_card":{"type":"number","minimum":0.01,"example":100,"description":"Initial balance (required for BALANCE type)"},"items":{"minItems":1,"description":"Products and quantities (required for ITEMS type)","type":"array","items":{"$ref":"#/components/schemas/CreateGiftCardItemDto"}},"message":{"type":"string","example":"Happy Birthday!"},"sender_name":{"type":"string","example":"Mohammed Al-Rashid"},"sender_message":{"type":"string","example":"Enjoy your meal!"},"expiry_date":{"type":"string","example":"2026-12-31T23:59:59.000Z"},"theme_id":{"type":"string","format":"uuid","description":"Voucher theme from GET gift-card-themes; omit for the default palette."}},"required":["customer_id","type"],"title":"CreateGiftCardDto"},"GiftCardCustomerResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true,"example":"Ahmed Al-Rashid"},"phone":{"type":"string","example":"+966501234567"}},"required":["id","name","phone"],"title":"GiftCardCustomerResponseDto"},"GiftCardItemResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"initial_quantity":{"type":"number","nullable":true,"example":2,"description":"null when unlimited"},"remaining_quantity":{"type":"number","nullable":true,"example":1,"description":"null when unlimited"}},"required":["id","product_id","initial_quantity","remaining_quantity"],"title":"GiftCardItemResponseDto"},"GiftCardTransactionResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"transaction_type":{"type":"string","example":"redeemed"},"amount":{"type":"string","example":"50.00"},"balance_before":{"type":"string","example":"100.00"},"balance_after":{"type":"string","example":"50.00"},"description":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","example":"SAR"},"created_at":{"format":"date-time","type":"string"}},"required":["id","transaction_type","amount","balance_before","balance_after","description","order_id","currency","created_at"],"title":"GiftCardTransactionResponseDto"},"GiftCardResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"gift_card_id":{"type":"string","example":"GC1A2B3","description":"7-character unique card code"},"restaurant_id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"customer":{"$ref":"#/components/schemas/GiftCardCustomerResponseDto"},"type":{"enum":["BALANCE","ITEMS"],"type":"string"},"cash_in_card":{"type":"string","nullable":true,"example":"100.00"},"remaining_balance":{"type":"string","nullable":true,"example":"75.00"},"cash_used":{"type":"string","example":"25.00"},"currency":{"type":"string","example":"SAR"},"message":{"type":"string","nullable":true},"sender_name":{"type":"string","nullable":true},"sender_message":{"type":"string","nullable":true},"theme_id":{"type":"string","nullable":true,"format":"uuid"},"background_color":{"type":"string","nullable":true,"example":"#1F2937","description":"From the card’s theme; null means the default palette."},"text_color":{"type":"string","nullable":true,"example":"#FFFFFF"},"status":{"enum":["ACTIVE","USED","EXPIRED","CANCELLED"],"type":"string"},"expiry_date":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardItemResponseDto"}},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardTransactionResponseDto"}}},"required":["id","gift_card_id","restaurant_id","customer_id","customer","type","cash_in_card","remaining_balance","cash_used","currency","message","sender_name","sender_message","theme_id","background_color","text_color","status","expiry_date","created_at","updated_at"],"title":"GiftCardResponseDto"},"GiftCardThemeResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Ramadan"},"background_color":{"type":"string","example":"#1F2937"},"text_color":{"type":"string","example":"#FFFFFF"},"cards_count":{"type":"number","example":12,"description":"Cards issued with this theme."},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","name","background_color","text_color","cards_count","created_at","updated_at"],"title":"GiftCardThemeResponseDto"},"CreateGiftCardThemeDto":{"type":"object","properties":{"name":{"type":"string","maxLength":60,"example":"Ramadan"},"background_color":{"type":"string","example":"#1F2937"},"text_color":{"type":"string","example":"#FFFFFF"}},"required":["name","background_color","text_color"],"title":"CreateGiftCardThemeDto"},"UpdateGiftCardThemeDto":{"type":"object","properties":{"name":{"type":"string","maxLength":60,"example":"Ramadan"},"background_color":{"type":"string","example":"#1F2937"},"text_color":{"type":"string","example":"#FFFFFF"}},"title":"UpdateGiftCardThemeDto"},"PublicGiftCardRestaurantResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Twlm Cafe"},"name_ar":{"type":"string","nullable":true},"logo_url":{"type":"string","nullable":true}},"required":["id","name","name_ar","logo_url"],"title":"PublicGiftCardRestaurantResponseDto"},"PublicGiftCardItemResponseDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Latte"},"name_ar":{"type":"string","nullable":true,"example":"لاتيه"},"image_url":{"type":"string","nullable":true},"initial_quantity":{"type":"number","nullable":true,"example":2,"description":"null when unlimited"},"remaining_quantity":{"type":"number","nullable":true,"example":1,"description":"null when unlimited"}},"required":["product_id","name","name_ar","image_url","initial_quantity","remaining_quantity"],"title":"PublicGiftCardItemResponseDto"},"PublicGiftCardResponseDto":{"type":"object","properties":{"gift_card_id":{"type":"string","example":"GC1A2B3","description":"7-character unique card code"},"type":{"enum":["BALANCE","ITEMS"],"type":"string"},"status":{"enum":["ACTIVE","USED","EXPIRED","CANCELLED"],"type":"string"},"cash_in_card":{"type":"string","nullable":true,"example":"100.00"},"remaining_balance":{"type":"string","nullable":true,"example":"75.00"},"currency":{"type":"string","example":"SAR"},"recipient_name":{"type":"string","nullable":true,"example":"Ahmed"},"message":{"type":"string","nullable":true},"sender_name":{"type":"string","nullable":true},"sender_message":{"type":"string","nullable":true},"background_color":{"type":"string","nullable":true,"example":"#1F2937"},"text_color":{"type":"string","nullable":true,"example":"#FFFFFF"},"expiry_date":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"format":"date-time","type":"string"},"restaurant":{"$ref":"#/components/schemas/PublicGiftCardRestaurantResponseDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicGiftCardItemResponseDto"}}},"required":["gift_card_id","type","status","cash_in_card","remaining_balance","currency","recipient_name","message","sender_name","sender_message","background_color","text_color","expiry_date","created_at","restaurant","items"],"title":"PublicGiftCardResponseDto"},"GiftCardGoogleWalletLinkDto":{"type":"object","properties":{"add_to_wallet_link":{"type":"string","nullable":true,"description":"Google \"Save to Wallet\" URL. Null only in development when Google Wallet is not configured.","example":"https://pay.google.com/gp/v/save/eyJhbGciOi..."}},"required":["add_to_wallet_link"],"title":"GiftCardGoogleWalletLinkDto"},"StorageConfigDto":{"type":"object","properties":{"provider":{"nullable":true,"enum":["r2","s3"],"type":"string"},"endpoint":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"access_key_id":{"type":"string","nullable":true},"secret_access_key":{"type":"string","nullable":true},"bucket":{"type":"string","nullable":true},"public_base_url":{"type":"string","nullable":true}},"required":["provider","endpoint","region","access_key_id","secret_access_key","bucket","public_base_url"],"title":"StorageConfigDto"},"PaymentProvidersValueDto":{"type":"object","properties":{"hyperpay":{"type":"object","additionalProperties":{},"nullable":true},"tamara":{"type":"object","additionalProperties":{},"nullable":true},"paymob":{"type":"object","additionalProperties":{},"nullable":true},"myfatoorah":{"type":"object","additionalProperties":{},"nullable":true},"afs_pay":{"type":"object","additionalProperties":{},"nullable":true},"neoleap":{"type":"object","additionalProperties":{},"nullable":true},"moyasar":{"type":"object","additionalProperties":{},"nullable":true,"description":"Moyasar (platform billing for non-SA countries)."}},"required":["hyperpay","tamara","paymob","myfatoorah","afs_pay","neoleap","moyasar"],"title":"PaymentProvidersValueDto"},"FirebaseServiceAccountValueDto":{"type":"object","properties":{"type":{"type":"string","nullable":true},"project_id":{"type":"string","nullable":true},"private_key_id":{"type":"string","nullable":true},"private_key":{"type":"string","nullable":true},"client_email":{"type":"string","nullable":true},"client_id":{"type":"string","nullable":true},"auth_uri":{"type":"string","nullable":true},"token_uri":{"type":"string","nullable":true},"auth_provider_x509_cert_url":{"type":"string","nullable":true},"client_x509_cert_url":{"type":"string","nullable":true},"universe_domain":{"type":"string","nullable":true}},"required":["type","project_id","private_key_id","private_key","client_email","client_id","auth_uri","token_uri","auth_provider_x509_cert_url","client_x509_cert_url","universe_domain"],"title":"FirebaseServiceAccountValueDto"},"GooglePlacesValueDto":{"type":"object","properties":{"api_key":{"type":"string","nullable":true}},"required":["api_key"],"title":"GooglePlacesValueDto"},"StorageConfigSettingResponse":{"type":"object","properties":{"feature_key":{"type":"string","enum":["storage.config"]},"value":{"$ref":"#/components/schemas/StorageConfigDto"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"updated_by":{"type":"string","nullable":true,"format":"uuid"}},"required":["feature_key","value","updated_at","updated_by"],"title":"StorageConfigSettingResponse"},"PaymentProvidersSettingResponse":{"type":"object","properties":{"feature_key":{"type":"string","enum":["payment.providers"]},"value":{"$ref":"#/components/schemas/PaymentProvidersValueDto"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"updated_by":{"type":"string","nullable":true,"format":"uuid"}},"required":["feature_key","value","updated_at","updated_by"],"title":"PaymentProvidersSettingResponse"},"FirebaseServiceAccountSettingResponse":{"type":"object","properties":{"feature_key":{"type":"string","enum":["firebase.serviceAccount"]},"value":{"$ref":"#/components/schemas/FirebaseServiceAccountValueDto"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"updated_by":{"type":"string","nullable":true,"format":"uuid"}},"required":["feature_key","value","updated_at","updated_by"],"title":"FirebaseServiceAccountSettingResponse"},"GooglePlacesSettingResponse":{"type":"object","properties":{"feature_key":{"type":"string","enum":["google.places"]},"value":{"$ref":"#/components/schemas/GooglePlacesValueDto"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"updated_by":{"type":"string","nullable":true,"format":"uuid"}},"required":["feature_key","value","updated_at","updated_by"],"title":"GooglePlacesSettingResponse"},"BroadcastStaffPushResult":{"type":"object","properties":{"total_tokens":{"type":"number","example":1240,"description":"Distinct staff device tokens targeted"},"success_count":{"type":"number","example":1198,"description":"Tokens FCM accepted for delivery"},"failure_count":{"type":"number","example":42,"description":"Tokens FCM rejected"},"stale_detected":{"type":"number","example":42,"description":"Tokens FCM reported as unregistered or invalid. Reported for visibility only — these rows are NOT deleted; broadcasting never mutates staff_fcm_tokens."},"batches":{"type":"number","example":3,"description":"FCM multicast calls issued (500 tokens per call)"},"message_id":{"type":"string","description":"Message ID of the first accepted send"}},"required":["total_tokens","success_count","failure_count","stale_detected","batches"],"title":"BroadcastStaffPushResult"},"CreateSuperAdminDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"email":{"type":"string","maxLength":255,"format":"email"},"phone":{"type":"string","maxLength":30,"pattern":"^\\+?[0-9]{6,20}$"},"password":{"type":"string","minLength":8,"maxLength":128}},"required":["name","email","password"],"title":"CreateSuperAdminDto"},"UpdateSuperAdminDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"email":{"type":"string","maxLength":255,"format":"email"},"phone":{"type":"string","maxLength":30,"pattern":"^\\+?[0-9]{6,20}$"},"is_active":{"type":"boolean"}},"title":"UpdateSuperAdminDto"},"ChangeSuperAdminPasswordDto":{"type":"object","properties":{"password":{"type":"string","minLength":8,"maxLength":128}},"required":["password"],"title":"ChangeSuperAdminPasswordDto"},"UpsertPlatformSettingDto":{"type":"object","properties":{"value":{"type":"object"}},"required":["value"],"title":"UpsertPlatformSettingDto"},"BroadcastStaffPush":{"type":"object","properties":{"title":{"type":"string","maxLength":120,"example":"Scheduled maintenance"},"body":{"type":"string","maxLength":1000,"example":"The POS will be offline tonight from 02:00 to 03:00 (KSA time)."},"data":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional key/value payload delivered alongside the notification. Values are stringified by FCM; keep it small (FCM caps the whole message at 4 KB).","example":{"type":"maintenance","deep_link":"twlm://announcements"}}},"required":["title","body"],"title":"BroadcastStaffPush"},"PermissionCatalogResponseDto":{"type":"object","properties":{"permissions":{"example":["read:restaurants:platform","manage:subscription_plans:platform"],"description":"Every `*:platform` permission that can be granted to a platform admin.","type":"array","items":{"type":"string"}}},"required":["permissions"],"title":"PermissionCatalogResponseDto"},"PlatformAdminResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Platform Operator"},"name_ar":{"type":"string","nullable":true,"example":"مشغل المنصة"},"email":{"type":"string","example":"op@twlm.io"},"phone":{"type":"string","nullable":true,"example":"+966500000000"},"global_role":{"enum":["SUPER_ADMIN","PLATFORM_ADMIN","STAFF"],"type":"string","example":"PLATFORM_ADMIN"},"permissions":{"example":["read:restaurants:platform","manage:subscription_plans:platform"],"description":"Granted `*:platform` permissions.","type":"array","items":{"type":"string"}},"permissions_version":{"type":"number","example":0,"description":"Bumped on password/permission change to invalidate already-issued tokens."},"is_active":{"type":"boolean","example":true},"last_login_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","name_ar","email","phone","global_role","permissions","permissions_version","is_active","last_login_at","created_at","updated_at"],"title":"PlatformAdminResponseDto"},"PlatformAdminListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformAdminResponseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"PlatformAdminListResponseDto"},"CreatePlatformAdminDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"email":{"type":"string","maxLength":255,"format":"email"},"phone":{"type":"string","maxLength":30,"pattern":"^\\+?[0-9]{6,20}$"},"password":{"type":"string","minLength":8,"maxLength":128},"permissions":{"uniqueItems":true,"type":"array","items":{"type":"string"}}},"required":["name","email","password"],"title":"CreatePlatformAdminDto"},"UpdatePlatformAdminDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"email":{"type":"string","maxLength":255,"format":"email"},"phone":{"type":"string","maxLength":30,"pattern":"^\\+?[0-9]{6,20}$"},"is_active":{"type":"boolean"}},"title":"UpdatePlatformAdminDto"},"ReplacePlatformAdminPermissionsDto":{"type":"object","properties":{"permissions":{"uniqueItems":true,"type":"array","items":{"type":"string"}}},"required":["permissions"],"title":"ReplacePlatformAdminPermissionsDto"},"ChangePlatformAdminPasswordDto":{"type":"object","properties":{"password":{"type":"string","minLength":8,"maxLength":128}},"required":["password"],"title":"ChangePlatformAdminPasswordDto"},"UpdateMembershipPermissionsDto":{"type":"object","properties":{"permissions":{"type":"array","items":{"type":"string"}}},"required":["permissions"],"title":"UpdateMembershipPermissionsDto"},"OrderingChannelKind":{"type":"string","enum":["CASHIER","DELIVERY_APP","OTHER"],"title":"OrderingChannelKind"},"ChannelResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"kind":{"allOf":[{"$ref":"#/components/schemas/OrderingChannelKind"}]},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","kind","is_active","created_at","updated_at"],"title":"ChannelResponseDto"},"CreateChannelDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Talabat"},"name_ar":{"type":"string","minLength":1,"example":"طلبات"},"kind":{"enum":["CASHIER","DELIVERY_APP","OTHER"],"type":"string","description":"What the channel is, for grouping in reports: the restaurant’s own cashier, a delivery app, or neither. Defaults to OTHER."}},"required":["name"],"title":"CreateChannelDto"},"UpdateChannelDto":{"type":"object","properties":{"name":{"type":"string","minLength":1},"name_ar":{"type":"string","minLength":1},"kind":{"enum":["CASHIER","DELIVERY_APP","OTHER"],"type":"string","description":"What the channel is, for grouping in reports: the restaurant’s own cashier, a delivery app, or neither. Defaults to OTHER."},"is_active":{"type":"boolean"}},"title":"UpdateChannelDto"},"ChannelBranchResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","channel_id","branch_id","is_active","created_at","updated_at"],"title":"ChannelBranchResponseDto"},"ChannelCommissionResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","format":"uuid"},"channel_name":{"type":"string"},"commission_type":{"type":"string"},"commission_value":{"type":"number"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","channel_id","channel_name","commission_type","commission_value","is_active","created_at","updated_at"],"title":"ChannelCommissionResponseDto"},"UpsertChannelCommissionDto":{"type":"object","properties":{"channel_id":{"type":"string","format":"uuid"},"commission_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"commission_value":{"type":"number","minimum":0},"is_active":{"type":"boolean","default":true}},"required":["channel_id","commission_type","commission_value"],"title":"UpsertChannelCommissionDto"},"FoodZoneStoreDto":{"type":"object","properties":{"store_id":{"type":"string","description":"Foodizone branch id — the webhook's `store_id`. Send it as `store_id` when mapping a branch.","example":"6accb00a6b786d0b2c9c9ae2"},"name_en":{"type":"string","nullable":true},"name_ar":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"enabled":{"type":"boolean","description":"Whether the branch is enabled on Foodizone."}},"required":["store_id","name_en","name_ar","address","enabled"],"title":"FoodZoneStoreDto"},"FoodZoneProviderDto":{"type":"object","properties":{"provider":{"type":"string","description":"As Foodizone names it — the webhook's `provider_name`.","example":"Jahez"},"connected_branches":{"type":"number","description":"How many of the brand's Foodizone branches have it connected."}},"required":["provider","connected_branches"],"title":"FoodZoneProviderDto"},"FoodZoneMenuSyncCountsDto":{"type":"object","properties":{"categories":{"type":"number"},"sizes":{"type":"number"},"modifier_categories":{"type":"number"},"modifiers":{"type":"number"},"menu_items":{"type":"number"},"provider_prices":{"type":"number","description":"Delivery-app prices sent: one per item and app that has a channel price."}},"required":["categories","sizes","modifier_categories","modifiers","menu_items","provider_prices"],"title":"FoodZoneMenuSyncCountsDto"},"FoodZoneMenuSyncDto":{"type":"object","properties":{"id":{"type":"string"},"trigger":{"enum":["CATALOG_CHANGED","MANUAL"],"type":"string"},"status":{"enum":["RUNNING","SUCCEEDED","FAILED"],"type":"string"},"attempt":{"type":"number","description":"1 for the first try, 2+ for automatic retries."},"counts":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/FoodZoneMenuSyncCountsDto"}]},"skipped_count":{"type":"number"},"error_code":{"nullable":true,"enum":["MENU_REJECTED","TOKEN_REJECTED","UNAVAILABLE","INTERNAL"],"type":"string","description":"Why it failed; translate it for the merchant. Null unless FAILED."},"error":{"type":"string","nullable":true,"description":"Technical detail for support (for a rejected menu, every failing field). Show it as-is, never as the message."},"started_at":{"format":"date-time","type":"string"},"finished_at":{"format":"date-time","type":"string","nullable":true}},"required":["id","trigger","status","attempt","counts","skipped_count","error_code","error","started_at","finished_at"],"title":"FoodZoneMenuSyncDto"},"FoodZoneMenuSyncListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FoodZoneMenuSyncDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"FoodZoneMenuSyncListDto"},"FoodZoneMenuSyncSkipDto":{"type":"object","properties":{"entity":{"type":"string","enum":["category","size","modifier_category","modifier","menu_item","provider_price"]},"id":{"type":"string","description":"Our id of the product, variant, option, group or category."},"name":{"type":"string","description":"Its name as we store it, for the merchant to find it."},"reason":{"type":"string","enum":["NO_ENGLISH_NAME","NO_ARABIC_NAME","NO_IMAGE","CATEGORY_SKIPPED","NO_MODIFIERS","PROVIDER_PRICE_PER_BRANCH","PROVIDER_PRICE_NOT_ON_ITEM","PROVIDER_PRICE_ON_SIZED_ITEM","NON_POSITIVE_PRICE"]}},"required":["entity","id","name","reason"],"title":"FoodZoneMenuSyncSkipDto"},"FoodZoneMenuSyncDetailDto":{"type":"object","properties":{"id":{"type":"string"},"trigger":{"enum":["CATALOG_CHANGED","MANUAL"],"type":"string"},"status":{"enum":["RUNNING","SUCCEEDED","FAILED"],"type":"string"},"attempt":{"type":"number","description":"1 for the first try, 2+ for automatic retries."},"counts":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/FoodZoneMenuSyncCountsDto"}]},"skipped_count":{"type":"number"},"error_code":{"nullable":true,"enum":["MENU_REJECTED","TOKEN_REJECTED","UNAVAILABLE","INTERNAL"],"type":"string","description":"Why it failed; translate it for the merchant. Null unless FAILED."},"error":{"type":"string","nullable":true,"description":"Technical detail for support (for a rejected menu, every failing field). Show it as-is, never as the message."},"started_at":{"format":"date-time","type":"string"},"finished_at":{"format":"date-time","type":"string","nullable":true},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/FoodZoneMenuSyncSkipDto"}}},"required":["id","trigger","status","attempt","counts","skipped_count","error_code","error","started_at","finished_at","skipped"],"title":"FoodZoneMenuSyncDetailDto"},"FoodZoneMenuSyncPayloadDto":{"type":"object","properties":{"status":{"type":"number","nullable":true,"description":"HTTP status; null when nothing came back."},"duration_ms":{"type":"number","nullable":true},"request":{"type":"string","description":"The request body, as JSON text."},"response":{"type":"string","nullable":true,"description":"The response body, as JSON text."},"expires_at":{"format":"date-time","type":"string","description":"When this sync is deleted."}},"required":["status","duration_ms","request","response","expires_at"],"title":"FoodZoneMenuSyncPayloadDto"},"FoodZoneMenuSyncQueuedDto":{"type":"object","properties":{"queued":{"type":"boolean","description":"Always true: the sync runs in the background."}},"required":["queued"],"title":"FoodZoneMenuSyncQueuedDto"},"SalesDiscountBreakdownDto":{"type":"object","properties":{"cashier":{"type":"number","example":22,"description":"Staff-applied discounts (catalog Discount or ad-hoc)."},"promo_code":{"type":"number","example":15,"description":"Promo codes typed by customers."},"catalog":{"type":"number","example":30,"description":"Automatic catalog promotions. Already inside gross_revenue (the menu price was lower) — reported, not deducted again."},"loyalty":{"type":"number","example":10,"description":"Loyalty points redeemed."},"total":{"type":"number","example":47,"description":"cashier + promo_code + loyalty."}},"required":["cashier","promo_code","catalog","loyalty","total"],"title":"SalesDiscountBreakdownDto"},"SalesCollectionsDto":{"type":"object","properties":{"cash":{"type":"number","example":288.55},"card":{"type":"number","example":346},"online":{"type":"number","example":120},"digital_wallet":{"type":"number","example":0},"gift_card":{"type":"number","example":25},"other":{"type":"number","example":0},"total":{"type":"number","example":779.55,"description":"Everything collected in the range, by payment date."},"deferred_settled":{"type":"number","example":50,"description":"Part of total that settled orders put on account (آجل), possibly from earlier periods."},"refunded":{"type":"number","example":30,"description":"Paid back to customers in the range, by refund date."},"net":{"type":"number","example":749.55,"description":"total − refunded."}},"required":["cash","card","online","digital_wallet","gift_card","other","total","deferred_settled","refunded","net"],"title":"SalesCollectionsDto"},"SalesSummaryDto":{"type":"object","properties":{"order_count":{"type":"number","example":15,"description":"Completed orders, by completion time."},"list_revenue":{"type":"number","example":646,"description":"Σ list prices before any discount, catalog promotions included."},"gross_revenue":{"type":"number","example":616,"description":"Σ subtotal as sold (catalog discounts already off), VAT inside."},"total_discounts":{"type":"number","example":47,"description":"cashier + promo code + loyalty."},"total_loyalty_discounts":{"type":"number","example":10,"deprecated":true,"description":"Equals discounts.loyalty."},"discounts":{"$ref":"#/components/schemas/SalesDiscountBreakdownDto"},"total_tax":{"type":"number","example":35.55,"description":"Restaurant VAT contained in the net (never added)."},"total_product_vat":{"type":"number","example":12.4,"description":"Product VAT contained in the lines."},"total_delivery_fees":{"type":"number","example":10},"total_service_charges":{"type":"number","example":5},"net_revenue":{"type":"number","example":584,"description":"Σ total: what customers were charged, fees and VAT included."},"returns_credit":{"type":"number","example":20,"description":"Return credit issued in the range, by return date."},"net_after_returns":{"type":"number","example":564},"goods_net":{"type":"number","example":569,"description":"netRevenue − delivery − service charge."},"sales_ex_vat":{"type":"number","example":521.05,"description":"goodsNet − restaurant VAT − product VAT."},"total_commissions":{"type":"number","example":9.7},"cogs":{"type":"number","example":210.4,"description":"Cost of goods for lines with a known cost snapshot."},"cogs_coverage":{"type":"number","example":0.82,"description":"Share (0–1) of net line revenue that has a cost behind it."},"gross_profit":{"type":"number","example":300.95,"description":"salesExVat − cogs − commissions."},"paid_expenses":{"type":"number","example":120,"description":"Expenses paid in the range (by paid date), ex VAT."},"paid_expenses_vat":{"type":"number","example":18},"paid_expenses_total":{"type":"number","example":138,"description":"Paid expenses, VAT included."},"paid_expense_count":{"type":"number","example":3},"net_profit":{"type":"number","example":180.95,"description":"grossProfit − paidExpenses."},"deferred_sales":{"type":"number","example":80,"description":"Sales put on account (آجل) in the range."},"outstanding_amount":{"type":"number","example":65,"description":"Still owed on the range's orders."},"unsettled_orders":{"type":"number","example":2,"description":"Completed orders neither paid in full nor put on account."},"unsettled_amount":{"type":"number","example":35},"collections":{"$ref":"#/components/schemas/SalesCollectionsDto"},"cash_total":{"type":"number","example":288.55,"deprecated":true,"description":"Equals collections.cash."},"card_total":{"type":"number","example":346,"deprecated":true,"description":"Equals collections.card."},"online_total":{"type":"number","example":120,"deprecated":true,"description":"Equals collections.online."},"average_order_value":{"type":"number","example":42.3,"description":"netRevenue / orderCount."}},"required":["order_count","list_revenue","gross_revenue","total_discounts","total_loyalty_discounts","discounts","total_tax","total_product_vat","total_delivery_fees","total_service_charges","net_revenue","returns_credit","net_after_returns","goods_net","sales_ex_vat","total_commissions","cogs","cogs_coverage","gross_profit","paid_expenses","paid_expenses_vat","paid_expenses_total","paid_expense_count","net_profit","deferred_sales","outstanding_amount","unsettled_orders","unsettled_amount","collections","cash_total","card_total","online_total","average_order_value"],"title":"SalesSummaryDto"},"SalesBreakdownByDayDto":{"type":"object","properties":{"date":{"type":"string","example":"2026-06-04","description":"Business day in the restaurant's timezone."},"order_count":{"type":"number","example":2},"gross_revenue":{"type":"number","example":60},"net_revenue":{"type":"number","example":53.75},"total_discounts":{"type":"number","example":0,"description":"cashier + promo + loyalty"},"total_tax":{"type":"number","example":3.75},"total_product_vat":{"type":"number","example":1.2},"returns_credit":{"type":"number","example":0},"collected":{"type":"number","example":53.75,"description":"Collected that day, by payment date."}},"required":["date","order_count","gross_revenue","net_revenue","total_discounts","total_tax","total_product_vat","returns_credit","collected"],"title":"SalesBreakdownByDayDto"},"SalesBreakdownByChannelDto":{"type":"object","properties":{"channel_id":{"type":"string","nullable":true,"format":"uuid"},"channel_name":{"type":"string","example":"Direct / POS"},"channel_name_ar":{"type":"string","nullable":true},"order_count":{"type":"number","example":13},"list_revenue":{"type":"number","example":640,"description":"Σ menu price × qty, before any discount."},"gross_revenue":{"type":"number","example":620,"description":"Σ subtotal, after catalog promotions."},"total_discounts":{"type":"number","example":40.45,"description":"Cashier + promo code + loyalty."},"net_revenue":{"type":"number","example":579.55},"total_commissions":{"type":"number","example":0}},"required":["channel_id","channel_name","channel_name_ar","order_count","list_revenue","gross_revenue","total_discounts","net_revenue","total_commissions"],"title":"SalesBreakdownByChannelDto"},"SalesBreakdownBySourceDto":{"type":"object","properties":{"source":{"type":"string","example":"pos","enum":["pos","emenu","table_session","service_booking"]},"order_count":{"type":"number","example":13},"list_revenue":{"type":"number","example":640,"description":"Σ menu price × qty, before any discount."},"gross_revenue":{"type":"number","example":620,"description":"Σ subtotal, after catalog promotions."},"total_discounts":{"type":"number","example":40.45,"description":"Cashier + promo code + loyalty."},"net_revenue":{"type":"number","example":579.55,"description":"Σ total."}},"required":["source","order_count","list_revenue","gross_revenue","total_discounts","net_revenue"],"title":"SalesBreakdownBySourceDto"},"SalesBreakdownByOrderTypeDto":{"type":"object","properties":{"order_type":{"type":"string","example":"DINE_IN"},"order_count":{"type":"number","example":9},"net_revenue":{"type":"number","example":398.55}},"required":["order_type","order_count","net_revenue"],"title":"SalesBreakdownByOrderTypeDto"},"SalesBreakdownByPaymentMethodDto":{"type":"object","properties":{"payment_method_id":{"type":"string","nullable":true},"payment_method":{"type":"string","example":"Card"},"type":{"type":"string","example":"CARD"},"order_count":{"type":"number","example":6,"deprecated":true,"description":"Equals paymentCount."},"payment_count":{"type":"number","example":6},"net_revenue":{"type":"number","example":324,"description":"Collected, by payment date."}},"required":["payment_method_id","payment_method","type","order_count","payment_count","net_revenue"],"title":"SalesBreakdownByPaymentMethodDto"},"SalesBreakdownByGatewayDto":{"type":"object","properties":{"gateway":{"type":"string","example":"myfatoorah"},"order_count":{"type":"number","example":3,"deprecated":true,"description":"Payments, not orders."},"net_revenue":{"type":"number","example":120}},"required":["gateway","order_count","net_revenue"],"title":"SalesBreakdownByGatewayDto"},"SalesBreakdownByBranchDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"branch_name":{"type":"string","example":"Main"},"branch_name_ar":{"type":"string","nullable":true},"order_count":{"type":"number","example":9},"net_revenue":{"type":"number","example":398.55}},"required":["branch_id","branch_name","branch_name_ar","order_count","net_revenue"],"title":"SalesBreakdownByBranchDto"},"SalesBreakdownByCashierDto":{"type":"object","properties":{"staff_id":{"type":"string","nullable":true},"staff_name":{"type":"string","example":"Sara"},"order_count":{"type":"number","example":9},"net_revenue":{"type":"number","example":398.55}},"required":["staff_id","staff_name","order_count","net_revenue"],"title":"SalesBreakdownByCashierDto"},"SalesBreakdownByHourDto":{"type":"object","properties":{"hour":{"type":"number","example":13,"description":"0–23 in the restaurant's timezone."},"order_count":{"type":"number","example":4},"net_revenue":{"type":"number","example":120}},"required":["hour","order_count","net_revenue"],"title":"SalesBreakdownByHourDto"},"SalesBreakdownByCategoryDto":{"type":"object","properties":{"category_id":{"type":"string","nullable":true},"category_name":{"type":"string","example":"Burgers"},"category_name_ar":{"type":"string","nullable":true},"quantity":{"type":"number","example":14},"revenue":{"type":"number","example":362},"net_revenue":{"type":"number","example":340},"cogs":{"type":"number","example":120}},"required":["category_id","category_name","category_name_ar","quantity","revenue","net_revenue","cogs"],"title":"SalesBreakdownByCategoryDto"},"SalesBreakdownByDiscountDto":{"type":"object","properties":{"kind":{"type":"string","example":"CASHIER","enum":["CASHIER","PROMO_CODE","CATALOG","LOYALTY"]},"source_id":{"type":"string","nullable":true,"description":"Discount or promotion id."},"name":{"type":"string","example":"Staff 10%"},"name_ar":{"type":"string","nullable":true},"order_count":{"type":"number","example":12},"amount":{"type":"number","example":96.5}},"required":["kind","source_id","name","name_ar","order_count","amount"],"title":"SalesBreakdownByDiscountDto"},"SalesBreakdownByDiscountOrderDto":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"serial_number":{"type":"number","nullable":true,"description":"Printed invoice / fatora number."},"date":{"type":"string","example":"2026-10-22","description":"Business day, YYYY-MM-DD."},"order_total":{"type":"number","example":238,"description":"Order total the customer was charged."},"kind":{"type":"string","example":"CASHIER","enum":["CASHIER","PROMO_CODE","LOYALTY"]},"name":{"type":"string","example":"Staff 10%"},"name_ar":{"type":"string","nullable":true},"amount":{"type":"number","example":23.8,"description":"Amount this discount took off the order."},"discount_type":{"type":"string","nullable":true,"enum":["FIXED","PERCENTAGE"]},"discount_value":{"type":"number","nullable":true,"description":"Raw value (10 = 10% or 10 SAR)."},"promo_code":{"type":"string","nullable":true,"description":"Promo code typed by the customer."}},"required":["order_id","serial_number","date","order_total","kind","name","name_ar","amount","discount_type","discount_value","promo_code"],"title":"SalesBreakdownByDiscountOrderDto"},"SalesBreakdownByExpenseCategoryDto":{"type":"object","properties":{"category_id":{"type":"string","nullable":true},"category_name":{"type":"string","example":"Rent"},"category_name_ar":{"type":"string","nullable":true},"expense_count":{"type":"number","example":2},"amount":{"type":"number","example":1000,"description":"Ex VAT."},"total":{"type":"number","example":1150,"description":"VAT included."}},"required":["category_id","category_name","category_name_ar","expense_count","amount","total"],"title":"SalesBreakdownByExpenseCategoryDto"},"TopProductDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"product_name":{"type":"string","example":"Classic Burger"},"product_name_ar":{"type":"string","nullable":true},"quantity":{"type":"number","example":14},"revenue":{"type":"number","example":362,"description":"Gross line revenue."},"net_revenue":{"type":"number","example":340,"description":"After the lines’ discount share."},"returned_quantity":{"type":"number","example":1},"returns":{"type":"number","example":24},"cogs":{"type":"number","example":120},"gross_profit":{"type":"number","nullable":true,"description":"null when no cost is known."}},"required":["product_id","product_name","product_name_ar","quantity","revenue","net_revenue","returned_quantity","returns","cogs","gross_profit"],"title":"TopProductDto"},"SalesCustomFieldValueDto":{"type":"object","properties":{"value":{"type":"string","example":"Table 4"},"order_count":{"type":"number","example":3},"net_revenue":{"type":"number","example":120}},"required":["value","order_count","net_revenue"],"title":"SalesCustomFieldValueDto"},"SalesBreakdownByCustomFieldDto":{"type":"object","properties":{"field_id":{"type":"string","format":"uuid"},"field_label":{"type":"string","example":"Table"},"field_label_ar":{"type":"string","nullable":true},"values":{"type":"array","items":{"$ref":"#/components/schemas/SalesCustomFieldValueDto"}}},"required":["field_id","field_label","field_label_ar","values"],"title":"SalesBreakdownByCustomFieldDto"},"SalesReportPreviousDto":{"type":"object","properties":{"date_from":{"type":"string","format":"date-time"},"date_to":{"type":"string","format":"date-time"},"summary":{"$ref":"#/components/schemas/SalesSummaryDto"},"by_day":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByDayDto"}}},"required":["date_from","date_to","summary","by_day"],"title":"SalesReportPreviousDto"},"SalesReportResponseDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"channel_id":{"type":"string","nullable":true,"format":"uuid"},"date_from":{"type":"string","example":"2026-05-12T00:00:00.000Z"},"date_to":{"type":"string","example":"2026-06-10T23:59:59.999Z"},"timezone":{"type":"string","example":"Asia/Riyadh","description":"Timezone the days and hours are bucketed in."},"summary":{"$ref":"#/components/schemas/SalesSummaryDto"},"by_day":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByDayDto"}},"by_channel":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByChannelDto"}},"by_source":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownBySourceDto"}},"by_order_type":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByOrderTypeDto"}},"by_payment_method":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByPaymentMethodDto"}},"by_online_gateway":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByGatewayDto"}},"by_branch":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByBranchDto"}},"by_cashier":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByCashierDto"}},"by_hour":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByHourDto"}},"by_category":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByCategoryDto"}},"by_discount":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByDiscountDto"}},"by_discount_orders":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByDiscountOrderDto"}},"by_expense_category":{"type":"array","items":{"$ref":"#/components/schemas/SalesBreakdownByExpenseCategoryDto"}},"top_products":{"type":"array","items":{"$ref":"#/components/schemas/TopProductDto"}},"by_custom_field":{"$ref":"#/components/schemas/SalesBreakdownByCustomFieldDto"},"previous":{"description":"Present when `compare_previous` was sent: the window just before this one.","allOf":[{"$ref":"#/components/schemas/SalesReportPreviousDto"}]}},"required":["restaurant_id","branch_id","channel_id","date_from","date_to","timezone","summary","by_day","by_channel","by_source","by_order_type","by_payment_method","by_online_gateway","by_branch","by_cashier","by_hour","by_category","by_discount","by_discount_orders","by_expense_category","top_products"],"title":"SalesReportResponseDto"},"ProductReportSummaryDto":{"type":"object","properties":{"product_count":{"type":"number","example":42},"order_count":{"type":"number","example":128},"total_quantity_sold":{"type":"number","example":512},"total_revenue":{"type":"number","example":18450.75},"total_cost":{"type":"number","example":7320.4},"total_profit":{"type":"number","example":11130.35},"profit_margin":{"type":"number","example":60.32},"average_revenue_per_order":{"type":"number","example":144.15}},"required":["product_count","order_count","total_quantity_sold","total_revenue","total_cost","total_profit","profit_margin","average_revenue_per_order"],"title":"ProductReportSummaryDto"},"ProductPerformanceRowDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"product_name":{"type":"string","example":"Classic Burger"},"product_name_ar":{"type":"string","nullable":true},"category_id":{"type":"string","nullable":true,"format":"uuid"},"category_name":{"type":"string","nullable":true},"category_name_ar":{"type":"string","nullable":true},"sale_unit_symbol":{"type":"string","nullable":true,"example":"kg","description":"The unit quantity_sold is in, for products sold by weight or volume; null for pieces. A product sold in more than one unit over the period has one row per unit."},"quantity_sold":{"type":"number","example":140,"description":"In sale_unit_symbol when set, otherwise pieces."},"revenue":{"type":"number","example":3620},"order_count":{"type":"number","example":96},"cost":{"type":"number","example":1400},"profit":{"type":"number","example":2220},"profit_margin":{"type":"number","example":61.33},"average_revenue_per_order":{"type":"number","example":37.71},"average_quantity_per_order":{"type":"number","example":1.46},"revenue_share":{"type":"number","example":19.62}},"required":["product_id","product_name","product_name_ar","category_id","category_name","category_name_ar","sale_unit_symbol","quantity_sold","revenue","order_count","cost","profit","profit_margin","average_revenue_per_order","average_quantity_per_order","revenue_share"],"title":"ProductPerformanceRowDto"},"ProductBreakdownByCategoryDto":{"type":"object","properties":{"category_id":{"type":"string","nullable":true,"format":"uuid"},"category_name":{"type":"string","example":"Burgers"},"category_name_ar":{"type":"string","nullable":true},"product_count":{"type":"number","example":8},"quantity_sold":{"type":"number","example":260},"order_count":{"type":"number","example":110},"revenue":{"type":"number","example":7420},"revenue_share":{"type":"number","example":40.21}},"required":["category_id","category_name","category_name_ar","product_count","quantity_sold","order_count","revenue","revenue_share"],"title":"ProductBreakdownByCategoryDto"},"ProductReportResponseDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"category_ids":{"nullable":true,"type":"array","items":{"type":"string","format":"uuid"}},"date_from":{"type":"string","example":"2026-05-12"},"date_to":{"type":"string","example":"2026-06-10"},"timezone":{"type":"string","example":"UTC"},"summary":{"$ref":"#/components/schemas/ProductReportSummaryDto"},"products":{"type":"array","items":{"$ref":"#/components/schemas/ProductPerformanceRowDto"}},"by_category":{"type":"array","items":{"$ref":"#/components/schemas/ProductBreakdownByCategoryDto"}}},"required":["restaurant_id","branch_id","category_ids","date_from","date_to","timezone","summary","products","by_category"],"title":"ProductReportResponseDto"},"ReturnsReportSummaryDto":{"type":"object","properties":{"return_count":{"type":"number","example":14},"item_count":{"type":"number","example":30},"total_quantity":{"type":"number","example":45},"total_value":{"type":"number","example":1200},"refunded_value":{"type":"number","example":960},"non_refunded_value":{"type":"number","example":240},"average_refund_per_return":{"type":"number","example":68.57},"total_refunded_cash":{"type":"number","example":820},"outstanding_refund_amount":{"type":"number","example":140},"partially_returned_orders":{"type":"number","example":5},"fully_returned_orders":{"type":"number","example":3}},"required":["return_count","item_count","total_quantity","total_value","refunded_value","non_refunded_value","average_refund_per_return","total_refunded_cash","outstanding_refund_amount","partially_returned_orders","fully_returned_orders"],"title":"ReturnsReportSummaryDto"},"ReturnsBreakdownByDispositionDto":{"type":"object","properties":{"disposition":{"type":"string","example":"WASTE"},"item_count":{"type":"number","example":3},"quantity":{"type":"number","example":4},"value":{"type":"number","example":320}},"required":["disposition","item_count","quantity","value"],"title":"ReturnsBreakdownByDispositionDto"},"ReturnsBreakdownByDayDto":{"type":"object","properties":{"date":{"type":"string","example":"2026-06-04"},"return_count":{"type":"number","example":2},"item_count":{"type":"number","example":4},"refunded_value":{"type":"number","example":120}},"required":["date","return_count","item_count","refunded_value"],"title":"ReturnsBreakdownByDayDto"},"ReturnedProductDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"product_name":{"type":"string","example":"Classic Burger"},"product_name_ar":{"type":"string","nullable":true},"quantity":{"type":"number","example":12},"value":{"type":"number","example":340},"return_count":{"type":"number","example":6}},"required":["product_id","product_name","product_name_ar","quantity","value","return_count"],"title":"ReturnedProductDto"},"ReturnsReportResponseDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"date_from":{"type":"string","example":"2026-05-12"},"date_to":{"type":"string","example":"2026-06-10"},"timezone":{"type":"string","example":"UTC"},"summary":{"$ref":"#/components/schemas/ReturnsReportSummaryDto"},"by_disposition":{"type":"array","items":{"$ref":"#/components/schemas/ReturnsBreakdownByDispositionDto"}},"by_day":{"type":"array","items":{"$ref":"#/components/schemas/ReturnsBreakdownByDayDto"}},"top_returned_products":{"type":"array","items":{"$ref":"#/components/schemas/ReturnedProductDto"}}},"required":["restaurant_id","branch_id","date_from","date_to","timezone","summary","by_disposition","by_day","top_returned_products"],"title":"ReturnsReportResponseDto"},"CustomFieldValueRowDto":{"type":"object","properties":{"value":{"type":"string","example":"Sara"},"order_count":{"type":"number","example":12},"net_revenue":{"type":"number","example":478}},"required":["value","order_count","net_revenue"],"title":"CustomFieldValueRowDto"},"CustomFieldReportSectionDto":{"type":"object","properties":{"field_id":{"type":"string","format":"uuid"},"field_label":{"type":"string","example":"Employee"},"field_label_ar":{"type":"string","nullable":true},"type":{"type":"string","example":"DROPDOWN"},"order_count":{"type":"number","example":25,"description":"Orders in range that have this field set."},"net_revenue":{"type":"number","example":1208.55},"values":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueRowDto"}}},"required":["field_id","field_label","field_label_ar","type","order_count","net_revenue","values"],"title":"CustomFieldReportSectionDto"},"CustomFieldsReportResponseDto":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"date_from":{"type":"string","example":"2026-05-12"},"date_to":{"type":"string","example":"2026-06-10"},"timezone":{"type":"string","example":"UTC"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldReportSectionDto"}}},"required":["restaurant_id","branch_id","date_from","date_to","timezone","fields"],"title":"CustomFieldsReportResponseDto"},"GeneratedReportUserDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"GeneratedReportUserDto"},"GeneratedReportDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"report_type":{"type":"string","example":"sales"},"status":{"enum":["PENDING","PROCESSING","READY","FAILED"],"type":"string","example":"PENDING"},"locale":{"type":"string","example":"ar"},"filename":{"type":"string"},"date_from":{"type":"string","nullable":true,"format":"date-time"},"date_to":{"type":"string","nullable":true,"format":"date-time"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"channel_id":{"type":"string","nullable":true,"format":"uuid"},"filters":{"type":"object","additionalProperties":true,"nullable":true},"error_message":{"type":"string","nullable":true},"generated_by":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/GeneratedReportUserDto"}]},"created_at":{"format":"date-time","type":"string"}},"required":["id","report_type","status","locale","filename","date_from","date_to","branch_id","channel_id","error_message","generated_by","created_at"],"title":"GeneratedReportDto"},"GeneratedReportListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GeneratedReportDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"GeneratedReportListDto"},"MobilePrinterCategoryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"printer_id":{"type":"string","format":"uuid"},"category_id":{"type":"string","format":"uuid"},"category_name":{"type":"string","nullable":true,"example":"Grill"},"category_name_ar":{"type":"string","nullable":true,"example":"مشويات"},"priority":{"type":"number","example":1},"print_copies":{"type":"number","nullable":true,"example":1},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","printer_id","category_id","category_name","category_name_ar","priority","print_copies","created_at","updated_at"],"title":"MobilePrinterCategoryDto"},"MobilePrinterDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Kitchen Printer 1"},"name_ar":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"connection_type":{"enum":["NETWORK","BLUETOOTH","USB"],"type":"string","example":"NETWORK"},"connection_info":{"type":"object","additionalProperties":{},"description":"Connection details; shape depends on connectionType."},"printer_model":{"type":"string","nullable":true},"paper_width":{"type":"number","example":80},"printer_type":{"enum":["KITCHEN","CASHIER","DELIVERY"],"type":"string","example":"KITCHEN"},"is_default_cashier":{"type":"boolean","example":false},"is_default_kitchen":{"type":"boolean","example":false},"prints_all_categories":{"type":"boolean","example":false},"print_copies":{"type":"number","example":1},"auto_cut":{"type":"boolean","example":true},"beep_on_print":{"type":"boolean","example":false},"print_logo":{"type":"boolean","example":true},"print_rules":{"type":"object","nullable":true,"additionalProperties":{}},"is_active":{"type":"boolean","example":true},"device_id":{"type":"string","nullable":true},"settings":{"type":"object","nullable":true,"additionalProperties":{}},"created_by":{"type":"string","nullable":true,"format":"uuid"},"updated_by":{"type":"string","nullable":true,"format":"uuid"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/MobilePrinterCategoryDto"}}},"required":["id","restaurant_id","branch_id","name","name_ar","description","connection_type","connection_info","printer_model","paper_width","printer_type","is_default_cashier","is_default_kitchen","prints_all_categories","print_copies","auto_cut","beep_on_print","print_logo","print_rules","is_active","device_id","settings","created_by","updated_by","created_at","updated_at","categories"],"title":"MobilePrinterDto"},"MobilePrinterStatsDto":{"type":"object","properties":{"branch_id":{"type":"string","format":"uuid"},"total":{"type":"number","example":3},"active":{"type":"number","example":2},"by_type":{"type":"object","additionalProperties":{"type":"number"},"example":{"KITCHEN":2,"CASHIER":1,"DELIVERY":0}}},"required":["branch_id","total","active","by_type"],"title":"MobilePrinterStatsDto"},"OrderPrintersDto":{"type":"object","properties":{"category_ids":{"minItems":1,"type":"array","items":{"type":"string","format":"uuid"}},"order_type":{"type":"string"}},"required":["category_ids"],"title":"OrderPrintersDto"},"OrderPrintersResponseDto":{"type":"object","properties":{"printers":{"type":"array","items":{"$ref":"#/components/schemas/MobilePrinterDto"}},"by_type":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/MobilePrinterDto"}},"description":"Printers grouped by type."}},"required":["printers","by_type"],"title":"OrderPrintersResponseDto"},"CreateMobilePrinterDto":{"type":"object","properties":{"connection_info":{"type":"object","additionalProperties":{},"description":"Connection details; shape depends on connectionType."},"print_rules":{"type":"object","additionalProperties":{}},"settings":{"type":"object","additionalProperties":{}},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"description":{"type":"string"},"connection_type":{"type":"string","enum":["NETWORK","BLUETOOTH","USB"]},"printer_model":{"type":"string","maxLength":100},"paper_width":{"type":"number","minimum":58,"maximum":112},"printer_type":{"type":"string","enum":["DELIVERY","CASHIER","KITCHEN"]},"is_default_cashier":{"type":"boolean"},"is_default_kitchen":{"type":"boolean"},"prints_all_categories":{"type":"boolean"},"print_copies":{"type":"number","minimum":1,"maximum":10},"auto_cut":{"type":"boolean"},"beep_on_print":{"type":"boolean"},"print_logo":{"type":"boolean"},"is_active":{"type":"boolean"},"device_id":{"type":"string"}},"required":["connection_info","name"],"title":"CreateMobilePrinterDto"},"UpdateMobilePrinterDto":{"type":"object","properties":{"connection_info":{"type":"object","additionalProperties":{},"description":"Connection details; shape depends on connectionType."},"print_rules":{"type":"object","additionalProperties":{}},"settings":{"type":"object","additionalProperties":{}},"name":{"type":"string","maxLength":255},"name_ar":{"type":"string","maxLength":255},"description":{"type":"string"},"connection_type":{"enum":["NETWORK","BLUETOOTH","USB"],"type":"string"},"printer_model":{"type":"string","maxLength":100},"paper_width":{"type":"number","minimum":58,"maximum":112},"printer_type":{"enum":["DELIVERY","CASHIER","KITCHEN"],"type":"string"},"is_default_cashier":{"type":"boolean"},"is_default_kitchen":{"type":"boolean"},"prints_all_categories":{"type":"boolean"},"print_copies":{"type":"number","minimum":1,"maximum":10},"auto_cut":{"type":"boolean"},"beep_on_print":{"type":"boolean"},"print_logo":{"type":"boolean"},"is_active":{"type":"boolean"},"device_id":{"type":"string"}},"title":"UpdateMobilePrinterDto"},"BulkCategoryItemDto":{"type":"object","properties":{"category_id":{"type":"string","format":"uuid"},"priority":{"type":"number","minimum":1},"print_copies":{"type":"number","minimum":1}},"required":["category_id"],"title":"BulkCategoryItemDto"},"BulkSetCategoriesDto":{"type":"object","properties":{"categories":{"type":"array","items":{"$ref":"#/components/schemas/BulkCategoryItemDto"}}},"required":["categories"],"title":"BulkSetCategoriesDto"},"AddCategoryDto":{"type":"object","properties":{"priority":{"type":"number","minimum":1},"print_copies":{"type":"number","minimum":1}},"title":"AddCategoryDto"},"DuplicatePrinterDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"branch_id":{"type":"string","format":"uuid"}},"title":"DuplicatePrinterDto"},"ExpenseExpandedCategoryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","is_active","created_at","updated_at"],"title":"ExpenseExpandedCategoryDto"},"ExpenseExpandedSupplierDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","name_ar","phone","email"],"title":"ExpenseExpandedSupplierDto"},"ExpenseExpandedBranchDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true}},"required":["id","name","name_ar"],"title":"ExpenseExpandedBranchDto"},"ExpenseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"category_id":{"type":"string","nullable":true,"format":"uuid"},"supplier_id":{"type":"string","nullable":true,"format":"uuid"},"recurring_schedule_id":{"type":"string","nullable":true,"format":"uuid"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"amount":{"type":"number"},"vat_type":{"nullable":true,"enum":["FIXED","PERCENTAGE"],"type":"string"},"vat_value":{"type":"number","nullable":true},"vat_amount":{"type":"number","nullable":true},"total_amount":{"type":"number"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"payment_method":{"nullable":true,"enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"],"type":"string"},"payment_status":{"enum":["PENDING","PAID","OVERDUE","CANCELLED"],"type":"string"},"paid_at":{"type":"string","nullable":true,"format":"date-time"},"due_date":{"type":"string","nullable":true,"format":"date"},"attachment_urls":{"type":"array","items":{"type":"string"}},"is_recurring":{"type":"boolean"},"cancelled_at":{"type":"string","nullable":true,"format":"date-time"},"cancel_reason":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"category":{"description":"Present when `expand=category` is requested.","allOf":[{"$ref":"#/components/schemas/ExpenseExpandedCategoryDto"}]},"supplier":{"description":"Present when `expand=supplier` is requested.","allOf":[{"$ref":"#/components/schemas/ExpenseExpandedSupplierDto"}]},"branch":{"description":"Present when `expand=branch` is requested.","allOf":[{"$ref":"#/components/schemas/ExpenseExpandedBranchDto"}]}},"required":["id","restaurant_id","branch_id","category_id","supplier_id","recurring_schedule_id","title","description","amount","vat_type","vat_value","vat_amount","total_amount","currency","payment_method","payment_status","paid_at","due_date","attachment_urls","is_recurring","cancelled_at","cancel_reason","created_at","updated_at"],"title":"ExpenseDto"},"ExpenseListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ExpenseListDto"},"ExpenseStatsByCategoryDto":{"type":"object","properties":{"category_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"total":{"type":"number"}},"required":["category_id","name","total"],"title":"ExpenseStatsByCategoryDto"},"ExpenseStatsDto":{"type":"object","properties":{"total_pending":{"type":"number"},"total_paid":{"type":"number"},"total_overdue":{"type":"number"},"total_cancelled":{"type":"number"},"period_total":{"type":"number","description":"Sum of total_amount for all non-cancelled expenses in the requested period."},"by_category":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatsByCategoryDto"}},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"}},"required":["total_pending","total_paid","total_overdue","total_cancelled","period_total","by_category","currency"],"title":"ExpenseStatsDto"},"CreateExpenseDto":{"type":"object","properties":{"title":{"type":"string","maxLength":255,"example":"Electricity bill — June 2026"},"description":{"type":"string","maxLength":1000},"amount":{"type":"number","minimum":1,"example":500,"description":"Base amount before VAT."},"vat_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"vat_value":{"type":"number","minimum":0,"example":15,"description":"VAT rate (percentage) or fixed amount. Requires vat_type."},"payment_method":{"enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"],"type":"string"},"due_date":{"type":"string","format":"date","example":"2026-07-01"},"branch_id":{"type":"string","format":"uuid","description":"The branch that carries the cost; the sales report only counts branch expenses."},"category_id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","format":"uuid"}},"required":["title","amount","branch_id"],"title":"CreateExpenseDto"},"UpdateExpenseDto":{"type":"object","properties":{"title":{"type":"string","maxLength":255,"example":"Electricity bill — June 2026"},"description":{"type":"string","maxLength":1000},"amount":{"type":"number","minimum":1,"example":500,"description":"Base amount before VAT."},"vat_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"vat_value":{"type":"number","minimum":0,"example":15,"description":"VAT rate (percentage) or fixed amount. Requires vat_type."},"payment_method":{"enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"],"type":"string"},"due_date":{"type":"string","format":"date","example":"2026-07-01"},"branch_id":{"type":"string","format":"uuid","description":"The branch that carries the cost; the sales report only counts branch expenses."},"category_id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","format":"uuid"},"cancel_reason":{"type":"string","maxLength":500,"description":"Reason for cancellation (set when cancelling)."}},"title":"UpdateExpenseDto"},"CancelExpenseDto":{"type":"object","properties":{"cancel_reason":{"type":"string","maxLength":500,"description":"Reason for cancellation."}},"title":"CancelExpenseDto"},"RecurringScheduleDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"branch_id":{"type":"string","nullable":true,"format":"uuid"},"category_id":{"type":"string","nullable":true,"format":"uuid"},"supplier_id":{"type":"string","nullable":true,"format":"uuid"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"amount":{"type":"number"},"vat_type":{"nullable":true,"enum":["FIXED","PERCENTAGE"],"type":"string"},"vat_value":{"type":"number","nullable":true},"payment_method":{"nullable":true,"enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"],"type":"string"},"currency":{"type":"string","example":"SAR","description":"ISO 4217 currency code"},"frequency":{"enum":["DAILY","WEEKLY","MONTHLY","QUARTERLY","YEARLY"],"type":"string"},"start_date":{"format":"date","type":"string"},"end_date":{"type":"string","nullable":true,"format":"date"},"next_due_at":{"format":"date","type":"string"},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","branch_id","category_id","supplier_id","title","description","amount","vat_type","vat_value","payment_method","currency","frequency","start_date","end_date","next_due_at","is_active","created_at","updated_at"],"title":"RecurringScheduleDto"},"RecurringScheduleListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RecurringScheduleDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"RecurringScheduleListDto"},"CreateRecurringScheduleDto":{"type":"object","properties":{"title":{"type":"string","maxLength":255,"example":"Monthly rent"},"description":{"type":"string","maxLength":1000},"amount":{"type":"number","minimum":1,"example":5000},"vat_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"vat_value":{"type":"number","minimum":0,"example":15},"payment_method":{"enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"],"type":"string"},"frequency":{"enum":["DAILY","WEEKLY","MONTHLY","QUARTERLY","YEARLY"],"type":"string"},"start_date":{"type":"string","format":"date","example":"2026-07-01","description":"First occurrence date."},"end_date":{"type":"string","format":"date","example":"2027-06-30","description":"Last occurrence date. Omit for open-ended."},"branch_id":{"type":"string","format":"uuid","description":"The branch that carries the cost; the sales report only counts branch expenses."},"category_id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","format":"uuid"}},"required":["title","amount","frequency","start_date","branch_id"],"title":"CreateRecurringScheduleDto"},"UpdateRecurringScheduleDto":{"type":"object","properties":{"title":{"type":"string","maxLength":255,"example":"Monthly rent"},"description":{"type":"string","maxLength":1000},"amount":{"type":"number","minimum":1,"example":5000},"vat_type":{"enum":["FIXED","PERCENTAGE"],"type":"string"},"vat_value":{"type":"number","minimum":0,"example":15},"payment_method":{"enum":["CASH","CARD","BANK_TRANSFER","CHECK","OTHER"],"type":"string"},"frequency":{"enum":["DAILY","WEEKLY","MONTHLY","QUARTERLY","YEARLY"],"type":"string"},"start_date":{"type":"string","format":"date","example":"2026-07-01","description":"First occurrence date."},"end_date":{"type":"string","format":"date","example":"2027-06-30","description":"Last occurrence date. Omit for open-ended."},"branch_id":{"type":"string","format":"uuid","description":"The branch that carries the cost; the sales report only counts branch expenses."},"category_id":{"type":"string","format":"uuid"},"supplier_id":{"type":"string","format":"uuid"},"is_active":{"type":"boolean","description":"Deactivate to stop generating new instances."}},"title":"UpdateRecurringScheduleDto"},"ExpenseCategoryDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"restaurant_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"name_ar":{"type":"string","nullable":true},"is_active":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","restaurant_id","name","name_ar","is_active","created_at","updated_at"],"title":"ExpenseCategoryDto"},"ExpenseCategoryListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseCategoryDto"}},"pagination":{"$ref":"#/components/schemas/PaginationMetaDto"}},"required":["data","pagination"],"title":"ExpenseCategoryListDto"},"CreateExpenseCategoryDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Utilities"},"name_ar":{"type":"string","maxLength":100,"example":"المرافق"},"is_active":{"type":"boolean","example":true}},"required":["name"],"title":"CreateExpenseCategoryDto"},"UpdateExpenseCategoryDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"example":"Utilities"},"name_ar":{"type":"string","maxLength":100,"example":"المرافق"},"is_active":{"type":"boolean","example":true}},"title":"UpdateExpenseCategoryDto"}}}}