Skip to content
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

Ben Admin Kit #18

Merged
merged 43 commits into from
Apr 9, 2024
Merged

Ben Admin Kit #18

merged 43 commits into from
Apr 9, 2024

Conversation

bryanbierce
Copy link
Contributor

@bryanbierce bryanbierce commented Nov 10, 2023

https://rippling.atlassian.net/browse/BENEEX-84

This diff scaffolds out the kit API for the Ben Admin kit. This kit will be used to integrate with 3rd party benefit administration providers who require payroll and other demographic data about EE's managed in Rippling in order to provide insurance and other benefits

@bryanbierce bryanbierce marked this pull request as ready for review November 13, 2023 20:23
@bryanbierce bryanbierce requested a review from a team as a code owner November 13, 2023 20:23
@stevevls stevevls requested a review from a team as a code owner November 14, 2023 19:38
Copy link
Contributor

@stevevls stevevls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for being one of our early contributors as we're still ironing out the process. 😅 This repo is public-facing, so this is going to be a very detailed review since 1) third party developers will need to be able to read it and make sense of it and 2) once merged, it's hard to change. Thanks for bearing with us!

To start, I have a couple of high level comments:

  1. Please draft a kit specification here: https://rippling.atlassian.net/wiki/spaces/ID/pages/3703538906/Kit+Specifications. This spec should give us a clear breakdown of capabilities, what is provided by the kit, and what we require from a third party.
  2. Can we rename this to be benefits admin to avoid jargon-y sounding names?
  3. Left some comments inline, but in general please prefer existing data types from the flux_core package instead of creating your own. Definitely open to chat if you there's a reason they're not suitable.
  4. Also looks like in some cases you're defining some types that might want to get pushed down into flux_core.
  5. A lint check is failing...you can run ./run_ruff --fix in the top level directory to auto-fix where possible. It will also tell you where there are any lint violations that it wouldn't auto-fix.

Comment on lines 28 to 76
class EmploymentType(Enum):
CONTRACTOR = 1
SALARIED_FT = 2
SALARIED_PT = 3
HOURLY_FT = 4
HOURLY_PT = 5
TEMP = 6


class MonetaryValue:
value: float
currency_type: str


class PayFrequency(Enum):
WEEKLY = 1
BI_WEEKLY = 2
MONTHLY = 3
SEMI_MONTHLY = 4

class PayTimeUnit(Enum):
HOUR = 1
DAY = 2
WEEK = 3
MONTH = 4
YEAR = 5
PAY_PERIOD = 6


class Pay:
frequency: PayFrequency
frequency_effective_date: datetime
time_unit: PayTimeUnit
value_per_unit: MonetaryValue
value_effective_date: datetime

class EmploymentHours:
type: EmploymentType
effectiveDate: datetime
hours_per_week: Optional[int]

class Employment:
hours: EmploymentHours
is_rehire: bool
termination_date: Optional[datetime]
start_date: datetime
original_hire_date: datetime
w2_start_date: datetime
pay: Pay
Copy link
Contributor

@stevevls stevevls Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine that much of this can be moved into flux core. What are your thoughts @Kingpin007 @vguptarippling ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, alot of this feels easily re-usable. The Employement object conflicts with Employee a bit as they have some overlappigng data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is additional information in Employment I would recommend you extend Employee and add it to flux-core

@bryanbierce
Copy link
Contributor Author

bryanbierce commented Nov 14, 2023

Thanks for being one of our early contributors as we're still ironing out the process. 😅 This repo is public-facing, so this is going to be a very detailed review since 1) third party developers will need to be able to read it and make sense of it and 2) once merged, it's hard to change. Thanks for bearing with us!

To start, I have a couple of high level comments:

  1. Please draft a kit specification here: https://rippling.atlassian.net/wiki/spaces/ID/pages/3703538906/Kit+Specifications. This spec should give us a clear breakdown of capabilities, what is provided by the kit, and what we require from a third party.
  2. Can we rename this to be benefits admin to avoid jargon-y sounding names?
  3. Left some comments inline, but in general please prefer existing data types from the flux_core package instead of creating your own. Definitely open to chat if you there's a reason they're not suitable.
  4. Also looks like in some cases you're defining some types that might want to get pushed down into flux_core.
  5. A lint check is failing...you can run ./run_ruff --fix in the top level directory to auto-fix where possible. It will also tell you where there are any lint violations that it wouldn't auto-fix.

@stevevls Happy to help iron out the kinks :)

  1. yes, https://rippling.atlassian.net/wiki/spaces/ID/pages/3757047835/Benefits+Administration
  2. yes
  3. I'm not in love with the Employee object. Its does not contain all of the Role and Job data which we require which means I will need to extend it. Since it is so flat, the field names will end up being a bit messy. Looking in the flux kits code in rippling-main I don't see that there is any easily reusable constructors for Employee either so I'm just going to end up having to re-implement the builder anyways. I don't really see the point in reusing it. That said, I can re-implement that builder in a way that others can use it in the future and we can just deal with an un-tidy schema if that is a strong preference.
  4. Yes, the data around pay and hours all feels like things that other kits might need in the future and should be maintained centrally if Employee is.
  5. I don't see that ./run-ruf exists in flux_sdk. Is there a setup script that I missed? Looking at the lint output I see that its mostly line length issues. Is there a config in flux-sdk that can be used to setup file formatting in VSCode or PyCharm?

@bryanbierce bryanbierce force-pushed the bb-ce-ben-admin-kit branch 2 times, most recently from 3f60b25 to d925f71 Compare November 14, 2023 23:47


class BenefitsEligibility(Enum):
# this will expand to cover cobra later
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for this comment...I was looking at this and wondering why it wasn't a bool. 😁

@stevevls
Copy link
Contributor

stevevls commented Nov 15, 2023

I'm not in love with the Employee object. Its does not contain all of the Role and Job data which we require which means I will need to extend it. Since it is so flat, the field names will end up being a bit messy. Looking in the flux kits code in rippling-main I don't see that there is any easily reusable constructors for Employee either so I'm just going to end up having to re-implement the builder anyways. I don't really see the point in reusing it. That said, I can re-implement that builder in a way that others can use it in the future and we can just deal with an un-tidy schema if that is a strong preference.

This is a fair point. If you think it makes sense to create a specialized set of classes for your kit, that's totally fine. They would just need to be named differently than the core types so that the name indicates their purpose. I feel like re-using the name Employee in different contexts would be confusing.

I don't see that ./run-ruf exists in flux_sdk. Is there a setup script that I missed? Looking at the lint output I see that its mostly line length issues. Is there a config in flux-sdk that can be used to setup file formatting in VSCode or PyCharm?

I think it was merged to main after you branch, so if you merge or rebase you should get it. We don't have configs for IDEs (yet), but that's a good idea.

@bryanbierce
Copy link
Contributor Author

This is a fair point. If you think it makes sense to create a specialized set of classes for your kit, that's totally fine. They would just need to be named differently than the core types so that the name indicates their purpose. I feel like re-using the name Employee in different contexts would be confusing.

I've gone ahead and updated the name on mine and used the model from core for part of it so we achieve some consistency. I am duplicating a few of the fields from the Employee object within Employment and status since I think it will be more natural for our consumers to read these types and find that data in those places

@bryanbierce bryanbierce force-pushed the bb-ce-ben-admin-kit branch 3 times, most recently from dee5378 to 241cf8c Compare December 7, 2023 21:50
@stevevls
Copy link
Contributor

@bryanbierce I just merged in latest main because we've added lint and test actions in GH that are now required statuses to merge. Looks like we have some linting failures to take care of. The mypy status check isn't required yet b/c some errors got merged down to main, but please make sure that we don't introduce any new issues as we plan to make it required ASAP. Thanks!

@bryanbierce bryanbierce force-pushed the bb-ce-ben-admin-kit branch 5 times, most recently from ea24554 to f5a349e Compare December 19, 2023 22:25
@bryanbierce bryanbierce force-pushed the bb-ce-ben-admin-kit branch from 172fd74 to a713cb5 Compare March 19, 2024 21:03
@bryanbierce bryanbierce force-pushed the bb-ce-ben-admin-kit branch from c9cb2d5 to 0fd6d99 Compare April 5, 2024 17:09
Comment on lines +39 to +54
class EmploymentHours:
type: EmploymentType
type_effective_date: datetime
hours_per_week: int | None
hours_effective_date: datetime


class Employment:
hours: EmploymentHours
pay: Pay
is_rehire: bool
termination_date: datetime | None
termination_type: TerminationType | None
start_date: datetime
original_hire_date: datetime
w2_start_date: datetime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanbierce What are the fields do you need that are not part of Employee ?

I see that hours_per_week and hours_effective_date are the only fields ? Can they go inside Employee data type ? cc: @stevevls @Kingpin007 @ujjwalshukla

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type_effective_date, hours_per_week, hours_effective_date , termination_type and the pay object are not on Employee currently. I had asked the team if I could extend Employee with these originally and the answer from @Kingpin007 and @ujjwalshukla was no. Happy to move them around if you all would rather co-locate these now. This Employment object only existed because the team originally did not want any of the new data in flux_core so I took the opportunity to duplicate some fields and make the objects a bit more sensible to work with.

@bryanbierce bryanbierce dismissed sz2376’s stale review April 8, 2024 16:29

Reviewer approved changes

@bryanbierce bryanbierce merged commit 74613c5 into main Apr 9, 2024
3 checks passed
@bryanbierce bryanbierce deleted the bb-ce-ben-admin-kit branch April 9, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants