query GetCustomers(
	$businessId: ID!
	$page: Int
	$pageSize: Int
	$sort: [CustomerSort!]! = [NAME_ASC]
) {
	business(id: $businessId) {
		id
		customers(page: $page, pageSize: $pageSize, sort: $sort) {
			edges {
				node {
					id
					name
					firstName
					lastName
					email
					phone
					mobile
					currency {
						code
						symbol
					}
					address {
						addressLine1
						addressLine2
						city
						province {
							code
							name
						}
						country {
							code
							name
						}
						postalCode
					}
					outstandingAmount {
						value
						currency {
							code
						}
					}
					overdueAmount {
						value
						currency {
							code
						}
					}
					createdAt
					modifiedAt
					isArchived
				}
			}
			pageInfo {
				currentPage
				totalPages
				totalCount
			}
		}
	}
}

query GetCustomer($businessId: ID!, $customerId: ID!) {
	business(id: $businessId) {
		id
		customer(id: $customerId) {
			id
			name
			firstName
			lastName
			displayId
			email
			phone
			mobile
			fax
			tollFree
			website
			internalNotes
			currency {
				code
				symbol
				name
			}
			address {
				addressLine1
				addressLine2
				city
				province {
					code
					name
				}
				country {
					code
					name
				}
				postalCode
			}
			shippingDetails {
				name
				phone
				instructions
				address {
					addressLine1
					addressLine2
					city
					province {
						code
						name
					}
					country {
						code
						name
					}
					postalCode
				}
			}
			outstandingAmount {
				value
				currency {
					code
				}
			}
			overdueAmount {
				value
				currency {
					code
				}
			}
			createdAt
			modifiedAt
			isArchived
		}
	}
}
