app.model.user_points module

class app.model.user_points.UserPoints(*, id=<factory>, created_at=<factory>, updated_at=<factory>, apiKey_used, oauth_user_id=None, points, caseName, idempotencyKey, data, description, userId, taskId)[source]

Bases: BaseModel

Represents the points and associated data for a user.

Parameters:
  • id (Annotated[str, FieldInfoMetadata(primary_key=PydanticUndefined, nullable=PydanticUndefined, foreign_key=PydanticUndefined, ondelete=PydanticUndefined, unique=PydanticUndefined, index=PydanticUndefined, sa_type=UUID(), sa_column=PydanticUndefined, sa_column_args=PydanticUndefined, sa_column_kwargs={'primary_key': True, 'index': True})])

  • created_at (Annotated[datetime, FieldInfoMetadata(primary_key=PydanticUndefined, nullable=PydanticUndefined, foreign_key=PydanticUndefined, ondelete=PydanticUndefined, unique=PydanticUndefined, index=PydanticUndefined, sa_type=DateTime(timezone=True), sa_column=PydanticUndefined, sa_column_args=PydanticUndefined, sa_column_kwargs={'server_default': <sqlalchemy.sql.functions.now at 0x7fa8900484a0; now>})])

  • updated_at (Annotated[datetime, FieldInfoMetadata(primary_key=PydanticUndefined, nullable=PydanticUndefined, foreign_key=PydanticUndefined, ondelete=PydanticUndefined, unique=PydanticUndefined, index=PydanticUndefined, sa_type=DateTime(timezone=True), sa_column=PydanticUndefined, sa_column_args=PydanticUndefined, sa_column_kwargs={'server_default': <sqlalchemy.sql.functions.now at 0x7fa88fa2a840; now>, 'onupdate': <sqlalchemy.sql.functions.now at 0x7fa88fa2ad20; now>})])

points

The number of points.

Type:

int

caseName

The name of the case.

Type:

str

data

A JSON object containing additional data.

Type:

dict

description

A description of the user points.

Type:

str

userId

The ID of the user associated with the points.

Type:

str

taskId

The ID of the task associated with the points.

Type:

str

model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'read_from_attributes': True, 'read_with_orm_mode': True, 'registry': PydanticUndefined, 'table': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

make_hashable(obj)[source]

Recursively convert a nested structure into a hashable form.

Lists/tuples become tuples and dicts become sorted tuples of (key, value) pairs, so the JSON data field can be folded into __hash__. Scalars are returned unchanged.

Parameters:

obj – The value (possibly nested list/dict) to make hashable.

Returns:

A hashable equivalent of obj.