Skip to content

Integrate MongoDB for full order_spec persist order_spec JSON to MongoDB (Adapter pattern) #3

@raggopaluni

Description

@raggopaluni

Goal:

  • Save the full JSON order_spec (the original request body) into MongoDB, associated with order_id.

Tasks:

  • Add services/mongo_client.py with Mongo client (Singleton pattern).
  • Create services/repository.py with an OrderRepository interface and adapters:
    • PostgresRepository (for metadata)
    • MongoRepository (for order_spec)
  • On POST /orders: insert doc into Mongo: {order_id, spec, created_at}
  • Modify GET /orders/{order_id} to combine Postgres metadata + Mongo order_spec in response.

Acceptance criteria:

  • Creating an order persists data in both Postgres and Mongo.
  • GET returns combined view: metadata + spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions