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

Case file links response change #172

Merged
merged 1 commit into from
Dec 13, 2024
Merged
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
12 changes: 2 additions & 10 deletions compliance-api/src/compliance_api/schemas/case_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""CaseFile Schema."""
from marshmallow import EXCLUDE, Schema, fields, post_dump, post_load, pre_dump
from marshmallow import EXCLUDE, Schema, fields, post_dump, post_load
from marshmallow_enum import EnumField

from compliance_api.models import CaseFile, CaseFileLink, CaseFileOfficer, CaseFileStatusEnum
Expand Down Expand Up @@ -212,21 +212,13 @@ class Meta(AutoSchemaBase.Meta): # pylint: disable=too-few-public-methods
class CaseFileOptionSchema(Schema): # pylint: disable=too-many-ancestors
"""CaseFileOptionSchema."""

case_file_id = fields.Int(
id = fields.Int(
metadata={"description": "The unique identifier of the case file."}
)
case_file_number = fields.Str(
metadata={"description": "The unique case file number of the case file."}
)

@pre_dump
def map_id_to_case_file_id(
self, data, **kwargs
): # pylint: disable=no-self-use, unused-argument
"""Map id to case_file_id."""
setattr(data, "case_file_id", data.id)
return data


class CaseFileUnlinkSchema(BaseSchema):
"""CaseFileUnlinkSchema."""
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.