Skip to content

Commit

Permalink
✨Source Square: Add new stream Cash Drawers (#31065)
Browse files Browse the repository at this point in the history
Co-authored-by: Mal Hancock <[email protected]>
  • Loading branch information
btkcodedev and archangelic authored Oct 12, 2023
1 parent 314e683 commit 2f6dcbc
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-square/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ COPY source_square ./source_square
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=1.1.3
LABEL io.airbyte.version=1.2.0
LABEL io.airbyte.name=airbyte/source-square
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ acceptance_tests:
bypass_reason: "Not able to fill stream"
- name: refunds
bypass_reason: "Not able to fill stream"
- name: cash_drawers
bypass_reason: "Not able to fill stream"
expect_records:
path: "integration_tests/expected_records_oauth.jsonl"
ignored_fields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@
"sync_mode": "incremental",
"cursor_field": ["updated_at"],
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "cash_drawers",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": true,
"default_cursor_field": ["id"]
},
"sync_mode": "full_refresh",
"cursor_field": ["id"],
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 77225a51-cd15-4a13-af02-65816bd0ecf4
dockerImageTag: 1.1.3
dockerImageTag: 1.2.0
dockerRepository: airbyte/source-square
documentationUrl: https://docs.airbyte.com/integrations/sources/square
githubIssueLabel: source-square
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,32 @@ definitions:
primary_key: "id"
path: "/locations"

locations_partition_router:
type: SubstreamPartitionRouter
parent_stream_configs:
- stream: "#/definitions/locations_stream"
parent_key: "id"
partition_field: "location_id"

cash_drawers_stream:
$ref: "#/definitions/base_stream"
$parameters:
name: "cash_drawers"
primary_key: "id"
path: "/cash-drawers/shifts"
retriever:
$ref: "#/definitions/retriever"
partition_router:
$ref: "#/definitions/locations_partition_router"
requester:
$ref: "#/definitions/requester"
request_parameters:
location_id: "{{ stream_partition.location_id }}"
record_selector:
$ref: "#/definitions/selector"
extractor:
field_path: ["cash_drawer_shifts"]

categories_stream:
$ref: "#/definitions/base_catalog_objects_stream"
$parameters:
Expand Down Expand Up @@ -303,6 +329,7 @@ streams:
- "#/definitions/refunds_stream"
- "#/definitions/payments_stream"
- "#/definitions/orders_stream"
- "#/definitions/cash_drawers_stream"

check:
stream_names:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Cash Drawer Shifts Schema",
"additionalProperties": true,
"type": ["object", "null"],
"properties": {
"id": {
"type": ["string", "null"]
},
"state": {
"type": ["string", "null"]
},
"opened_at": {
"type": ["string", "null"]
},
"ended_at": {
"type": ["string", "null"]
},
"closed_at": {
"type": ["string", "null"]
},
"description": {
"type": ["string", "null"]
},
"opened_cash_money": {
"type": ["object", "null"],
"properties": {
"amount": {
"type": ["number", "null"]
},
"currency": {
"type": ["string", "null"]
}
}
},
"expected_cash_money": {
"type": ["object", "null"],
"properties": {
"amount": {
"type": ["number", "null"]
},
"currency": {
"type": ["string", "null"]
}
}
},
"closed_cash_money": {
"type": ["object", "null"],
"properties": {
"amount": {
"type": ["number", "null"]
},
"currency": {
"type": ["string", "null"]
}
}
}
}
}
2 changes: 2 additions & 0 deletions docs/integrations/sources/square.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ The Square source connector supports the following [ sync modes](https://docs.ai
- [Customers](https://developer.squareup.com/explorer/square/customers-api/list-customers)
- [Shifts](https://developer.squareup.com/reference/square/labor-api/search-shifts)
- [Orders](https://developer.squareup.com/reference/square/orders-api/search-orders)
- [Cash drawers](https://developer.squareup.com/explorer/square/cash-drawers-api/list-cash-drawer-shifts)

## Connector-specific features & highlights

Expand Down Expand Up @@ -97,6 +98,7 @@ Exponential [Backoff](https://developer.squareup.com/forums/t/current-square-api

| Version | Date | Pull Request | Subject |
| :------ |:-----------| :------------------------------------------------------- |:--------------------------------------------------------------------------|
| 1.2.0 | 2023-10-10 | [31065](https://github.com/airbytehq/airbyte/pull/31065) | Add new stream Cash drawers shifts |
| 1.1.3 | 2023-10-10 | [30960](https://github.com/airbytehq/airbyte/pull/30960) | Update `airbyte-cdk` version to `>=0.51.31` |
| 1.1.2 | 2023-07-10 | [28019](https://github.com/airbytehq/airbyte/pull/28019) | fix display order of spec fields |
| 1.1.1 | 2023-06-28 | [27762](https://github.com/airbytehq/airbyte/pull/27762) | Update following state breaking changes |
Expand Down

0 comments on commit 2f6dcbc

Please sign in to comment.