diff --git a/airbyte-integrations/connectors/source-avni/Dockerfile b/airbyte-integrations/connectors/source-avni/Dockerfile index cb3759ec2e5e9..7cabf21c80e55 100644 --- a/airbyte-integrations/connectors/source-avni/Dockerfile +++ b/airbyte-integrations/connectors/source-avni/Dockerfile @@ -1,33 +1,32 @@ FROM python:3.9.11-alpine3.15 as base -# build and load all requirements +# Build and load all requirements FROM base as builder WORKDIR /airbyte/integration_code -# upgrade pip to the latest version +# Upgrade pip to the latest version and install build dependencies RUN apk --no-cache upgrade \ && pip install --upgrade pip \ - && apk --no-cache add tzdata build-base - + && apk --no-cache add tzdata build-base libffi-dev openssl-dev COPY setup.py ./ -# install necessary packages to a temporary folder +# Install necessary packages to a temporary folder RUN pip install --prefix=/install . -# build a clean environment +# Build a clean environment FROM base WORKDIR /airbyte/integration_code -# copy all loaded and built libraries to a pure basic image +# Copy all loaded and built libraries to a pure basic image COPY --from=builder /install /usr/local -# add default timezone settings +# Add default timezone settings COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime RUN echo "Etc/UTC" > /etc/timezone -# bash is installed for more convenient debugging. +# Bash is installed for more convenient debugging. RUN apk --no-cache add bash -# copy payload code only +# Copy payload code only COPY main.py ./ COPY source_avni ./source_avni diff --git a/airbyte-integrations/connectors/source-avni/setup.py b/airbyte-integrations/connectors/source-avni/setup.py index b5f12bb51f556..4aead2c068a7d 100644 --- a/airbyte-integrations/connectors/source-avni/setup.py +++ b/airbyte-integrations/connectors/source-avni/setup.py @@ -8,6 +8,7 @@ MAIN_REQUIREMENTS = [ "airbyte-cdk~=0.1", "boto3==1.18.0", + "pytz==2024.1", ] TEST_REQUIREMENTS = [ diff --git a/airbyte-integrations/connectors/source-avni/source_avni/manifest.yaml b/airbyte-integrations/connectors/source-avni/source_avni/manifest.yaml index b769efd251494..2928117a1e075 100644 --- a/airbyte-integrations/connectors/source-avni/source_avni/manifest.yaml +++ b/airbyte-integrations/connectors/source-avni/source_avni/manifest.yaml @@ -29,7 +29,7 @@ definitions: field_name: "size" pagination_strategy: type: "PageIncrement" - page_size: 100 + page_size: 20 page_token_option: type: "RequestOption" inject_into: "request_parameter" @@ -103,18 +103,29 @@ definitions: $parameters: path: "/encounters" + approval_status_stream: + $ref: "#/definitions/base_stream" + name: "approvalStatuses" + primary_key: "Entity ID" + incremental_sync: + $ref: "#/definitions/incremental_base" + transformations: + $ref: "#/definitions/transformations_base" + $parameters: + path: "/approvalStatuses" + streams: - "#/definitions/subjects_stream" - "#/definitions/program_enrolments_stream" - "#/definitions/program_encounters_stream" - "#/definitions/encounters_stream" + - "#/definitions/approval_status_stream" check: type: CheckStream stream_names: - "subjects" - spec: type: Spec documentation_url: https://docs.airbyte.com/integrations/sources/avni diff --git a/airbyte-integrations/connectors/source-avni/source_avni/schemas/approvalStatuses.json b/airbyte-integrations/connectors/source-avni/source_avni/schemas/approvalStatuses.json new file mode 100644 index 0000000000000..f5241fe241d46 --- /dev/null +++ b/airbyte-integrations/connectors/source-avni/source_avni/schemas/approvalStatuses.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "properties": { + "Entity ID": { + "type": "string" + }, + "Entity type": { + "type": "string" + }, + "Entity type ID": { + "type": "string" + }, + "Approval status": { + "type": "string" + }, + "Approval status comment": { + "type": ["null", "string"] + }, + "Status date time": { + "type": "string", + "format": "date-time" + }, + "last_modified_at": { + "type": "string", + "format": "YYYY-MM-DDTHH:mm:ss.sssZ" + }, + "audit": { + "type": "object", + "properties": { + "Created at": { + "type": "string", + "format": "date-time" + }, + "Last modified at": { + "type": ["null", "string"], + "format": "YYYY-MM-DDTHH:mm:ss.sssZ" + }, + "Created by": { + "type": "string" + }, + "Last modified by": { + "type": "string" + } + } + } + } + } +