Skip to content

style: prefer importing types directly instead of module names #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/finch/types/ats/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import Optional
from datetime import datetime

from .stage import Stage
from ..._models import BaseModel
from ...types.ats.stage import Stage

__all__ = ["Application", "RejectedReason"]

Expand Down
6 changes: 3 additions & 3 deletions src/finch/types/hris/benefits/individual_benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing_extensions import Literal

from ...._models import BaseModel
from ....types.hris import benfit_contribution
from ..benfit_contribution import BenfitContribution

__all__ = ["IndividualBenefit", "Body"]

Expand All @@ -21,9 +21,9 @@ class Body(BaseModel):
for this individual.
"""

company_contribution: Optional[benfit_contribution.BenfitContribution]
company_contribution: Optional[BenfitContribution]

employee_deduction: Optional[benfit_contribution.BenfitContribution]
employee_deduction: Optional[BenfitContribution]

hsa_contribution_limit: Optional[Literal["individual", "family"]]
"""Type for HSA contribution limit if the benefit is a HSA."""
Expand Down
4 changes: 2 additions & 2 deletions src/finch/types/hris/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import List, Optional
from typing_extensions import Literal

from ...types import location
from ..._models import BaseModel
from ..location import Location

__all__ = ["Company", "Account", "Department", "DepartmentParent", "Entity"]

Expand Down Expand Up @@ -69,7 +69,7 @@ class Company(BaseModel):
legal_name: Optional[str]
"""The legal name of the company."""

locations: Optional[List[Optional[location.Location]]]
locations: Optional[List[Optional[Location]]]

primary_email: Optional[str]
"""The email of the main administrator on the account."""
Expand Down
12 changes: 7 additions & 5 deletions src/finch/types/hris/company_benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
from typing import Optional

from ..._models import BaseModel
from ...types.hris import benefit_type, benefit_frequency, benfit_contribution
from .benefit_type import BenefitType
from .benefit_frequency import BenefitFrequency
from .benfit_contribution import BenfitContribution

__all__ = ["CompanyBenefit"]


class CompanyBenefit(BaseModel):
benefit_id: str

company_contribution: Optional[benfit_contribution.BenfitContribution]
company_contribution: Optional[BenfitContribution]

description: Optional[str]

employee_deduction: Optional[benfit_contribution.BenfitContribution]
employee_deduction: Optional[BenfitContribution]

frequency: Optional[benefit_frequency.BenefitFrequency]
frequency: Optional[BenefitFrequency]

type: Optional[benefit_type.BenefitType]
type: Optional[BenefitType]
"""Type of benefit."""
4 changes: 2 additions & 2 deletions src/finch/types/hris/individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import List, Optional
from typing_extensions import Literal

from ...types import location
from ..._models import BaseModel
from ..location import Location

__all__ = ["Individual", "Email", "PhoneNumber"]

Expand Down Expand Up @@ -46,7 +46,7 @@ class Individual(BaseModel):
preferred_name: Optional[str]
"""The preferred name of the individual."""

residence: Optional[location.Location]
residence: Optional[Location]

ssn: Optional[str]
"""Note: This property is only available if enabled for your account.
Expand Down
4 changes: 2 additions & 2 deletions src/finch/types/hris/individual_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from typing import Optional

from ..._models import BaseModel
from ...types.hris import individual
from .individual import Individual

__all__ = ["IndividualResponse"]


class IndividualResponse(BaseModel):
body: Optional[individual.Individual]
body: Optional[Individual]

code: Optional[int]

Expand Down
7 changes: 3 additions & 4 deletions src/finch/types/hris/individuals/employment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

from pydantic import Field as FieldInfo

from ....types import income
from ...income import Income
from ...._models import BaseModel
from ....types.income import Income
from ....types.location import Location
from ...location import Location

__all__ = ["EmploymentData", "Department", "Employment", "Manager"]

Expand Down Expand Up @@ -53,7 +52,7 @@ class EmploymentData(BaseModel):
first_name: Optional[str]
"""The legal first name of the individual."""

income_history: Optional[List[Optional[income.Income]]]
income_history: Optional[List[Optional[Income]]]
"""The array of income history."""

income: Optional[Income]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from typing import Optional

from ...._models import BaseModel
from ....types.hris.individuals import employment_data
from .employment_data import EmploymentData

__all__ = ["EmploymentDataResponse"]


class EmploymentDataResponse(BaseModel):
body: Optional[employment_data.EmploymentData]
body: Optional[EmploymentData]

code: Optional[int]

Expand Down
12 changes: 6 additions & 6 deletions src/finch/types/hris/pay_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from typing import List, Optional
from typing_extensions import Literal

from ...types import money
from ..money import Money
from ..._models import BaseModel
from ...types.hris import benefit_type
from .benefit_type import BenefitType

__all__ = ["PayStatement", "Earning", "EmployeeDeduction", "EmployerContribution", "Tax"]

Expand Down Expand Up @@ -60,7 +60,7 @@ class EmployeeDeduction(BaseModel):
pre_tax: Optional[bool]
"""Boolean indicating if the deduction is pre-tax."""

type: Optional[benefit_type.BenefitType]
type: Optional[BenefitType]
"""Type of benefit."""


Expand All @@ -74,7 +74,7 @@ class EmployerContribution(BaseModel):
name: Optional[str]
"""The contribution name from the pay statement."""

type: Optional[benefit_type.BenefitType]
type: Optional[BenefitType]
"""Type of benefit."""


Expand Down Expand Up @@ -104,12 +104,12 @@ class PayStatement(BaseModel):

employer_contributions: Optional[List[Optional[EmployerContribution]]]

gross_pay: Optional[money.Money]
gross_pay: Optional[Money]

individual_id: Optional[str]
"""A stable Finch `id` (UUID v4) for an individual in the company"""

net_pay: Optional[money.Money]
net_pay: Optional[Money]

payment_method: Optional[Literal["check", "direct_deposit"]]
"""The payment method."""
Expand Down
4 changes: 2 additions & 2 deletions src/finch/types/hris/pay_statement_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from typing import Optional

from ..._models import BaseModel
from ...types.hris import pay_statement_response_body
from .pay_statement_response_body import PayStatementResponseBody

__all__ = ["PayStatementResponse"]


class PayStatementResponse(BaseModel):
body: Optional[pay_statement_response_body.PayStatementResponseBody]
body: Optional[PayStatementResponseBody]

code: Optional[int]

Expand Down
6 changes: 3 additions & 3 deletions src/finch/types/hris/pay_statement_response_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

from typing import List, Optional

from ..paging import Paging
from ..._models import BaseModel
from ...types.hris import pay_statement
from ...types.paging import Paging
from .pay_statement import PayStatement

__all__ = ["PayStatementResponseBody"]


class PayStatementResponseBody(BaseModel):
paging: Optional[Paging]

pay_statements: Optional[List[pay_statement.PayStatement]]
pay_statements: Optional[List[PayStatement]]
"""The array of pay statements for the current payment."""
12 changes: 6 additions & 6 deletions src/finch/types/hris/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import List, Optional

from ...types import money
from ..money import Money
from ..._models import BaseModel

__all__ = ["Payment", "PayPeriod"]
Expand All @@ -18,20 +18,20 @@ class Payment(BaseModel):
id: Optional[str]
"""The unique id for the payment."""

company_debit: Optional[money.Money]
company_debit: Optional[Money]

debit_date: Optional[str]

employee_taxes: Optional[money.Money]
employee_taxes: Optional[Money]

employer_taxes: Optional[money.Money]
employer_taxes: Optional[Money]

gross_pay: Optional[money.Money]
gross_pay: Optional[Money]

individual_ids: Optional[List[str]]
"""Array of every individual on this payment."""

net_pay: Optional[money.Money]
net_pay: Optional[Money]

pay_date: Optional[str]

Expand Down
4 changes: 2 additions & 2 deletions src/finch/types/hris/supported_benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing_extensions import Literal

from ..._models import BaseModel
from ...types.hris import benefit_type
from .benefit_type import BenefitType

__all__ = ["SupportedBenefit"]

Expand Down Expand Up @@ -43,5 +43,5 @@ class SupportedBenefit(BaseModel):
values for HSA benefits.
"""

type: Optional[benefit_type.BenefitType]
type: Optional[BenefitType]
"""Type of benefit."""