Skip to content

Commit 0426780

Browse files
authored
Add data model and interface for parse equity file capability (#127)
1 parent dadba03 commit 0426780

File tree

8 files changed

+395
-69
lines changed

8 files changed

+395
-69
lines changed

flux_sdk/equity/__init__.py

Whitespace-only changes.

flux_sdk/equity/capabilities/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python_sources()

flux_sdk/equity/capabilities/update_equity_grant/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
from datetime import datetime
2+
from typing import Any
3+
4+
from pydantic import BaseModel
5+
6+
7+
class Currency(BaseModel):
8+
amount: float
9+
currency_type: str
10+
11+
12+
class EquityVestingEvent(BaseModel):
13+
"""
14+
vest_date: the date on which the vesting event happens
15+
vest_quantity: the total quantity of the vesting event
16+
vested_quantity: the quantity which is vested
17+
vest_performance_condition: sometimes, a vesting event is tied to extra condition like employee performance,
18+
i.e. it's not necessarily vested past the vest_date
19+
"""
20+
vest_date: datetime
21+
vest_quantity: float
22+
vested_quantity: float
23+
vest_performance_condition: bool
24+
25+
26+
class EquityGrant(BaseModel):
27+
"""
28+
external_stakeholder_identifier: the identifier of the equity grant owner in the third party system
29+
internal_stakeholder_identifier: the identifier of the equity grant owner within Rippling system, can be rwc id
30+
grant_unique_identifier: a unique identifier for the grant, i.e. different for each grant
31+
grant_name: the name of the grant
32+
grant_date: the date when the grant is created
33+
canceled_date: the date when the grant is canceled
34+
grant_price: the price of the grant
35+
expiration_date: the date when the grant is expired
36+
exercised_quantity: exercised quantity of the grant
37+
released_quantity: released quantity of the grant
38+
canceled_quantity: canceled quantity of the grant
39+
expired_quantity: expired quantity of the grant
40+
exercisable_quantity: exercisable quantity of the grant
41+
exercise_price: exercise price of the grant
42+
outstanding_quantity: outstanding quantity of the grant, also considered as valid quantity
43+
outstanding_vested_quantity: vested quantity within the outstanding quantity
44+
outstanding_unvested_quantity: unvested quantity within the outstanding quantity
45+
vesting_events: list of vesting events that belong to the grant
46+
extra: fields that are specific to some third parties and might not be needed in every use case
47+
"""
48+
49+
external_stakeholder_identifier: str
50+
internal_stakeholder_identifier: str | None = None
51+
grant_unique_identifier: str
52+
grant_name: str
53+
grant_date: datetime
54+
canceled_date: datetime | None = None
55+
grant_price: Currency
56+
expiration_date: datetime | None = None
57+
grant_quantity: float
58+
exercised_quantity: float = 0.0
59+
released_quantity: float = 0.0
60+
canceled_quantity: float = 0.0
61+
expired_quantity: float = 0.0
62+
exercisable_quantity: float = 0.0
63+
exercise_price: Currency | None = None
64+
outstanding_quantity: float
65+
outstanding_vested_quantity: float
66+
outstanding_unvested_quantity: float
67+
vesting_events: list[EquityVestingEvent]
68+
extras: dict[str, Any]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from abc import ABC, abstractmethod
2+
from io import StringIO
3+
4+
from flux_sdk.equity.capabilities.update_equity_grant.data_models import EquityGrant
5+
6+
7+
class UpdateEquityGrant(ABC):
8+
"""
9+
Update equity grant data from third party cap table providers.
10+
11+
This class represents the "update_equity_grant" capability. The developer is supposed to implement
12+
update_equity_grant method in their implementation. For further details regarding their
13+
implementation details, check their documentation.
14+
"""
15+
@staticmethod
16+
@abstractmethod
17+
def update_equity_grant(stream: StringIO) -> dict[str, EquityGrant]:
18+
"""
19+
This method parses the equity data stream and returns a dictionary of equity grant unique identifier to equity
20+
grant
21+
"""

poetry.lock

+302-68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "rippling-flux-sdk"
3-
version = "0.56"
3+
version = "0.57"
44
description = "Defines the interfaces and data-models used by Rippling Flux Apps."
55
authors = ["Rippling Apps <[email protected]>"]
66
readme = "README.md"
@@ -10,6 +10,8 @@ packages = [{include="flux_sdk"}]
1010
python = "^3.10"
1111
"ruamel.yaml" = "0.17.10"
1212
click = ">=8.0,<9"
13+
pydantic = {version = "2.9.0", extras = ["email"] }
14+
pydantic-core = "*" # tied to pydantic version
1315

1416
[tool.poetry.group.dev.dependencies]
1517
pytest = "7.2.1"

0 commit comments

Comments
 (0)