Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
#
# pip-compile --no-emit-index-url --no-strip-extras lambdas/python/cognito-backup/requirements-dev.in
#
aws-lambda-powertools==3.27.0
aws-lambda-powertools==3.28.0
# via -r lambdas/python/cognito-backup/requirements-dev.in
boto3==1.42.89
boto3==1.42.91
# via
# -r lambdas/python/cognito-backup/requirements-dev.in
# moto
botocore==1.42.89
botocore==1.42.91
# via
# -r lambdas/python/cognito-backup/requirements-dev.in
# boto3
Expand Down Expand Up @@ -45,7 +45,7 @@ markupsafe==3.0.3
# werkzeug
moto[cognitoidp,s3]==5.1.22
# via -r lambdas/python/cognito-backup/requirements-dev.in
packaging==26.0
packaging==26.1
# via pytest
pluggy==1.6.0
# via pytest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ruff: noqa: N801, N815 invalid-name
from marshmallow import ValidationError, pre_dump, validates_schema
from marshmallow.fields import UUID, Date, DateTime, List, String
from marshmallow.fields import UUID, AwareDateTime, Date, List, String
from marshmallow.validate import OneOf

from cc_common.config import config
Expand Down Expand Up @@ -37,7 +37,7 @@ class AdverseActionRecordSchema(BaseRecordSchema):
clinicalPrivilegeActionCategories = List(ClinicalPrivilegeActionCategoryField(), required=True, allow_none=False)
effectiveStartDate = Date(required=True, allow_none=False)
submittingUser = UUID(required=True, allow_none=False)
creationDate = DateTime(required=True, allow_none=False)
creationDate = AwareDateTime(required=True, allow_none=False)
adverseActionId = UUID(required=True, allow_none=False)

# Populated when the action is lifted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from abc import ABC

from marshmallow import EXCLUDE, RAISE, Schema, post_load, pre_dump
from marshmallow.fields import UUID, DateTime, String
from marshmallow.fields import UUID, AwareDateTime, String

from cc_common.config import config
from cc_common.data_model.schema.fields import Compact, SocialSecurityNumber
Expand Down Expand Up @@ -39,7 +39,7 @@ class BaseRecordSchema(ForgivingSchema, ABC):
# Generated fields
pk = String(required=True, allow_none=False)
sk = String(required=True, allow_none=False)
dateOfUpdate = DateTime(required=True, allow_none=False)
dateOfUpdate = AwareDateTime(required=True, allow_none=False)

# Provided fields
type = String(required=True, allow_none=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Jurisdiction,
)
from cc_common.data_model.schema.military_affiliation.common import MilitaryAuditStatus
from marshmallow.fields import UUID, Date, DateTime, Email, List, Nested, String
from marshmallow.fields import UUID, AwareDateTime, Date, Email, List, Nested, String
from marshmallow.validate import Length, OneOf


Expand All @@ -27,7 +27,7 @@ class PrivilegeEventLineItemSchema(ForgivingSchema):
class DataEventDetailBaseSchema(ForgivingSchema):
compact = Compact(required=True, allow_none=False)
jurisdiction = Jurisdiction(required=True, allow_none=False)
eventTime = DateTime(required=True, allow_none=False)
eventTime = AwareDateTime(required=True, allow_none=False)


class PrivilegePurchaseEventDetailSchema(DataEventDetailBaseSchema):
Expand Down Expand Up @@ -73,17 +73,17 @@ class LicenseRevertDetailSchema(DataEventDetailBaseSchema):
providerId = UUID(required=True, allow_none=False)
licenseType = String(required=True, allow_none=False)
rollbackReason = String(required=True, allow_none=False)
startTime = DateTime(required=True, allow_none=False)
endTime = DateTime(required=True, allow_none=False)
startTime = AwareDateTime(required=True, allow_none=False)
endTime = AwareDateTime(required=True, allow_none=False)
rollbackExecutionName = String(required=True, allow_none=False)


class PrivilegeRevertDetailSchema(DataEventDetailBaseSchema):
providerId = UUID(required=True, allow_none=False)
licenseType = String(required=True, allow_none=False)
rollbackReason = String(required=True, allow_none=False)
startTime = DateTime(required=True, allow_none=False)
endTime = DateTime(required=True, allow_none=False)
startTime = AwareDateTime(required=True, allow_none=False)
endTime = AwareDateTime(required=True, allow_none=False)
rollbackExecutionName = String(required=True, allow_none=False)


Expand All @@ -96,7 +96,7 @@ class MilitaryAuditEventDetailSchema(ForgivingSchema):
required=True, allow_none=False, validate=OneOf([entry.value for entry in MilitaryAuditStatus])
)
auditNote = String(required=False, allow_none=False)
eventTime = DateTime(required=True, allow_none=False)
eventTime = AwareDateTime(required=True, allow_none=False)


class HomeJurisdictionChangeEventDetailSchema(ForgivingSchema):
Expand All @@ -106,4 +106,4 @@ class HomeJurisdictionChangeEventDetailSchema(ForgivingSchema):
providerId = UUID(required=True, allow_none=False)
previousHomeJurisdiction = String(required=True, allow_none=True)
newHomeJurisdiction = String(required=True, allow_none=False)
eventTime = DateTime(required=True, allow_none=False)
eventTime = AwareDateTime(required=True, allow_none=False)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ruff: noqa: N801, N815 invalid-name
from marshmallow import Schema, ValidationError, pre_dump
from marshmallow.fields import UUID, DateTime, String
from marshmallow.fields import UUID, AwareDateTime, String

from cc_common.config import config
from cc_common.data_model.schema.base_record import BaseRecordSchema
Expand Down Expand Up @@ -32,10 +32,10 @@ class InvestigationRecordSchema(BaseRecordSchema, ValidatesLicenseTypeMixin):
# Populated on creation
investigationId = UUID(required=True, allow_none=False)
submittingUser = UUID(required=True, allow_none=False)
creationDate = DateTime(required=True, allow_none=False)
creationDate = AwareDateTime(required=True, allow_none=False)

# Populated when the investigation is closed
closeDate = DateTime(required=False, allow_none=False)
closeDate = AwareDateTime(required=False, allow_none=False)
closingUser = UUID(required=False, allow_none=False)
resultingEncumbranceId = UUID(required=False, allow_none=False)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ruff: noqa: N801, N815, ARG002 invalid-name unused-argument
from marshmallow import ValidationError, pre_load, validates_schema
from marshmallow.fields import UUID, Date, DateTime, String
from marshmallow.fields import UUID, AwareDateTime, Date, String
from marshmallow.validate import Length

from cc_common.data_model.schema.base_record import ForgivingSchema
Expand Down Expand Up @@ -84,4 +84,4 @@ class SanitizedLicenseIngestDataEventSchema(ForgivingSchema):
dateOfIssuance = Date(required=True, allow_none=False)
dateOfRenewal = Date(required=False, allow_none=False)
dateOfExpiration = Date(required=True, allow_none=False)
eventTime = DateTime(required=True, allow_none=False)
eventTime = AwareDateTime(required=True, allow_none=False)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from urllib.parse import quote

from marshmallow import ValidationError, post_dump, post_load, pre_dump, pre_load, validates_schema
from marshmallow.fields import UUID, Date, DateTime, Email, List, Nested, String
from marshmallow.fields import UUID, AwareDateTime, Date, Email, List, Nested, String
from marshmallow.validate import Length

from cc_common.config import config
Expand Down Expand Up @@ -55,7 +55,7 @@ class LicenseRecordSchema(BaseRecordSchema, LicenseCommonSchema):
# Optional field for tracking the first license upload that caused this record to be created
# Note that records which were uploaded before this field was supported will not have this included
# and will not be included in the license upload date GSI
firstUploadDate = DateTime(required=False, allow_none=False)
firstUploadDate = AwareDateTime(required=False, allow_none=False)

# Provided fields
npi = NationalProviderIdentifier(required=False, allow_none=False)
Expand Down Expand Up @@ -179,7 +179,7 @@ class LicenseUpdateRecordPreviousSchema(ForgivingSchema):
middleName = String(required=False, allow_none=False, validate=Length(1, 100))
familyName = String(required=True, allow_none=False, validate=Length(1, 100))
suffix = String(required=False, allow_none=False, validate=Length(1, 100))
dateOfUpdate = DateTime(required=True, allow_none=False)
dateOfUpdate = AwareDateTime(required=True, allow_none=False)
# These date values are determined by the license records uploaded by a state
# they do not include a timestamp, so we use the Date field type
dateOfIssuance = Date(required=True, allow_none=False)
Expand Down Expand Up @@ -218,11 +218,11 @@ class LicenseUpdateRecordSchema(BaseRecordSchema, ChangeHashMixin):
licenseType = String(required=True, allow_none=False)
previous = Nested(LicenseUpdateRecordPreviousSchema, required=True, allow_none=False)
# this tracks when the update record was created
createDate = DateTime(required=True, allow_none=False)
createDate = AwareDateTime(required=True, allow_none=False)
# this tracks when the update event should be considered in effect for the history of the license record
# note for most update types this is the same as the createDate, except encumbrances, which are effective
# based on the value provided by the state administrator
effectiveDate = DateTime(required=True, allow_none=False)
effectiveDate = AwareDateTime(required=True, allow_none=False)
# We'll allow any fields that can show up in the previous field to be here as well, but none are required
updatedValues = Nested(LicenseUpdateRecordPreviousSchema(partial=True), required=True, allow_none=False)
# optional field that is only included if the update was an investigation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ruff: noqa: N801, N815, ARG002 invalid-name unused-argument
from marshmallow import pre_dump
from marshmallow.fields import UUID, DateTime, List, String
from marshmallow.fields import UUID, AwareDateTime, List, String
from marshmallow.validate import Length, OneOf

from cc_common.config import config
Expand All @@ -26,7 +26,7 @@ class MilitaryAffiliationRecordSchema(BaseRecordSchema):
affiliationType = String(
required=True, allow_none=False, validate=OneOf([e.value for e in MilitaryAffiliationType])
)
dateOfUpload = DateTime(required=True, allow_none=False)
dateOfUpload = AwareDateTime(required=True, allow_none=False)
status = String(required=True, allow_none=False, validate=OneOf([e.value for e in MilitaryAffiliationStatus]))

# Generated fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import date

from marshmallow import Schema, ValidationError, post_dump, post_load, pre_dump, pre_load, validates_schema
from marshmallow.fields import UUID, Date, DateTime, List, Nested, String
from marshmallow.fields import UUID, AwareDateTime, Date, List, Nested, String
from marshmallow.validate import Length

from cc_common.config import config
Expand Down Expand Up @@ -83,8 +83,8 @@ class PrivilegeRecordSchema(BaseRecordSchema, ValidatesLicenseTypeMixin):
jurisdiction = Jurisdiction(required=True, allow_none=False)
licenseJurisdiction = Jurisdiction(required=True, allow_none=False)
licenseType = String(required=True, allow_none=False)
dateOfIssuance = DateTime(required=True, allow_none=False)
dateOfRenewal = DateTime(required=True, allow_none=False)
dateOfIssuance = AwareDateTime(required=True, allow_none=False)
dateOfRenewal = AwareDateTime(required=True, allow_none=False)
# this is determined by the license expiration date, which is a date field, so this is also a date field
dateOfExpiration = Date(required=True, allow_none=False)
# the id of the transaction that was made when the user purchased the privilege
Expand Down Expand Up @@ -135,7 +135,7 @@ def pre_load_initialization(self, in_data, **kwargs): # noqa: ARG001 unused-arg
def _enforce_datetimes(self, in_data, **kwargs):
# for backwards compatibility with the old data model
# we convert any records that are using a Date value
# for dateOfRenewal and dateOfIssuance to DateTime values
# for dateOfRenewal and dateOfIssuance to datetime values
in_data['dateOfRenewal'] = ensure_value_is_datetime(in_data.get('dateOfRenewal', in_data['dateOfIssuance']))
in_data['dateOfIssuance'] = ensure_value_is_datetime(in_data['dateOfIssuance'])

Expand Down Expand Up @@ -185,9 +185,9 @@ class PrivilegeUpdatePreviousRecordSchema(ForgivingSchema):
attestations = List(Nested(AttestationVersionRecordSchema()), required=True, allow_none=False)
compactTransactionId = String(required=True, allow_none=False)
dateOfExpiration = Date(required=True, allow_none=False)
dateOfIssuance = DateTime(required=True, allow_none=False)
dateOfRenewal = DateTime(required=True, allow_none=False)
dateOfUpdate = DateTime(required=True, allow_none=False)
dateOfIssuance = AwareDateTime(required=True, allow_none=False)
dateOfRenewal = AwareDateTime(required=True, allow_none=False)
dateOfUpdate = AwareDateTime(required=True, allow_none=False)
licenseJurisdiction = Jurisdiction(required=True, allow_none=False)
privilegeId = String(required=True, allow_none=False)
homeJurisdictionChangeStatus = HomeJurisdictionChangeStatusField(required=False, allow_none=False)
Expand Down Expand Up @@ -217,8 +217,8 @@ class PrivilegeUpdateRecordSchema(BaseRecordSchema, ChangeHashMixin, ValidatesLi
licenseType = String(required=True, allow_none=False)
compactTransactionIdGSIPK = String(required=True, allow_none=False)
previous = Nested(PrivilegeUpdatePreviousRecordSchema, required=True, allow_none=False)
createDate = DateTime(required=True, allow_none=False)
effectiveDate = DateTime(required=True, allow_none=False)
createDate = AwareDateTime(required=True, allow_none=False)
effectiveDate = AwareDateTime(required=True, allow_none=False)
# We'll allow any fields that can show up in the previous field to be here as well, but none are required
updatedValues = Nested(PrivilegeUpdatePreviousRecordSchema(partial=True), required=True, allow_none=False)
# optional field that is only included if the update was a deactivation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import timedelta

from marshmallow import ValidationError, validates_schema
from marshmallow.fields import UUID, Date, DateTime, Email, Integer, List, Nested, Raw, String
from marshmallow.fields import UUID, AwareDateTime, Date, Email, Integer, List, Nested, Raw, String
from marshmallow.validate import Length, OneOf, Range, Regexp

from cc_common.data_model.schema.base_record import ForgivingSchema
Expand Down Expand Up @@ -305,8 +305,8 @@ class QuerySchema(CCRequestSchema):
Nested schema for the query object within the request.
"""

startDateTime = DateTime(required=True, allow_none=False)
endDateTime = DateTime(required=True, allow_none=False)
startDateTime = AwareDateTime(required=True, allow_none=False)
endDateTime = AwareDateTime(required=True, allow_none=False)

class PaginationSchema(ForgivingSchema):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from urllib.parse import quote

from marshmallow import post_dump, post_load, pre_dump, pre_load
from marshmallow.fields import UUID, Date, DateTime, Email, List, Nested, String
from marshmallow.fields import UUID, AwareDateTime, Date, Email, List, Nested, String
from marshmallow.validate import Length, Regexp

from cc_common.config import config
Expand Down Expand Up @@ -72,11 +72,11 @@ class ProviderRecordSchema(BaseRecordSchema):
# Optional Email verification fields (only present if the provider has requested an email change)
pendingEmailAddress = Email(required=False, allow_none=False)
emailVerificationCode = String(required=False, allow_none=False, validate=Length(4, 4))
emailVerificationExpiry = DateTime(required=False, allow_none=False)
emailVerificationExpiry = AwareDateTime(required=False, allow_none=False)

# Optional fields for account recovery
recoveryToken = String(required=False, allow_none=False)
recoveryExpiry = DateTime(required=False, allow_none=False)
recoveryExpiry = AwareDateTime(required=False, allow_none=False)

# Military audit status fields
militaryStatus = MilitaryStatusField(required=False, allow_none=False)
Expand All @@ -86,7 +86,7 @@ class ProviderRecordSchema(BaseRecordSchema):
birthMonthDay = String(required=False, allow_none=False, validate=Regexp('^[0-1]{1}[0-9]{1}-[0-3]{1}[0-9]{1}'))
privilegeJurisdictions = Set(String, required=False, allow_none=False, load_default=set())
providerFamGivMid = String(required=False, allow_none=False, validate=Length(2, 400))
providerDateOfUpdate = DateTime(required=True, allow_none=False)
providerDateOfUpdate = AwareDateTime(required=True, allow_none=False)

# This field is set whenever the provider registers with the compact connect system,
# or updates their home jurisdiction.
Expand Down Expand Up @@ -215,7 +215,7 @@ class ProviderUpdatePreviousRecordSchema(ForgivingSchema):
militaryStatusNote = String(required=False, allow_none=False)

currentHomeJurisdiction = CurrentHomeJurisdictionField(required=False, allow_none=False)
dateOfUpdate = DateTime(required=True, allow_none=False)
dateOfUpdate = AwareDateTime(required=True, allow_none=False)


@BaseRecordSchema.register_schema('providerUpdate')
Expand All @@ -234,7 +234,7 @@ class ProviderUpdateRecordSchema(BaseRecordSchema, ChangeHashMixin):
compact = Compact(required=True, allow_none=False)
previous = Nested(ProviderUpdatePreviousRecordSchema, required=True, allow_none=False)
# this tracks when the update record was created
createDate = DateTime(required=True, allow_none=False)
createDate = AwareDateTime(required=True, allow_none=False)
# We'll allow any fields that can show up in the previous field to be here as well, but none are required
updatedValues = Nested(ProviderUpdatePreviousRecordSchema(partial=True), required=True, allow_none=False)
# List of field names that were present in the previous record but removed in the update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ aws-sam-translator==1.103.0
# moto
aws-xray-sdk==2.15.0
# via moto
boto3==1.42.89
boto3==1.42.91
# via
# aws-sam-translator
# moto
boto3-stubs[full]==1.42.89
boto3-stubs[full]==1.42.91
# via -r lambdas/python/common/requirements-dev.in
boto3-stubs-full==1.42.88
boto3-stubs-full==1.42.91
# via boto3-stubs
botocore==1.42.89
botocore==1.42.91
# via
# aws-xray-sdk
# boto3
Expand All @@ -50,7 +50,7 @@ cryptography==46.0.7
# moto
docker==7.1.0
# via moto
faker==40.13.0
faker==40.15.0
# via -r lambdas/python/common/requirements-dev.in
graphql-core==3.2.8
# via moto
Expand Down Expand Up @@ -115,7 +115,7 @@ pydantic==2.12.4
# pydantic-settings
pydantic-core==2.41.5
# via pydantic
pydantic-settings==2.13.1
pydantic-settings==2.14.0
# via
# openapi-schema-validator
# openapi-spec-validator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ argon2-cffi>=25.1.0, <26.0.0
aws-lambda-powertools>=3.5.0, <4
boto3>=1.34.33, <2
cryptography>=46, <47
marshmallow>=3.21.3, <4.0.0
marshmallow>=4.3.0, <5.0.0
requests>=2.31.0, <3.0.0
Loading
Loading