Skip to content

Story 1: Develop scaffolding code for managing BidList Entity #1

@ebouchut

Description

@ebouchut

Implement the RESTFUL API for creating a BidList Entity to do the Spring Data Repository:

  1. Implement the RESTFUL API for reading a BidList Entity from the existing Spring DataRepository
  2. Implement the RESTFUL API for updating a BidList Entity from the existing Spring DataRepository
  3. Implement the RESTFUL API for deleting a BidList Entity from the existing Spring Data Repository

Add attributes to the BidList entity class

  • Integer BidListId;
  • String account;
  • String type;
  • Double bidQuantity;
  • Double askQuantity;
  • Double bid;
  • Double ask;
  • String benchmark;
  • Timestamp bidListDate;
  • String commentary;
  • String security;
  • String status;
  • String trader;
  • String book;
  • String creationName;
  • Timestamp creationDate;
  • String revisionName;
  • Timestamp revisionDate;
  • String dealName;
  • String dealType;
  • String sourceListId;
  • String side;

Fix the database column and entity field names mapping

The next step is to ensure that each entity field name is mapped to the corresponding database column name, for instance:

@Column(name = "status")  // Database column name
private String status;    // Entity field name

‼️ PROBLEM: The original database column names is NON conventional (🌴)
with a mix of:

  • PascalCase: BidList
  • Plural: Users

whereas the conventional naming convention is:

  • snake_case and lowercase: bid_list
  • singular: user

Fix this both in the database tables creation SQL script and the entity class.

Configure audit fields

  • BidList.creationDate: when this entity was created
    • Should not be null, nor updated once set.
      @CreatedDate
      @Column(name = "creation_date", nullable = false, updatable = false)
      private Instant creationDate;
    • Update the database column accordingly in the schema file
    • Use the Instant data type to take into account the time zone
  • BidList.revisionDate: the date when this entity was last modified
    • Should not be null, but can be updated
      @LastModifiedDate
      @Column(name = "revision_date", nullable = false)
      private Instant revisionDate;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions