package Ġcom . merc ad ol iv ro . model Ċ Ċ import Ġcom . merc ad ol iv ro . enums . Book Status Ċ import Ġcom . merc ad ol iv ro . enums . Errors Ċ import Ġcom . merc ad ol iv ro . exception . BadRequest Exception Ċ import Ġjava . math . BigDecimal Ċ import Ġjava . time . LocalDateTime Ċ import Ġjavax . persistence .* Ċ Ċ @ Entity ( name =" purchase ") Ċ data Ġclass ĠPurchase Model ( ĊĊĠĠĠ Ġ@ Id ĊĠĠĠ Ġ@ GeneratedValue ( strategy Ġ= ĠGeneration Type . IDENTITY ) ĊĠĠĠ Ġvar Ġid : ĠInt ? Ġ= Ġnull , ĊĊĠĠĠ Ġ@ ManyToOne ĊĠĠĠ Ġ@ JoinColumn ( name =" seller ") ĊĠĠĠ Ġvar Ġsell er : ĠCustomer Model , ĊĊĠĠĠ Ġ@ ManyToOne ĊĠĠĠ Ġ@ JoinColumn ( name =" buyer ") ĊĠĠĠ Ġvar Ġbuy er : ĠCustomer Model , ĊĊĠĠĠ Ġ@ ManyToMany ĊĠĠĠ Ġ@ Join Table ( name =" purchase _ book ", ĊĠĠĠĠĠĠĠ Ġjoin Columns Ġ= Ġ[ JoinColumn ( name =" purchase _ id ") ], ĊĠĠĠĠĠĠĠ Ġinverse Join Columns Ġ= Ġ[ JoinColumn ( name =" book _ id ") ]) ĊĠĠĠ Ġvar Ġbooks : ĠMutable List < Book Model >, ĊĊĠĠĠ Ġ@ Column ĊĠĠĠ Ġvar Ġn fe : ĠString ? Ġ= Ġnull , ĊĊĠĠĠ Ġ@ Column ĊĠĠĠ Ġvar Ġprice : ĠBigDecimal , ĊĊĠĠĠ Ġ@ Column ĊĠĠĠ Ġval ĠcreatedAt : ĠLocalDateTime Ġ= ĠLocalDateTime . now () Ċ ){ Ċ }