From 22a43c2bcbea266c7b539fc44a88e2728f480f6a Mon Sep 17 00:00:00 2001
From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com>
Date: Wed, 28 Jun 2023 17:34:11 +0100
Subject: [PATCH 1/2] style: minor reordering of types and properties (#29)
---
src/finch/types/ats/application.py | 4 +-
src/finch/types/ats/candidate.py | 4 +-
src/finch/types/ats/job.py | 4 +-
src/finch/types/ats/offer.py | 4 +-
src/finch/types/hris/company.py | 50 +++++++++----------
src/finch/types/hris/individual.py | 6 +--
.../types/hris/individual_in_directory.py | 18 +++----
.../types/hris/individuals/employment_data.py | 18 +++----
src/finch/types/hris/pay_statement.py | 36 ++++++-------
src/finch/types/hris/payment.py | 6 +--
src/finch/types/provider.py | 6 +--
11 files changed, 78 insertions(+), 78 deletions(-)
diff --git a/src/finch/types/ats/application.py b/src/finch/types/ats/application.py
index e08f4eb5..c63542c7 100644
--- a/src/finch/types/ats/application.py
+++ b/src/finch/types/ats/application.py
@@ -14,10 +14,10 @@ class RejectedReason(BaseModel):
class Application(BaseModel):
- candidate_id: str
-
id: str
+ candidate_id: str
+
job_id: str
offer_id: Optional[str]
diff --git a/src/finch/types/ats/candidate.py b/src/finch/types/ats/candidate.py
index 1792a092..e0157550 100644
--- a/src/finch/types/ats/candidate.py
+++ b/src/finch/types/ats/candidate.py
@@ -21,6 +21,8 @@ class PhoneNumber(BaseModel):
class Candidate(BaseModel):
+ id: str
+
application_ids: List[str]
"""Array of Finch uuids corresponding to `application`s for this individual"""
@@ -32,8 +34,6 @@ class Candidate(BaseModel):
full_name: Optional[str]
- id: str
-
last_activity_at: datetime
last_name: Optional[str]
diff --git a/src/finch/types/ats/job.py b/src/finch/types/ats/job.py
index 5e53b52a..8abba37d 100644
--- a/src/finch/types/ats/job.py
+++ b/src/finch/types/ats/job.py
@@ -28,6 +28,8 @@ class HiringTeam(BaseModel):
class Job(BaseModel):
+ id: str
+
closed_at: Optional[datetime]
created_at: Optional[datetime]
@@ -36,8 +38,6 @@ class Job(BaseModel):
hiring_team: HiringTeam
- id: str
-
name: Optional[str]
status: Optional[Literal["open", "closed", "on_hold", "draft", "archived"]]
diff --git a/src/finch/types/ats/offer.py b/src/finch/types/ats/offer.py
index 17f7e7ac..f1cef5ec 100644
--- a/src/finch/types/ats/offer.py
+++ b/src/finch/types/ats/offer.py
@@ -9,14 +9,14 @@
class Offer(BaseModel):
+ id: str
+
application_id: str
candidate_id: str
created_at: datetime
- id: str
-
job_id: str
status: Literal[
diff --git a/src/finch/types/hris/company.py b/src/finch/types/hris/company.py
index ae98bba2..de5f34cd 100644
--- a/src/finch/types/hris/company.py
+++ b/src/finch/types/hris/company.py
@@ -6,28 +6,7 @@
from ...types import location
from ..._models import BaseModel
-__all__ = ["Company", "Entity", "Department", "DepartmentParent", "Account"]
-
-
-class Entity(BaseModel):
- subtype: Optional[Literal["s_corporation", "c_corporation", "b_corporation"]]
- """The tax payer subtype of the company."""
-
- type: Optional[Literal["llc", "corporation", "sole_proprietor", "non_profit", "partnership", "cooperative"]]
- """The tax payer type of the company."""
-
-
-class DepartmentParent(BaseModel):
- name: Optional[str]
- """The parent department's name."""
-
-
-class Department(BaseModel):
- name: Optional[str]
- """The department name."""
-
- parent: Optional[DepartmentParent]
- """The parent department, if present."""
+__all__ = ["Company", "Account", "Department", "DepartmentParent", "Entity"]
class Account(BaseModel):
@@ -50,7 +29,31 @@ class Account(BaseModel):
"""
+class DepartmentParent(BaseModel):
+ name: Optional[str]
+ """The parent department's name."""
+
+
+class Department(BaseModel):
+ name: Optional[str]
+ """The department name."""
+
+ parent: Optional[DepartmentParent]
+ """The parent department, if present."""
+
+
+class Entity(BaseModel):
+ subtype: Optional[Literal["s_corporation", "c_corporation", "b_corporation"]]
+ """The tax payer subtype of the company."""
+
+ type: Optional[Literal["llc", "corporation", "sole_proprietor", "non_profit", "partnership", "cooperative"]]
+ """The tax payer type of the company."""
+
+
class Company(BaseModel):
+ id: str
+ """A stable Finch `id` (UUID v4) for the company."""
+
accounts: Optional[List[Account]]
"""An array of bank account objects associated with the payroll/HRIS system."""
@@ -63,9 +66,6 @@ class Company(BaseModel):
entity: Optional[Entity]
"""The entity type object."""
- id: str
- """A stable Finch `id` (UUID v4) for the company."""
-
legal_name: Optional[str]
"""The legal name of the company."""
diff --git a/src/finch/types/hris/individual.py b/src/finch/types/hris/individual.py
index 12ddb0c3..df42d9a1 100644
--- a/src/finch/types/hris/individual.py
+++ b/src/finch/types/hris/individual.py
@@ -22,6 +22,9 @@ class PhoneNumber(BaseModel):
class Individual(BaseModel):
+ id: Optional[str]
+ """A stable Finch `id` (UUID v4) for an individual in the company."""
+
dob: Optional[str]
emails: Optional[List[Email]]
@@ -32,9 +35,6 @@ class Individual(BaseModel):
gender: Optional[Literal["female", "male", "other", "decline_to_specify"]]
"""The gender of the individual."""
- id: Optional[str]
- """A stable Finch `id` (UUID v4) for an individual in the company."""
-
last_name: Optional[str]
"""The legal last name of the individual."""
diff --git a/src/finch/types/hris/individual_in_directory.py b/src/finch/types/hris/individual_in_directory.py
index 98651bfb..26c3c3d5 100644
--- a/src/finch/types/hris/individual_in_directory.py
+++ b/src/finch/types/hris/individual_in_directory.py
@@ -4,12 +4,7 @@
from ..._models import BaseModel
-__all__ = ["IndividualInDirectory", "Manager", "Department"]
-
-
-class Manager(BaseModel):
- id: Optional[str]
- """A stable Finch `id` (UUID v4) for an individual in the company."""
+__all__ = ["IndividualInDirectory", "Department", "Manager"]
class Department(BaseModel):
@@ -17,16 +12,21 @@ class Department(BaseModel):
"""The name of the department."""
+class Manager(BaseModel):
+ id: Optional[str]
+ """A stable Finch `id` (UUID v4) for an individual in the company."""
+
+
class IndividualInDirectory(BaseModel):
+ id: Optional[str]
+ """A stable Finch id (UUID v4) for an individual in the company."""
+
department: Optional[Department]
"""The department object."""
first_name: Optional[str]
"""The legal first name of the individual."""
- id: Optional[str]
- """A stable Finch id (UUID v4) for an individual in the company."""
-
is_active: Optional[bool]
"""`true` if the individual is an active employee or contractor at the company."""
diff --git a/src/finch/types/hris/individuals/employment_data.py b/src/finch/types/hris/individuals/employment_data.py
index e3363f13..c4c2e797 100644
--- a/src/finch/types/hris/individuals/employment_data.py
+++ b/src/finch/types/hris/individuals/employment_data.py
@@ -8,12 +8,7 @@
from ....types import income, location
from ...._models import BaseModel
-__all__ = ["EmploymentData", "Manager", "Department", "Employment"]
-
-
-class Manager(BaseModel):
- id: Optional[str]
- """A stable Finch `id` (UUID v4) for an individual in the company."""
+__all__ = ["EmploymentData", "Department", "Employment", "Manager"]
class Department(BaseModel):
@@ -33,7 +28,15 @@ class Employment(BaseModel):
"""The main employment type of the individual."""
+class Manager(BaseModel):
+ id: Optional[str]
+ """A stable Finch `id` (UUID v4) for an individual in the company."""
+
+
class EmploymentData(BaseModel):
+ id: Optional[str]
+ """string A stable Finch `id` (UUID v4) for an individual in the company."""
+
class_code: Optional[str]
"""Worker's compensation classification code for this employee"""
@@ -48,9 +51,6 @@ class EmploymentData(BaseModel):
first_name: Optional[str]
"""The legal first name of the individual."""
- id: Optional[str]
- """string A stable Finch `id` (UUID v4) for an individual in the company."""
-
income_history: Optional[List[Optional[income.Income]]]
"""The array of income history."""
diff --git a/src/finch/types/hris/pay_statement.py b/src/finch/types/hris/pay_statement.py
index 43a776cc..61f3cf29 100644
--- a/src/finch/types/hris/pay_statement.py
+++ b/src/finch/types/hris/pay_statement.py
@@ -7,7 +7,7 @@
from ..._models import BaseModel
from ...types.hris import benefit_type
-__all__ = ["PayStatement", "Earning", "Tax", "EmployeeDeduction", "EmployerContribution"]
+__all__ = ["PayStatement", "Earning", "EmployeeDeduction", "EmployerContribution", "Tax"]
class Earning(BaseModel):
@@ -47,23 +47,6 @@ class Earning(BaseModel):
"""The type of earning."""
-class Tax(BaseModel):
- amount: Optional[int]
- """The tax amount in cents."""
-
- currency: Optional[str]
- """The currency code."""
-
- employer: Optional[bool]
- """`true` if the amount is paid by the employers."""
-
- name: Optional[str]
- """The exact name of tax from the pay statement."""
-
- type: Optional[Literal["state", "federal", "local", "fica"]]
- """The type of taxes."""
-
-
class EmployeeDeduction(BaseModel):
amount: Optional[int]
"""The deduction amount in cents."""
@@ -95,6 +78,23 @@ class EmployerContribution(BaseModel):
"""Type of benefit."""
+class Tax(BaseModel):
+ amount: Optional[int]
+ """The tax amount in cents."""
+
+ currency: Optional[str]
+ """The currency code."""
+
+ employer: Optional[bool]
+ """`true` if the amount is paid by the employers."""
+
+ name: Optional[str]
+ """The exact name of tax from the pay statement."""
+
+ type: Optional[Literal["state", "federal", "local", "fica"]]
+ """The type of taxes."""
+
+
class PayStatement(BaseModel):
earnings: Optional[List[Optional[Earning]]]
"""The array of earnings objects associated with this pay statement"""
diff --git a/src/finch/types/hris/payment.py b/src/finch/types/hris/payment.py
index 9c7b0a83..e5ea9810 100644
--- a/src/finch/types/hris/payment.py
+++ b/src/finch/types/hris/payment.py
@@ -15,6 +15,9 @@ class PayPeriod(BaseModel):
class Payment(BaseModel):
+ id: Optional[str]
+ """The unique id for the payment."""
+
company_debit: Optional[money.Money]
debit_date: Optional[str]
@@ -25,9 +28,6 @@ class Payment(BaseModel):
gross_pay: Optional[money.Money]
- id: Optional[str]
- """The unique id for the payment."""
-
individual_ids: Optional[List[str]]
"""Array of every individual on this payment."""
diff --git a/src/finch/types/provider.py b/src/finch/types/provider.py
index 00dc6f7d..7f403550 100644
--- a/src/finch/types/provider.py
+++ b/src/finch/types/provider.py
@@ -8,15 +8,15 @@
class Provider(BaseModel):
+ id: Optional[str]
+ """The id of the payroll provider used in Connect."""
+
display_name: Optional[str]
"""The display name of the payroll provider."""
icon: Optional[str]
"""The url to the official icon of the payroll provider."""
- id: Optional[str]
- """The id of the payroll provider used in Connect."""
-
logo: Optional[str]
"""The url to the official logo of the payroll provider."""
From 5a7393fc6ea19ac329ae57e449d7edfd00b07e9a Mon Sep 17 00:00:00 2001
From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com>
Date: Thu, 29 Jun 2023 21:46:17 +0100
Subject: [PATCH 2/2] docs(api.md): minor restructuring (#31)
---
api.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/api.md b/api.md
index 3da6d22c..17a1dc91 100644
--- a/api.md
+++ b/api.md
@@ -1,9 +1,9 @@
-# Top Level
+# Finch
-Custom Methods:
+Methods:
-- `get_access_token`
-- `get_auth_url`
+- client.get_access_token(\*args) -> str
+- client.get_auth_url(\*args) -> str
# ATS