Laurel Validation Rules API

The Validation Rules API from Laurel — 4 operation(s) for validation rules.

OpenAPI Specification

laurel-validation-rules-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Identity Service Ably Validation Rules API
  description: ''
  version: '1'
  contact: {}
servers: []
security:
- ApiBearerAuth: []
tags:
- name: Validation Rules
paths:
  /api/v1/validations/customers/{customerId}/initiatives/{initiativeExternalId}/rules:
    post:
      operationId: EntryValidationRulesController_setOneForInitiative_v1
      parameters:
      - name: customerId
        required: true
        in: path
        schema:
          format: objectid
          type: string
      - name: initiativeExternalId
        required: true
        in: path
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetInitiativeLevelEntryValidationRulesDto'
      responses:
        '201':
          description: ''
      tags:
      - Validation Rules
  /api/v1/validations/rules/applicable:
    get:
      operationId: EntryValidationRulesController_findApplicable_v1
      parameters:
      - name: initiativeId
        required: false
        in: query
        description: initiative's identifier
        schema:
          format: objectid
          nullable: true
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicableEntryValidationRules'
      tags:
      - Validation Rules
  /api/v1/validations/customers/{customerId}/rules:
    get:
      operationId: EntryValidationRulesController_findOneForCustomer_v1
      parameters:
      - name: customerId
        required: true
        in: path
        description: customer id
        schema:
          format: objectid
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntryValidationRules'
      tags:
      - Validation Rules
    post:
      operationId: EntryValidationRulesController_setOneForCustomer_v1
      parameters:
      - name: customerId
        required: true
        in: path
        description: customer id
        schema:
          format: objectid
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetEntryValidationRulesDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntryValidationRules'
      tags:
      - Validation Rules
  /api/v1/validations/customers/{customerId}/initiatives/{initiativeId}/rules:
    get:
      operationId: EntryValidationRulesController_findOneForInitiative_v1
      parameters:
      - name: customerId
        required: true
        in: path
        description: id of the customer who owns the resource
        schema:
          format: objectid
          type: string
      - name: initiativeId
        required: true
        in: path
        description: initiative id of the resource
        schema:
          format: objectid
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntryValidationRules'
      tags:
      - Validation Rules
components:
  schemas:
    EntryValidationRules:
      type: object
      properties:
        _id:
          type: string
          description: the identifier of the validation rules
          format: objectid
        canReleaseOnFutureDates:
          description: per-billability control for future-date release permission
          nullable: true
          type: object
          allOf:
          - $ref: '#/components/schemas/CanReleaseOnFutureDates'
        cannotReleaseNegativeIncrement:
          type: boolean
          description: whether if negative increments cannot be released or not
          nullable: true
        cannotReleaseZeroIncrement:
          type: boolean
          description: whether if zero increments cannot be released or not
          nullable: true
        isWorkingTimekeeperValidationEnabled:
          type: boolean
          description: whether working timekeeper validation is enabled (Super Laurel admins only)
          nullable: true
        customMessage:
          type: string
          description: firm-specific custom message shown when working timekeeper validation blocks an entry release
          maxLength: 1000
          minLength: 1
          nullable: true
        isDailyLimitValidationEnabled:
          type: boolean
          description: whether 24-hour daily release limit validation is enabled
          nullable: true
        allowEntryDateRestrictions:
          type: boolean
          description: whether entry date restrictions are allowed for this customer
          nullable: true
        allowNarrativeLineBreaks:
          type: boolean
          description: whether line breaks are allowed in the narrative/summary field (client-side enforcement)
          nullable: true
        createdAt:
          type: string
          description: the date and time these rules were first created
          example: '2022-08-12T20:44:48Z'
          format: iso-date-time
        customerId:
          type: string
          description: the identifier of customer who owns these validation rules
          format: objectid
        initiative:
          description: the initiative that these validation rules apply to
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/PmsInitiativeDigest'
          - $ref: '#/components/schemas/UserInitiativeDigest'
        isSummaryRequired:
          type: boolean
          description: whether summary is required for the entry or not
          nullable: true
        requiredCodeTypes:
          description: code type identifiers that are required for an entry
          default: []
          type: array
          items:
            $ref: '#/components/schemas/CodeTypeDigest'
        updatedAt:
          type: string
          description: the last date and time these rules were updated
          example: '2022-08-12T20:44:48Z'
          format: iso-date-time
        schemaVersion:
          type: string
          description: schema version
      required:
      - _id
      - createdAt
      - customerId
      - requiredCodeTypes
      - updatedAt
    CanReleaseOnFutureDates:
      type: object
      properties:
        billable:
          type: boolean
          description: whether billable entries can be released on future dates
        nonBillable:
          type: boolean
          description: whether non-billable entries can be released on future dates
      required:
      - billable
      - nonBillable
    UserInitiativeDigest:
      type: object
      properties:
        type:
          description: initiative's type
          enum:
          - user
          type: string
        _id:
          type: string
          description: initiative's id
          format: objectid
        billingType:
          description: initiative's billing type
          enum:
          - billable
          - non-billable
          type: string
        callSign:
          type: string
          description: a short name or abbreviation that identifies this pms initiative
          nullable: true
        unitIncrements:
          type: number
          description: unit of billing increments for this initiative
          format: double
        status:
          type: string
          description: 'initiative''s status (active/inactive). Optional for backwards compatibility

            with entries whose denormalized digest predates this field — those entries

            gain status on the next initiative update via natural digest propagation.'
          enum:
          - active
          - inactive
          nullable: true
        locale:
          type: string
          description: BCP-47 locale for this initiative (e.g. en-US, fr-CA)
          enum:
          - da-DK
          - de-DE
          - en-CA
          - en-GB
          - en-US
          - es-ES
          - es-MX
          - fi-FI
          - fr-CA
          - fr-FR
          - is-IS
          - it-IT
          - ko-KR
          - nl-NL
          - no-NO
          - pt-PT
          - sv-SE
          nullable: true
        name:
          type: string
          description: the name user has given this initiative
      required:
      - type
      - _id
      - billingType
      - unitIncrements
      - name
    CodeTypeDigest:
      type: object
      properties:
        _id:
          type: string
          description: code type's id
          format: objectid
        externalId:
          type: string
          description: code type's external id
        name:
          type: string
          description: code type's name
        semanticType:
          type: string
          description: code type's semantic type
          enum:
          - action
          - activity
          - location
          - phase
          - task
          nullable: true
        orderingSequence:
          type: string
          description: ordering sequence for UI sorting (alphanumeric)
          nullable: true
      required:
      - _id
      - externalId
      - name
    ApplicableEntryValidationRules:
      type: object
      properties:
        canReleaseOnFutureDates:
          description: per-billability control for future-date release permission (null = not yet migrated)
          nullable: true
          type: object
          allOf:
          - $ref: '#/components/schemas/CanReleaseOnFutureDates'
        cannotReleaseNegativeIncrement:
          type: boolean
          description: whether if negative increments cannot be released or not
        cannotReleaseZeroIncrement:
          type: boolean
          description: whether if zero increments cannot be released or not
        isSummaryRequired:
          type: boolean
          description: whether summary is required for the entry or not
        allowEntryDateRestrictions:
          type: boolean
          description: whether entry date restrictions are allowed for this customer
        allowNarrativeLineBreaks:
          type: boolean
          description: whether line breaks are allowed in the narrative/summary field (client-side enforcement)
        isWorkingTimekeeperValidationEnabled:
          type: boolean
          description: whether working timekeeper validation is enabled
        customMessage:
          type: string
          description: firm-specific custom message shown when working timekeeper validation blocks an entry release
          maxLength: 1000
          minLength: 1
          nullable: true
        isDailyLimitValidationEnabled:
          type: boolean
          description: whether 24-hour daily release limit validation is enabled
        requiredCodeTypes:
          description: code type identifiers that are required for an entry
          default: []
          type: array
          items:
            $ref: '#/components/schemas/CodeTypeDigest'
      required:
      - cannotReleaseNegativeIncrement
      - cannotReleaseZeroIncrement
      - isSummaryRequired
      - allowEntryDateRestrictions
      - allowNarrativeLineBreaks
      - isWorkingTimekeeperValidationEnabled
      - isDailyLimitValidationEnabled
      - requiredCodeTypes
    PmsInitiativeDigest:
      type: object
      properties:
        type:
          description: initiative's type
          enum:
          - pms
          - user
          type: string
        _id:
          type: string
          description: initiative's id
          format: objectid
        billingType:
          description: initiative's billing type
          enum:
          - billable
          - non-billable
          type: string
        callSign:
          type: string
          description: a short name or abbreviation that identifies this pms initiative
          nullable: true
        unitIncrements:
          type: number
          description: unit of billing increments for this initiative
          format: double
        status:
          type: string
          description: 'initiative''s status (active/inactive). Optional for backwards compatibility

            with entries whose denormalized digest predates this field — those entries

            gain status on the next initiative update via natural digest propagation.'
          enum:
          - active
          - inactive
          nullable: true
        locale:
          type: string
          description: BCP-47 locale for this initiative (e.g. en-US, fr-CA)
          enum:
          - da-DK
          - de-DE
          - en-CA
          - en-GB
          - en-US
          - es-ES
          - es-MX
          - fi-FI
          - fr-CA
          - fr-FR
          - is-IS
          - it-IT
          - ko-KR
          - nl-NL
          - no-NO
          - pt-PT
          - sv-SE
          nullable: true
        externalId:
          type: string
          description: initiative's external id
        name:
          type: string
          description: a short name or code that identifies this initiative
        description:
          type: string
          description: the full name of the initiative
        client:
          description: the client this initiative belongs to
          allOf:
          - $ref: '#/components/schemas/ClientDigest'
      required:
      - type
      - _id
      - billingType
      - unitIncrements
      - externalId
      - name
      - description
      - client
    SetEntryValidationRulesDto:
      type: object
      properties:
        cannotReleaseNegativeIncrement:
          type: boolean
          description: whether users can release negative increments or not
          nullable: false
        cannotReleaseZeroIncrement:
          type: boolean
          description: whether users can release zero increments or not
          nullable: false
        isSummaryRequired:
          type: boolean
          description: whether summary is required for an entry or not
          nullable: false
        isWorkingTimekeeperValidationEnabled:
          type: boolean
          description: whether working timekeeper validation is enabled (Super Laurel admins only)
          nullable: false
        customMessage:
          type: string
          description: firm-specific custom message shown when working timekeeper validation blocks an entry release
          maxLength: 1000
          minLength: 1
          nullable: true
        isDailyLimitValidationEnabled:
          type: boolean
          description: whether 24-hour daily release limit validation is enabled
          nullable: false
        allowEntryDateRestrictions:
          type: boolean
          description: whether entry date restrictions are allowed for this customer
          nullable: false
        allowNarrativeLineBreaks:
          type: boolean
          description: whether line breaks are allowed in the narrative/summary field (client-side enforcement)
          nullable: false
        requiredCodeTypeIds:
          description: code type identifiers that are required for an entry
          nullable: false
          type: array
          items:
            type: string
            format: objectid
        canReleaseOnFutureDates:
          description: per-billability control for future-date release permission
          allOf:
          - $ref: '#/components/schemas/CanReleaseOnFutureDates'
    ClientDigest:
      type: object
      properties:
        _id:
          type: string
          description: client's id
          format: objectid
        externalId:
          type: string
          description: client's external id
        name:
          type: string
          description: a name that identifies this client
        description:
          type: string
          description: client's description
        callSign:
          type: string
          description: a short name or abbreviation that identifies this client
        type:
          type: string
          description: client's type, default is client
          enum:
          - client
          - parent
          nullable: true
        parentClientId:
          type: string
          description: id of the parent client
          format: objectid
          nullable: true
      required:
      - _id
      - externalId
      - name
      - description
      - callSign
    SetInitiativeLevelEntryValidationRulesDto:
      type: object
      properties:
        requiredCodeTypeExternalIds:
          description: code type external identifiers that are required for an entry
          nullable: false
          type: array
          items:
            type: string
  securitySchemes:
    ApiBearerAuth:
      scheme: bearer
      bearerFormat: JWT
      description: Enter access token
      type: http
externalDocs:
  description: Laurel API Documentation
  url: https://developer.laurel.ai/