Skip to content

feat: add invoice_collection_risk_14d data product#2

Open
geneazad wants to merge 1 commit intomainfrom
feat/data-product/invoice_collection_risk_14d
Open

feat: add invoice_collection_risk_14d data product#2
geneazad wants to merge 1 commit intomainfrom
feat/data-product/invoice_collection_risk_14d

Conversation

@geneazad
Copy link
Copy Markdown
Owner

feat: add invoice_collection_risk_14d data product

Summary

  • Data product: invoice_collection_risk_14d
  • Owner: finance_ops
  • Domain: finance
  • Sharing policy: internal_only
  • Metric type: aggregate

Artifacts

  • Contract: contracts/invoice_collection_risk_14d.yaml
  • SQL: metrics/invoice_collection_risk_14d.sql
  • API spec: api-specs/invoice_collection_risk_14d.json

Publish Impact

  • Endpoint: /metrics/invoice_collection_risk_14d
  • Delivery method: api
  • Semantic query: metrics.invoice_collection_risk_14d

Human Approval Required

  • Approver role: finance_data_steward
  • Set lifecycle.status: approved in the contract before merge.

Generated API Spec

This spec is auto-generated from the contract. After publish, DPH will expose this endpoint with IAM-governed access.

openapi: 3.1.0
info:
  title: invoice_collection_risk_14d
  description: Total value of unpaid invoices due within the next 14 days.
  version: 1.0.0
  x-dph-owner: finance_ops
  x-dph-domain: finance
  x-dph-sharing-policy: internal_only
  x-dph-semantic-query: metrics.invoice_collection_risk_14d
servers:
- url: '{serviceUrl}'
  variables:
    serviceUrl:
      default: https://api.dataplatform.cloud.ibm.com
      description: DPH service URL (DI_SERVICE_URL)
paths:
  /metrics/invoice_collection_risk_14d:
    get:
      operationId: get_invoice_collection_risk_14d
      summary: Retrieve the invoice collection risk 14d metric
      description: 'Total value of unpaid invoices due within the next 14 days.


        **Semantic query:** `metrics.invoice_collection_risk_14d`'
      tags:
      - finance
      security:
      - BearerAuth: []
      parameters:
      - name: as_of
        in: query
        required: false
        schema:
          type: string
          format: date
        description: Compute the metric as of this date (ISO 8601). Defaults to today.
      responses:
        '200':
          description: Current value of `invoice_collection_risk_14d`
          content:
            application/json:
              schema:
                type: object
                properties:
                  value:
                    type: number
                    description: Computed aggregate value.
                  as_of:
                    type: string
                    format: date-time
                  data_product:
                    type: string
                required:
                - value
                - as_of
        '401':
          description: "Unauthorized \u2014 invalid or missing IAM token."
        '403':
          description: "Forbidden \u2014 IBM Cloud IAM token required. Internal use\
            \ only."
        '404':
          description: Metric not found or not yet published.
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: IBM Cloud IAM token (obtain via POST to https://iam.cloud.ibm.com/identity/token)

- Add generated OpenAPI 3.1 spec (api-specs/invoice_collection_risk_14d.json)
- Fix SSL certificate verification using certifi in DPH API client and GitHub automation
- Contract already approved by finance_data_steward (lifecycle.status: approved)
- Publishes to DPH via /metrics/invoice_collection_risk_14d endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant