openapi: 3.0.3
info:
  title: Repzo API - Rep
  version: 1.0.0
  description: OpenAPI specification for Repzo Rep (Sales Representative) endpoints.
servers:
  - url: https://sv.api.repzo.me
paths:
  /rep:
    get:
      summary: Find reps
      operationId: findReps
      parameters:
        - in: query
          name: params
          schema:
            type: object
            properties:
              _id:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              search:
                type: string
              name:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              team_id:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              password:
                type: string
              email:
                type: string
              phone:
                type: string
              username:
                type: string
              disabled:
                type: boolean
              role:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              from_updatedAt:
                type: number
              from__id:
                type: string
              to__id:
                type: string
              createdAt:
                type: number
              updatedAt:
                type: number
              identifier:
                oneOf:
                  - type: array
                    items:
                      type: number
                  - type: number
              msl_sales:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              job_category:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              assigned_warehouse:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              assigned_main_warehouse:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              assigned_plan:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              force_online_connectivity:
                type: boolean
              assigned_targets:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              assigned_geo_zones:
                description: Filter by assigned geo-zone `_id`s.
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              lines:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              job_option:
                oneOf:
                  - type: array
                    items:
                      type: number
                      enum: [0, 1, 2]
                  - type: number
                    enum: [0, 1, 2]
              is_test:
                type: boolean
              form_v2_option:
                type: string
                enum: ["all", "none", "assigned", "client_assigned"]
              assigned_forms_v2:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              retail_execution_template_option:
                type: string
                enum: ["all", "client_assigned", "assigned", "none"]
              assigned_retail_execution_templates:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              assigned_shift:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              media:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              cover_photo:
                type: string
              last_login_time:
                type: number
              populatedKeys:
                type: array
                items:
                  type: string
                  enum:
                    [
                      "line",
                      "lines",
                      "job_category",
                      "teams",
                      "assigned_forms_v2",
                      "cover_photo",
                      "assigned_plan",
                      "assigned_retail_execution_templates",
                      "assigned_geo_zones",
                      "assigned_shift",
                      "warehouse",
                    ]
              withProductLines:
                type: boolean
              withStatus:
                type: boolean
              sortBy:
                type: array
                items:
                  type: object
                  properties:
                    field:
                      type: string
                      enum: [_id]
                    type:
                      type: string
                      enum: [asc, desc]
              "permissions.rep_can_add_client":
                type: boolean
              "permissions.rep_can_edit_client":
                type: boolean
              "permissions.rep_can_add_calendar":
                type: boolean
              "permissions.rep_can_edit_calendar":
                type: boolean
              "permissions.rep_can_skip_photo_tag":
                type: boolean
              "permissions.rep_can_edit_others_calendar":
                type: boolean
              "permissions.rep_can_edit_product_price":
                type: boolean
              "permissions.rep_must_add_client_with_location":
                type: boolean
              "permissions.rep_can_access_shared_history":
                type: boolean
              "permissions.rep_can_edit_total_shelf_share":
                type: boolean
              "permissions.rep_can_create_transfer":
                type: boolean
              "permissions.rep_can_make_call":
                type: boolean
              "permissions.rep_can_read_stock":
                type: boolean
              "permissions.can_rep_pay_other_reps_invoices":
                type: boolean
              "permissions.rep_can_create_sales_order":
                type: boolean
              "permissions.rep_can_create_invoice":
                type: boolean
              "permissions.rep_can_create_transfer_load":
                type: boolean
              "permissions.rep_can_create_transfer_unload":
                type: boolean
              "permissions.rep_can_create_return_invoice":
                type: boolean
              "permissions.rep_can_create_partial_return_invoice":
                type: boolean
              "permissions.rep_can_sell_zero_product_price":
                type: boolean
              "permissions.rep_can_create_sales_order_out_of_visit":
                type: boolean
              "permissions.rep_can_create_cash_invoice":
                type: boolean
              "permissions.rep_can_sell_above_product_price":
                type: boolean
              "permissions.rep_can_sell_below_product_price":
                type: boolean
              "permissions.rep_can_create_return_out_of_visit":
                type: boolean
              "permissions.rep_can_create_partial_return_out_of_visit":
                type: boolean
              "permissions.rep_can_skip_return_reason":
                type: boolean
              "permissions.rep_can_create_invoice_out_of_visit":
                type: boolean
              "permissions.rep_can_create_free_payments":
                type: boolean
              "permissions.rep_can_partially_pay_invoice":
                type: boolean
              "permissions.auto_close_visit_when_out_of_geo_fence":
                type: boolean
              "permissions.end_visit_when_out_of_geofence":
                type: boolean
              "permissions.end_visit_when_low_accuracy":
                type: boolean
              "permissions.rep_can_create_workorder":
                type: boolean
              "permissions.rep_can_create_asset":
                type: boolean
              "permissions.rep_can_skip_promotions":
                type: boolean
              "permissions.rep_can_skip_item_status_feedback":
                type: boolean
              "permissions.rep_can_skip_item_status_note":
                type: boolean
              "permissions.rep_can_skip_item_status_type":
                type: boolean
              "permissions.rep_can_end_visit_without_submitting_item_status":
                type: boolean
              "permissions.rep_can_submit_multiple_item_status_products":
                type: boolean
              "permissions.rep_can_edit_return_product_price":
                type: boolean
              "permissions.rep_can_skip_cart_calculation_until_checkout":
                type: boolean
              "permissions.rep_can_start_day_without_gps_signal":
                type: boolean
              "permissions.rep_can_create_add_client_approval_request":
                type: boolean
              "permissions.rep_can_create_edit_client_details_approval_request":
                type: boolean
              "permissions.rep_can_create_edit_client_assigned_to_approval_request":
                type: boolean
              "permissions.rep_can_create_edit_client_location_approval_request":
                type: boolean
              "permissions.rep_can_create_delete_client_approval_request":
                type: boolean
              "permissions.rep_can_create_skip_job_at_visit_end_approval_request":
                type: boolean
              "permissions.rep_can_create_skip_geofence_at_visit_end_approval_request":
                type: boolean
              "permissions.rep_can_start_visit_out_of_geofence":
                type: boolean
              "permissions.rep_can_create_approval_request_to_start_visit_out_of_geofence":
                type: boolean
              "permissions.rep_can_create_credit_invoice_for_cash_client":
                type: boolean
              "permissions.rep_can_view_client_credit_limit":
                type: boolean
              "permissions.rep_can_create_edit_client_credit_limit_approval_request":
                type: boolean
              "permissions.rep_can_assign_workorder":
                type: boolean
              "permissions.rep_can_visit_outside_route":
                type: boolean
              "permissions.rep_can_edit_retail_execution_entry":
                type: boolean
              "permissions.rep_can_edit_form_entry":
                type: boolean
              "permissions.rep_can_skip_visit_from_route_sequence":
                type: boolean
              "permissions.rep_can_create_return_sales_order":
                type: boolean
              "permissions.rep_can_edit_sales_order_custom_status":
                type: boolean
              "permissions.rep_can_edit_invoice_custom_status":
                type: boolean
              "permissions.rep_can_start_day_with_outstanding_settlement_balance":
                type: boolean
              "permissions.rep_to_create_invoice_variant_batch_from_assigned_warehouse":
                type: boolean
              "permissions.rep_to_create_sales_order_variant_batch_assigned_main_warehouse":
                type: boolean
              "permissions.rep_can_create_pull_from_client_assigned_to_approval_request":
                type: boolean
              "permissions.rep_must_end_day_after_specific_time":
                type: boolean
              "permissions.rep_must_start_day_within_shift_window":
                type: boolean
              "permissions.rep_must_end_day_within_shift_window":
                type: boolean
              "permissions.rep_can_start_day_on_non_working_day":
                type: boolean
              "permissions.rep_can_create_negative_invoice":
                type: boolean
              "settings.rep_must_end_day_after":
                type: string
                pattern: "^[0-9]{1,2}:[0-9]{2}$"
              "settings.allowable_accuracy":
                type: number
              "settings.is_item_status_per_visit_limited":
                type: boolean
              "settings.item_status_per_visit_limit":
                type: number
              "settings.location_permission":
                type: string
                enum: ["always_allow", "while_using"]
              "settings.activities_report_scope":
                type: string
                enum: ["self", "team", "company_namespace"]
              "settings.maximum_cash_outstanding_settlement_balance_to_start_day":
                type: number
              "settings.maximum_check_outstanding_settlement_balance_to_start_day":
                type: number
              "settings.maximum_total_outstanding_settlement_balance_to_start_day":
                type: number
              "settings.watermark_client_name":
                type: boolean
              "settings.watermark_time":
                type: boolean
              "settings.watermark_date":
                type: boolean
              "settings.watermark_coordinates":
                type: boolean
              "settings.start_day_minutes_before_shift_start":
                type: number
              "settings.start_day_minutes_after_shift_start":
                type: number
              "settings.end_day_minutes_before_shift_end":
                type: number
          description: Query parameters for filtering reps
      responses:
        "200":
          description: A list of reps
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepFindResult"
    post:
      summary: Create a rep
      operationId: createRep
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RepCreateBody"
      responses:
        "201":
          description: Rep created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepCreateResult"
  /rep/{id}:
    get:
      summary: Get a rep by ID
      operationId: getRep
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Rep details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepGetResult"
    put:
      summary: Update a rep
      operationId: updateRep
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RepUpdateBody"
      responses:
        "200":
          description: Rep updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepUpdateResult"
    delete:
      summary: Remove a rep
      operationId: removeRep
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Rep removed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepRemoveResult"
components:
  schemas:
    RepFindResult:
      type: object
      description: Result of finding reps
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/RepSchema"
        total_result:
          type: number
          description: Total number of reps
        current_count:
          type: number
          description: Count of reps in current page
        total_pages:
          type: number
          description: Total number of pages
        current_page:
          type: number
          description: Current page number
        per_page:
          type: number
          description: Number of reps per page
        first_page_url:
          type: string
          description: URL for the first page
        last_page_url:
          type: string
          description: URL for the last page
        next_page_url:
          type: string
          nullable: true
          description: URL for the next page
        prev_page_url:
          type: string
          nullable: true
          description: URL for the previous page
        path:
          type: string
          description: Base URL path
    RepSchema:
      type: object
      description: Rep schema
      properties:
        _id:
          type: string
          description: Unique identifier for the rep
        username:
          type: string
          description: Username of the rep
        name:
          type: string
          description: Name of the rep
        password:
          type: string
          description: Password for the rep account
        device_id:
          type: string
          description: Device ID associated with the rep
        linked_to_device:
          type: boolean
          description: Whether the rep is linked to a device
        live_location:
          type: boolean
          description: Whether live location is enabled for the rep
        phone:
          type: string
          description: Phone number of the rep
        email:
          type: string
          description: Email of the rep
        integration_id:
          type: string
          description: Integration ID for the rep
        role:
          type: string
          description: Role of the rep
        team_id:
          type: string
          description: ID of the team the rep belongs to
        disabled:
          type: boolean
          description: Whether the rep is disabled
        permissions:
          type: object
          description: Rep permissions
          properties:
            rep_can_add_client:
              type: boolean
              description: Can rep add clients
            rep_can_edit_client:
              type: boolean
              description: Can rep edit clients
            rep_can_add_calendar:
              type: boolean
              description: Can rep add to calendar
            rep_can_edit_calendar:
              type: boolean
              description: Can rep edit calendar
            rep_can_skip_photo_tag:
              type: boolean
              description: Can rep skip photo tag
            rep_can_edit_others_calendar:
              type: boolean
              description: Can rep edit others calendar
            rep_can_edit_product_price:
              type: boolean
              description: Can rep edit product price
            rep_must_add_client_with_location:
              type: boolean
              description: Rep must add client with location
            rep_can_access_shared_history:
              type: boolean
              description: Can rep access shared history
            rep_can_edit_total_shelf_share:
              type: boolean
              description: Can rep edit total shelf share
            rep_can_create_transfer:
              type: boolean
              description: Can rep create transfer
            rep_can_make_call:
              type: boolean
              description: Can rep make call
            rep_can_read_stock:
              type: boolean
              description: Can rep read stock
            can_rep_pay_other_reps_invoices:
              type: boolean
              description: Can rep pay other reps invoices
            rep_can_create_sales_order:
              type: boolean
              description: Can rep create sales order
            rep_can_create_invoice:
              type: boolean
              description: Can rep create invoice
            rep_can_create_transfer_load:
              type: boolean
              description: Can rep create transfer load
            rep_can_create_transfer_unload:
              type: boolean
              description: Can rep create transfer unload
            rep_can_create_return_invoice:
              type: boolean
              description: Can rep create return invoice
            rep_can_create_partial_return_invoice:
              type: boolean
              description: Can rep create partial return invoice
            rep_can_sell_zero_product_price:
              type: boolean
              description: Can rep sell zero product price
            rep_can_create_sales_order_out_of_visit:
              type: boolean
              description: Can rep create sales order out of visit
            rep_can_create_cash_invoice:
              type: boolean
              description: Can rep create cash invoice
            rep_can_sell_above_product_price:
              type: boolean
              description: Can rep sell above product price
            rep_can_sell_below_product_price:
              type: boolean
              description: Can rep sell below product price
            rep_can_create_return_out_of_visit:
              type: boolean
              description: Can rep create return out of visit
            rep_can_create_partial_return_out_of_visit:
              type: boolean
              description: Can rep create partial return out of visit
            rep_can_skip_return_reason:
              type: boolean
              description: Can rep skip return reason
            rep_can_create_invoice_out_of_visit:
              type: boolean
              description: Can rep create invoice out of visit
            rep_can_create_free_payments:
              type: boolean
              description: Can rep create free payments
            rep_can_partially_pay_invoice:
              type: boolean
              description: Can rep partially pay invoice
            auto_close_visit_when_out_of_geo_fence:
              type: boolean
              description: Auto close visit when out of geo fence
            end_visit_when_out_of_geofence:
              type: boolean
              description: End visit when out of geofence
            end_visit_when_low_accuracy:
              type: boolean
              description: End visit when low accuracy
            rep_can_create_workorder:
              type: boolean
              description: Can rep create workorder
            rep_can_create_asset:
              type: boolean
              description: Can rep create asset
            rep_can_skip_promotions:
              type: boolean
              description: Can rep skip promotions
            rep_can_skip_item_status_feedback:
              type: boolean
              description: Can rep skip item status feedback
            rep_can_skip_item_status_note:
              type: boolean
              description: Can rep skip item status note
            rep_can_skip_item_status_type:
              type: boolean
              description: Can rep skip item status type
            rep_can_end_visit_without_submitting_item_status:
              type: boolean
              description: Can rep end visit without submitting item status
            rep_can_submit_multiple_item_status_products:
              type: boolean
              description: Can rep submit multiple item status products
            rep_can_edit_return_product_price:
              type: boolean
              description: Can rep edit return product price
            rep_can_skip_cart_calculation_until_checkout:
              type: boolean
              description: Can rep skip cart calculation until checkout
            rep_can_start_day_without_gps_signal:
              type: boolean
              description: Can rep start day without GPS signal
            rep_can_create_add_client_approval_request:
              type: boolean
              description: Can rep create add client approval request
            rep_can_create_edit_client_details_approval_request:
              type: boolean
              description: Can rep create edit client details approval request
            rep_can_create_edit_client_assigned_to_approval_request:
              type: boolean
              description: Can rep create edit client assigned to approval request
            rep_can_create_edit_client_location_approval_request:
              type: boolean
              description: Can rep create edit client location approval request
            rep_can_create_delete_client_approval_request:
              type: boolean
              description: Can rep create delete client approval request
            rep_can_create_skip_job_at_visit_end_approval_request:
              type: boolean
              description: Can rep create skip job at visit end approval request
            rep_can_create_skip_geofence_at_visit_end_approval_request:
              type: boolean
              description: Can rep create skip geofence at visit end approval request
            rep_can_start_visit_out_of_geofence:
              type: boolean
              description: Can rep start a visit while outside their geofence / geo zone
            rep_can_create_approval_request_to_start_visit_out_of_geofence:
              type: boolean
              description: Can rep create an approval request to start a visit while out of geofence
            rep_can_create_credit_invoice_for_cash_client:
              type: boolean
              description: Can rep create credit invoice for cash client
            rep_can_view_client_credit_limit:
              type: boolean
              description: Can rep view client credit limit
            rep_can_create_edit_client_credit_limit_approval_request:
              type: boolean
              description: Can rep create edit client credit limit approval request
            rep_can_assign_workorder:
              type: boolean
              description: Can rep assign workorder
            rep_can_visit_outside_route:
              type: boolean
              description: Can rep visit outside route
            rep_can_edit_retail_execution_entry:
              type: boolean
              description: Can rep edit retail execution entry
            rep_can_edit_form_entry:
              type: boolean
              description: Can rep edit form entry
            rep_can_skip_visit_from_route_sequence:
              type: boolean
              description: Can rep skip visit from route sequence
            rep_can_create_return_sales_order:
              type: boolean
              description: Can rep create return sales order
            rep_can_edit_sales_order_custom_status:
              type: boolean
              description: Can rep edit sales order custom status
            rep_can_edit_invoice_custom_status:
              type: boolean
              description: Can rep edit invoice custom status
            rep_can_start_day_with_outstanding_settlement_balance:
              type: boolean
              description: Can rep start day with outstanding settlement balance
            rep_to_create_invoice_variant_batch_from_assigned_warehouse:
              type: boolean
              description: Rep to create invoice variant batch from assigned warehouse
            rep_to_create_sales_order_variant_batch_assigned_main_warehouse:
              type: boolean
              description: Rep to create sales order variant batch assigned main warehouse
            rep_can_create_pull_from_client_assigned_to_approval_request:
              type: boolean
              description: Can rep create pull from client assigned to approval request
            rep_must_end_day_after_specific_time:
              type: boolean
              description: Rep must end day after specific time
            rep_must_start_day_within_shift_window:
              type: boolean
              description: When true, the rep may only open the day within the configured window around the assigned shift start.
            rep_must_end_day_within_shift_window:
              type: boolean
              description: When true, the rep may only end the day from the configured offset before the assigned shift end.
            rep_can_start_day_on_non_working_day:
              type: boolean
              description: When false, opening a day on an assigned-shift day off is rejected.
            rep_can_create_negative_invoice:
              type: boolean
              description: Rep can create negative invoice
        preferences:
          type: object
          description: Rep preferences
          properties:
            isLightModeEnabled:
              type: boolean
              description: Whether light mode is enabled
        profile_pic:
          type: string
          description: Profile picture URL
        teams:
          type: array
          items:
            type: string
          description: Teams assigned to the rep
        identifier:
          type: number
          description: Unique identifier number for the rep
        notification_id:
          type: string
          description: Notification ID
        monthly_sales_target:
          type: number
          description: Monthly sales target
        daily_target_visit:
          type: number
          description: Daily target visits
        sales_type:
          type: number
          enum: [1, 2]
          description: Sales type (1 or 2)
        job_option:
          type: number
          enum: [0, 1, 2]
          description: Job option (0, 1, or 2)
        msl_sales:
          type: array
          items:
            type: string
          description: MSL sales assignments
        job_category:
          type: array
          items:
            type: string
          description: Job categories assigned to the rep
        assigned_warehouse:
          type: string
          description: Assigned warehouse ID
        assigned_main_warehouse:
          type: string
          description: Assigned main warehouse ID
        assigned_plan:
          type: string
          description: Assigned plan ID
        force_online_connectivity:
          type: boolean
          description: Whether online connectivity is forced
        assigned_targets:
          type: array
          items:
            type: string
          description: Assigned targets
        assigned_geo_zones:
          type: array
          items:
            type: string
          description: "`_id`s of the geo zones assigned to this rep (ref `geo-zone`) — currently at most one."
        lines:
          type: array
          items:
            type: string
          description: Lines assigned to the rep
        targetResults:
          type: object
          description: Target results
          properties:
            totalPoints:
              type: number
              description: Total points achieved
            targetsCount:
              type: number
              description: Number of targets
            totalAchievements:
              type: number
              description: Total achievements
            averageAchievements:
              type: number
              description: Average achievements
            pointsCap:
              type: number
              description: Points cap
        previously_assigned_clients:
          type: array
          items:
            type: string
          description: Previously assigned clients
        freshchat_id:
          type: string
          description: Freshchat ID
        is_test:
          type: boolean
          description: Whether this is a test rep
        form_v2_option:
          type: string
          enum: ["all", "none", "assigned", "client_assigned"]
          description: Form v2 option
        assigned_forms_v2:
          type: array
          items:
            type: string
          description: Assigned forms v2
        retail_execution_template_option:
          type: string
          enum: ["all", "client_assigned", "assigned", "none"]
          description: Retail execution template option
        assigned_retail_execution_templates:
          type: array
          items:
            type: string
          description: Assigned retail execution templates
        assigned_shift:
          type: string
          nullable: true
          description: "`_id` of the day-shift assigned to this rep (ref `day-shift`). `null` when unassigned."
        customFields:
          type: object
          additionalProperties:
            oneOf:
              - type: boolean
              - type: string
              - type: number
          description: Custom fields
        media:
          type: array
          items:
            type: string
          description: Media files
        cover_photo:
          type: string
          description: Cover photo URL
        last_login_time:
          type: number
          description: Last login timestamp
        settings:
          type: object
          description: Rep settings
          properties:
            allowable_accuracy:
              type: number
              description: Allowable GPS accuracy
            is_item_status_per_visit_limited:
              type: boolean
              description: Whether item status per visit is limited
            item_status_per_visit_limit:
              type: number
              description: Item status per visit limit
            location_permission:
              type: string
              enum: ["always_allow", "while_using"]
              description: Location permission setting
            activities_report_scope:
              type: string
              enum: ["self", "team", "company_namespace"]
              description: Activities report scope
            maximum_cash_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum cash outstanding settlement balance to start day
            maximum_check_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum check outstanding settlement balance to start day
            maximum_total_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum total outstanding settlement balance to start day
            watermark_client_name:
              type: boolean
              description: Whether to watermark client name
            watermark_time:
              type: boolean
              description: Whether to watermark time
            watermark_date:
              type: boolean
              description: Whether to watermark date
            watermark_coordinates:
              type: boolean
              description: Whether to watermark coordinates
            rep_must_end_day_after:
              type: string
              pattern: "^[0-9]{1,2}:[0-9]{2}$"
              description: Time rep must end day after (HH:MM format)
            start_day_minutes_before_shift_start:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes before the assigned shift start from which the rep may open the day.
            start_day_minutes_after_shift_start:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes after the assigned shift start until which the rep may open the day when shift-window enforcement is enabled.
            end_day_minutes_before_shift_end:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes before the assigned shift end from which the rep may close the day when shift-window enforcement is enabled.
        integration_meta:
          type: object
          additionalProperties: true
          description: Integration metadata
        company_namespace:
          type: array
          items:
            type: string
          description: Company namespaces
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
        __v:
          type: number
          description: Version number
    RepCreateBody:
      type: object
      description: Body for creating a rep
      required:
        - username
        - name
        - password
        - company_namespace
      properties:
        username:
          type: string
          description: Username of the rep
        name:
          type: string
          description: Name of the rep
        password:
          type: string
          description: Password for the rep account
        device_id:
          type: string
          description: Device ID associated with the rep
        linked_to_device:
          type: boolean
          description: Whether the rep is linked to a device
        live_location:
          type: boolean
          description: Whether live location is enabled for the rep
        phone:
          type: string
          description: Phone number of the rep
        email:
          type: string
          description: Email of the rep
        integration_id:
          type: string
          description: Integration ID for the rep
        role:
          type: string
          description: Role of the rep
        team_id:
          type: string
          description: ID of the team the rep belongs to
        disabled:
          type: boolean
          description: Whether the rep is disabled
        permissions:
          type: object
          description: Rep permissions
          properties:
            rep_can_add_client:
              type: boolean
              description: Can rep add clients
            rep_can_edit_client:
              type: boolean
              description: Can rep edit clients
            rep_can_skip_photo_tag:
              type: boolean
              description: Can rep skip photo tag
            rep_can_edit_others_calendar:
              type: boolean
              description: Can rep edit others calendar
            rep_can_edit_product_price:
              type: boolean
              description: Can rep edit product price
            rep_must_add_client_with_location:
              type: boolean
              description: Rep must add client with location
            rep_can_access_shared_history:
              type: boolean
              description: Can rep access shared history
            rep_can_edit_total_shelf_share:
              type: boolean
              description: Can rep edit total shelf share
            rep_can_create_transfer:
              type: boolean
              description: Can rep create transfer
            rep_can_make_call:
              type: boolean
              description: Can rep make call
            rep_can_read_stock:
              type: boolean
              description: Can rep read stock
            can_rep_pay_other_reps_invoices:
              type: boolean
              description: Can rep pay other reps invoices
            rep_can_create_sales_order:
              type: boolean
              description: Can rep create sales order
            rep_can_create_invoice:
              type: boolean
              description: Can rep create invoice
            rep_can_create_transfer_load:
              type: boolean
              description: Can rep create transfer load
            rep_can_create_transfer_unload:
              type: boolean
              description: Can rep create transfer unload
            rep_can_create_return_invoice:
              type: boolean
              description: Can rep create return invoice
            rep_can_create_partial_return_invoice:
              type: boolean
              description: Can rep create partial return invoice
            rep_can_sell_zero_product_price:
              type: boolean
              description: Can rep sell zero product price
            rep_can_create_sales_order_out_of_visit:
              type: boolean
              description: Can rep create sales order out of visit
            rep_can_create_cash_invoice:
              type: boolean
              description: Can rep create cash invoice
            rep_can_sell_above_product_price:
              type: boolean
              description: Can rep sell above product price
            rep_can_sell_below_product_price:
              type: boolean
              description: Can rep sell below product price
            rep_can_create_return_out_of_visit:
              type: boolean
              description: Can rep create return out of visit
            rep_can_create_partial_return_out_of_visit:
              type: boolean
              description: Can rep create partial return out of visit
            rep_can_skip_return_reason:
              type: boolean
              description: Can rep skip return reason
            rep_can_create_invoice_out_of_visit:
              type: boolean
              description: Can rep create invoice out of visit
            rep_can_create_free_payments:
              type: boolean
              description: Can rep create free payments
            rep_can_partially_pay_invoice:
              type: boolean
              description: Can rep partially pay invoice
            auto_close_visit_when_out_of_geo_fence:
              type: boolean
              description: Auto close visit when out of geo fence
            end_visit_when_out_of_geofence:
              type: boolean
              description: End visit when out of geofence
            end_visit_when_low_accuracy:
              type: boolean
              description: End visit when low accuracy
            rep_can_create_workorder:
              type: boolean
              description: Can rep create workorder
            rep_can_create_asset:
              type: boolean
              description: Can rep create asset
            rep_can_skip_promotions:
              type: boolean
              description: Can rep skip promotions
            rep_can_skip_item_status_feedback:
              type: boolean
              description: Can rep skip item status feedback
            rep_can_skip_item_status_note:
              type: boolean
              description: Can rep skip item status note
            rep_can_skip_item_status_type:
              type: boolean
              description: Can rep skip item status type
            rep_can_end_visit_without_submitting_item_status:
              type: boolean
              description: Can rep end visit without submitting item status
            rep_can_submit_multiple_item_status_products:
              type: boolean
              description: Can rep submit multiple item status products
            rep_can_edit_return_product_price:
              type: boolean
              description: Can rep edit return product price
            rep_can_skip_cart_calculation_until_checkout:
              type: boolean
              description: Can rep skip cart calculation until checkout
            rep_can_start_day_without_gps_signal:
              type: boolean
              description: Can rep start day without GPS signal
            rep_can_create_add_client_approval_request:
              type: boolean
              description: Can rep create add client approval request
            rep_can_create_edit_client_details_approval_request:
              type: boolean
              description: Can rep create edit client details approval request
            rep_can_create_edit_client_assigned_to_approval_request:
              type: boolean
              description: Can rep create edit client assigned to approval request
            rep_can_create_edit_client_location_approval_request:
              type: boolean
              description: Can rep create edit client location approval request
            rep_can_create_delete_client_approval_request:
              type: boolean
              description: Can rep create delete client approval request
            rep_can_create_skip_job_at_visit_end_approval_request:
              type: boolean
              description: Can rep create skip job at visit end approval request
            rep_can_create_skip_geofence_at_visit_end_approval_request:
              type: boolean
              description: Can rep create skip geofence at visit end approval request
            rep_can_start_visit_out_of_geofence:
              type: boolean
              description: Can rep start a visit while outside their geofence / geo zone
            rep_can_create_approval_request_to_start_visit_out_of_geofence:
              type: boolean
              description: Can rep create an approval request to start a visit while out of geofence
            rep_can_create_credit_invoice_for_cash_client:
              type: boolean
              description: Can rep create credit invoice for cash client
            rep_can_view_client_credit_limit:
              type: boolean
              description: Can rep view client credit limit
            rep_can_create_edit_client_credit_limit_approval_request:
              type: boolean
              description: Can rep create edit client credit limit approval request
            rep_can_assign_workorder:
              type: boolean
              description: Can rep assign workorder
            rep_can_visit_outside_route:
              type: boolean
              description: Can rep visit outside route
            rep_can_edit_retail_execution_entry:
              type: boolean
              description: Can rep edit retail execution entry
            rep_can_edit_form_entry:
              type: boolean
              description: Can rep edit form entry
            rep_can_skip_visit_from_route_sequence:
              type: boolean
              description: Can rep skip visit from route sequence
            rep_can_create_return_sales_order:
              type: boolean
              description: Can rep create return sales order
            rep_can_edit_sales_order_custom_status:
              type: boolean
              description: Can rep edit sales order custom status
            rep_can_edit_invoice_custom_status:
              type: boolean
              description: Can rep edit invoice custom status
            rep_can_start_day_with_outstanding_settlement_balance:
              type: boolean
              description: Can rep start day with outstanding settlement balance
            rep_to_create_invoice_variant_batch_from_assigned_warehouse:
              type: boolean
              description: Rep to create invoice variant batch from assigned warehouse
            rep_to_create_sales_order_variant_batch_assigned_main_warehouse:
              type: boolean
              description: Rep to create sales order variant batch assigned main warehouse
            rep_can_create_pull_from_client_assigned_to_approval_request:
              type: boolean
              description: Can rep create pull from client assigned to approval request
            rep_must_end_day_after_specific_time:
              type: boolean
              description: Rep must end day after specific time
            rep_must_start_day_within_shift_window:
              type: boolean
              description: When true, the rep may only open the day within the configured window around the assigned shift start.
            rep_must_end_day_within_shift_window:
              type: boolean
              description: When true, the rep may only end the day from the configured offset before the assigned shift end.
            rep_can_start_day_on_non_working_day:
              type: boolean
              description: When false, opening a day on an assigned-shift day off is rejected.
            rep_can_create_negative_invoice:
              type: boolean
              description: Rep can create negative invoice
        preferences:
          type: object
          description: Rep preferences
          properties:
            isLightModeEnabled:
              type: boolean
              description: Whether light mode is enabled
        profile_pic:
          type: string
          description: Profile picture URL
        teams:
          type: array
          items:
            type: string
          description: Teams assigned to the rep
        identifier:
          type: number
          description: Unique identifier number for the rep
        notification_id:
          type: string
          description: Notification ID
        monthly_sales_target:
          type: number
          description: Monthly sales target
        daily_target_visit:
          type: number
          description: Daily target visits
        sales_type:
          type: number
          enum: [1, 2]
          description: Sales type (1 or 2)
        job_option:
          type: number
          enum: [0, 1, 2]
          description: Job option (0, 1, or 2)
        msl_sales:
          type: array
          items:
            type: string
          description: MSL sales assignments
        job_category:
          type: array
          items:
            type: string
          description: Job categories assigned to the rep
        assigned_warehouse:
          type: string
          description: Assigned warehouse ID
        assigned_main_warehouse:
          type: string
          description: Assigned main warehouse ID
        assigned_plan:
          type: string
          description: Assigned plan ID
        force_online_connectivity:
          type: boolean
          description: Whether online connectivity is forced
        assigned_targets:
          type: array
          items:
            type: string
          description: Assigned targets
        assigned_geo_zones:
          type: array
          items:
            type: string
          description: "`_id`s of the geo zones assigned to this rep (ref `geo-zone`) — currently at most one."
        lines:
          type: array
          items:
            type: string
          description: Lines assigned to the rep
        targetResults:
          type: object
          description: Target results
          properties:
            totalPoints:
              type: number
              description: Total points achieved
            targetsCount:
              type: number
              description: Number of targets
            totalAchievements:
              type: number
              description: Total achievements
            averageAchievements:
              type: number
              description: Average achievements
            pointsCap:
              type: number
              description: Points cap
        previously_assigned_clients:
          type: array
          items:
            type: string
          description: Previously assigned clients
        freshchat_id:
          type: string
          description: Freshchat ID
        is_test:
          type: boolean
          description: Whether this is a test rep
        form_v2_option:
          type: string
          enum: ["all", "none", "assigned", "client_assigned"]
          description: Form v2 option
        assigned_forms_v2:
          type: array
          items:
            type: string
          description: Assigned forms v2
        retail_execution_template_option:
          type: string
          enum: ["all", "client_assigned", "assigned", "none"]
          description: Retail execution template option
        assigned_retail_execution_templates:
          type: array
          items:
            type: string
          description: Assigned retail execution templates
        assigned_shift:
          type: string
          nullable: true
          description: "`_id` of the day-shift to assign to this rep (ref `day-shift`). Must reference an existing, active shift in the caller's namespace. Send `null` to clear the assignment."
        customFields:
          type: object
          additionalProperties:
            oneOf:
              - type: boolean
              - type: string
              - type: number
          description: Custom fields
        media:
          type: array
          items:
            type: string
          description: Media files
        cover_photo:
          type: string
          description: Cover photo URL
        last_login_time:
          type: number
          description: Last login timestamp
        settings:
          type: object
          description: Rep settings
          properties:
            allowable_accuracy:
              type: number
              description: Allowable GPS accuracy
            is_item_status_per_visit_limited:
              type: boolean
              description: Whether item status per visit is limited
            item_status_per_visit_limit:
              type: number
              description: Item status per visit limit
            location_permission:
              type: string
              enum: ["always_allow", "while_using"]
              description: Location permission setting
            activities_report_scope:
              type: string
              enum: ["self", "team", "company_namespace"]
              description: Activities report scope
            maximum_cash_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum cash outstanding settlement balance to start day
            maximum_check_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum check outstanding settlement balance to start day
            maximum_total_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum total outstanding settlement balance to start day
            watermark_client_name:
              type: boolean
              description: Whether to watermark client name
            watermark_time:
              type: boolean
              description: Whether to watermark time
            watermark_date:
              type: boolean
              description: Whether to watermark date
            watermark_coordinates:
              type: boolean
              description: Whether to watermark coordinates
            rep_must_end_day_after:
              type: string
              pattern: "^[0-9]{1,2}:[0-9]{2}$"
              description: Time rep must end day after (HH:MM format)
            start_day_minutes_before_shift_start:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes before the assigned shift start from which the rep may open the day.
            start_day_minutes_after_shift_start:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes after the assigned shift start until which the rep may open the day when shift-window enforcement is enabled.
            end_day_minutes_before_shift_end:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes before the assigned shift end from which the rep may close the day when shift-window enforcement is enabled.
        integration_meta:
          type: object
          additionalProperties: true
          description: Integration metadata
        company_namespace:
          type: array
          items:
            type: string
          description: Company namespaces
    RepCreateResult:
      $ref: "#/components/schemas/RepSchema"
      description: Result of creating a rep
    RepGetResult:
      $ref: "#/components/schemas/RepSchema"
      description: Result of getting a rep
    RepUpdateBody:
      type: object
      description: Body for updating a rep
      properties:
        username:
          type: string
          description: Username of the rep
        name:
          type: string
          description: Name of the rep
        password:
          type: string
          description: Password for the rep account
        device_id:
          type: string
          description: Device ID associated with the rep
        linked_to_device:
          type: boolean
          description: Whether the rep is linked to a device
        live_location:
          type: boolean
          description: Whether live location is enabled for the rep
        phone:
          type: string
          description: Phone number of the rep
        email:
          type: string
          description: Email of the rep
        integration_id:
          type: string
          description: Integration ID for the rep
        role:
          type: string
          description: Role of the rep
        team_id:
          type: string
          description: ID of the team the rep belongs to
        disabled:
          type: boolean
          description: Whether the rep is disabled
        permissions:
          type: object
          description: Rep permissions
          properties:
            rep_can_add_client:
              type: boolean
              description: Can rep add clients
            rep_can_edit_client:
              type: boolean
              description: Can rep edit clients
            rep_can_skip_photo_tag:
              type: boolean
              description: Can rep skip photo tag
            rep_can_edit_others_calendar:
              type: boolean
              description: Can rep edit others calendar
            rep_can_edit_product_price:
              type: boolean
              description: Can rep edit product price
            rep_must_add_client_with_location:
              type: boolean
              description: Rep must add client with location
            rep_can_access_shared_history:
              type: boolean
              description: Can rep access shared history
            rep_can_edit_total_shelf_share:
              type: boolean
              description: Can rep edit total shelf share
            rep_can_create_transfer:
              type: boolean
              description: Can rep create transfer
            rep_can_make_call:
              type: boolean
              description: Can rep make call
            rep_can_read_stock:
              type: boolean
              description: Can rep read stock
            can_rep_pay_other_reps_invoices:
              type: boolean
              description: Can rep pay other reps invoices
            rep_can_create_sales_order:
              type: boolean
              description: Can rep create sales order
            rep_can_create_invoice:
              type: boolean
              description: Can rep create invoice
            rep_can_create_transfer_load:
              type: boolean
              description: Can rep create transfer load
            rep_can_create_transfer_unload:
              type: boolean
              description: Can rep create transfer unload
            rep_can_create_return_invoice:
              type: boolean
              description: Can rep create return invoice
            rep_can_create_partial_return_invoice:
              type: boolean
              description: Can rep create partial return invoice
            rep_can_sell_zero_product_price:
              type: boolean
              description: Can rep sell zero product price
            rep_can_create_sales_order_out_of_visit:
              type: boolean
              description: Can rep create sales order out of visit
            rep_can_create_cash_invoice:
              type: boolean
              description: Can rep create cash invoice
            rep_can_sell_above_product_price:
              type: boolean
              description: Can rep sell above product price
            rep_can_sell_below_product_price:
              type: boolean
              description: Can rep sell below product price
            rep_can_create_return_out_of_visit:
              type: boolean
              description: Can rep create return out of visit
            rep_can_create_partial_return_out_of_visit:
              type: boolean
              description: Can rep create partial return out of visit
            rep_can_skip_return_reason:
              type: boolean
              description: Can rep skip return reason
            rep_can_create_invoice_out_of_visit:
              type: boolean
              description: Can rep create invoice out of visit
            rep_can_create_free_payments:
              type: boolean
              description: Can rep create free payments
            rep_can_partially_pay_invoice:
              type: boolean
              description: Can rep partially pay invoice
            auto_close_visit_when_out_of_geo_fence:
              type: boolean
              description: Auto close visit when out of geo fence
            end_visit_when_out_of_geofence:
              type: boolean
              description: End visit when out of geofence
            end_visit_when_low_accuracy:
              type: boolean
              description: End visit when low accuracy
            rep_can_create_workorder:
              type: boolean
              description: Can rep create workorder
            rep_can_create_asset:
              type: boolean
              description: Can rep create asset
            rep_can_skip_promotions:
              type: boolean
              description: Can rep skip promotions
            rep_can_skip_item_status_feedback:
              type: boolean
              description: Can rep skip item status feedback
            rep_can_skip_item_status_note:
              type: boolean
              description: Can rep skip item status note
            rep_can_skip_item_status_type:
              type: boolean
              description: Can rep skip item status type
            rep_can_end_visit_without_submitting_item_status:
              type: boolean
              description: Can rep end visit without submitting item status
            rep_can_submit_multiple_item_status_products:
              type: boolean
              description: Can rep submit multiple item status products
            rep_can_edit_return_product_price:
              type: boolean
              description: Can rep edit return product price
            rep_can_skip_cart_calculation_until_checkout:
              type: boolean
              description: Can rep skip cart calculation until checkout
            rep_can_start_day_without_gps_signal:
              type: boolean
              description: Can rep start day without GPS signal
            rep_can_create_add_client_approval_request:
              type: boolean
              description: Can rep create add client approval request
            rep_can_create_edit_client_details_approval_request:
              type: boolean
              description: Can rep create edit client details approval request
            rep_can_create_edit_client_assigned_to_approval_request:
              type: boolean
              description: Can rep create edit client assigned to approval request
            rep_can_create_edit_client_location_approval_request:
              type: boolean
              description: Can rep create edit client location approval request
            rep_can_create_delete_client_approval_request:
              type: boolean
              description: Can rep create delete client approval request
            rep_can_create_skip_job_at_visit_end_approval_request:
              type: boolean
              description: Can rep create skip job at visit end approval request
            rep_can_create_skip_geofence_at_visit_end_approval_request:
              type: boolean
              description: Can rep create skip geofence at visit end approval request
            rep_can_start_visit_out_of_geofence:
              type: boolean
              description: Can rep start a visit while outside their geofence / geo zone
            rep_can_create_approval_request_to_start_visit_out_of_geofence:
              type: boolean
              description: Can rep create an approval request to start a visit while out of geofence
            rep_can_create_credit_invoice_for_cash_client:
              type: boolean
              description: Can rep create credit invoice for cash client
            rep_can_view_client_credit_limit:
              type: boolean
              description: Can rep view client credit limit
            rep_can_create_edit_client_credit_limit_approval_request:
              type: boolean
              description: Can rep create edit client credit limit approval request
            rep_can_assign_workorder:
              type: boolean
              description: Can rep assign workorder
            rep_can_visit_outside_route:
              type: boolean
              description: Can rep visit outside route
            rep_can_edit_retail_execution_entry:
              type: boolean
              description: Can rep edit retail execution entry
            rep_can_edit_form_entry:
              type: boolean
              description: Can rep edit form entry
            rep_can_skip_visit_from_route_sequence:
              type: boolean
              description: Can rep skip visit from route sequence
            rep_can_create_return_sales_order:
              type: boolean
              description: Can rep create return sales order
            rep_can_edit_sales_order_custom_status:
              type: boolean
              description: Can rep edit sales order custom status
            rep_can_edit_invoice_custom_status:
              type: boolean
              description: Can rep edit invoice custom status
            rep_can_start_day_with_outstanding_settlement_balance:
              type: boolean
              description: Can rep start day with outstanding settlement balance
            rep_to_create_invoice_variant_batch_from_assigned_warehouse:
              type: boolean
              description: Rep to create invoice variant batch from assigned warehouse
            rep_to_create_sales_order_variant_batch_assigned_main_warehouse:
              type: boolean
              description: Rep to create sales order variant batch assigned main warehouse
            rep_can_create_pull_from_client_assigned_to_approval_request:
              type: boolean
              description: Can rep create pull from client assigned to approval request
            rep_must_end_day_after_specific_time:
              type: boolean
              description: Rep must end day after specific time
            rep_must_start_day_within_shift_window:
              type: boolean
              description: When true, the rep may only open the day within the configured window around the assigned shift start.
            rep_must_end_day_within_shift_window:
              type: boolean
              description: When true, the rep may only end the day from the configured offset before the assigned shift end.
            rep_can_start_day_on_non_working_day:
              type: boolean
              description: When false, opening a day on an assigned-shift day off is rejected.
            rep_can_create_negative_invoice:
              type: boolean
              description: Rep can create negative invoice
        preferences:
          type: object
          description: Rep preferences
          properties:
            isLightModeEnabled:
              type: boolean
              description: Whether light mode is enabled
        profile_pic:
          type: string
          description: Profile picture URL
        teams:
          type: array
          items:
            type: string
          description: Teams assigned to the rep
        identifier:
          type: number
          description: Unique identifier number for the rep
        notification_id:
          type: string
          description: Notification ID
        monthly_sales_target:
          type: number
          description: Monthly sales target
        daily_target_visit:
          type: number
          description: Daily target visits
        sales_type:
          type: number
          enum: [1, 2]
          description: Sales type (1 or 2)
        job_option:
          type: number
          enum: [0, 1, 2]
          description: Job option (0, 1, or 2)
        msl_sales:
          type: array
          items:
            type: string
          description: MSL sales assignments
        job_category:
          type: array
          items:
            type: string
          description: Job categories assigned to the rep
        assigned_warehouse:
          type: string
          description: Assigned warehouse ID
        assigned_main_warehouse:
          type: string
          description: Assigned main warehouse ID
        assigned_plan:
          type: string
          description: Assigned plan ID
        force_online_connectivity:
          type: boolean
          description: Whether online connectivity is forced
        assigned_targets:
          type: array
          items:
            type: string
          description: Assigned targets
        assigned_geo_zones:
          type: array
          items:
            type: string
          description: "`_id`s of the geo zones assigned to this rep (ref `geo-zone`) — currently at most one."
        lines:
          type: array
          items:
            type: string
          description: Lines assigned to the rep
        targetResults:
          type: object
          description: Target results
          properties:
            totalPoints:
              type: number
              description: Total points achieved
            targetsCount:
              type: number
              description: Number of targets
            totalAchievements:
              type: number
              description: Total achievements
            averageAchievements:
              type: number
              description: Average achievements
            pointsCap:
              type: number
              description: Points cap
        previously_assigned_clients:
          type: array
          items:
            type: string
          description: Previously assigned clients
        freshchat_id:
          type: string
          description: Freshchat ID
        is_test:
          type: boolean
          description: Whether this is a test rep
        form_v2_option:
          type: string
          enum: ["all", "none", "assigned", "client_assigned"]
          description: Form v2 option
        assigned_forms_v2:
          type: array
          items:
            type: string
          description: Assigned forms v2
        retail_execution_template_option:
          type: string
          enum: ["all", "client_assigned", "assigned", "none"]
          description: Retail execution template option
        assigned_retail_execution_templates:
          type: array
          items:
            type: string
          description: Assigned retail execution templates
        assigned_shift:
          type: string
          nullable: true
          description: "`_id` of the day-shift to assign to this rep (ref `day-shift`). Must reference an existing, active shift in the caller's namespace. Send `null` to clear the assignment."
        customFields:
          type: object
          additionalProperties:
            oneOf:
              - type: boolean
              - type: string
              - type: number
          description: Custom fields
        media:
          type: array
          items:
            type: string
          description: Media files
        cover_photo:
          type: string
          description: Cover photo URL
        last_login_time:
          type: number
          description: Last login timestamp
        settings:
          type: object
          description: Rep settings
          properties:
            allowable_accuracy:
              type: number
              description: Allowable GPS accuracy
            is_item_status_per_visit_limited:
              type: boolean
              description: Whether item status per visit is limited
            item_status_per_visit_limit:
              type: number
              description: Item status per visit limit
            location_permission:
              type: string
              enum: ["always_allow", "while_using"]
              description: Location permission setting
            activities_report_scope:
              type: string
              enum: ["self", "team", "company_namespace"]
              description: Activities report scope
            maximum_cash_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum cash outstanding settlement balance to start day
            maximum_check_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum check outstanding settlement balance to start day
            maximum_total_outstanding_settlement_balance_to_start_day:
              type: number
              description: Maximum total outstanding settlement balance to start day
            watermark_client_name:
              type: boolean
              description: Whether to watermark client name
            watermark_time:
              type: boolean
              description: Whether to watermark time
            watermark_date:
              type: boolean
              description: Whether to watermark date
            watermark_coordinates:
              type: boolean
              description: Whether to watermark coordinates
            rep_must_end_day_after:
              type: string
              pattern: "^[0-9]{1,2}:[0-9]{2}$"
              description: Time rep must end day after (HH:MM format)
            start_day_minutes_before_shift_start:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes before the assigned shift start from which the rep may open the day.
            start_day_minutes_after_shift_start:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes after the assigned shift start until which the rep may open the day when shift-window enforcement is enabled.
            end_day_minutes_before_shift_end:
              type: number
              minimum: 0
              maximum: 240
              default: 0
              description: Minutes before the assigned shift end from which the rep may close the day when shift-window enforcement is enabled.
        integration_meta:
          type: object
          additionalProperties: true
          description: Integration metadata
        company_namespace:
          type: array
          items:
            type: string
          description: Company namespaces
        _id:
          type: string
          description: Unique identifier for the rep
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
        __v:
          type: number
          description: Version number
    RepUpdateResult:
      $ref: "#/components/schemas/RepSchema"
      description: Result of updating a rep
    RepRemoveResult:
      $ref: "#/components/schemas/RepSchema"
      description: Result of removing a rep
