package Ġcom . s ama . meeting . infrastructure . jpa Ċ Ċ import Ġcom . s ama . common . Factory Ċ import Ġcom . s ama . meeting . domain . Actor Ċ import Ġcom . s ama . meeting . domain . Confirmed Meeting Ċ import Ġcom . s ama . meeting . domain . Email Recipient Ċ import Ġcom . s ama . meeting . domain . Meeting Id Ċ import Ġcom . s ama . meeting . domain . Meeting Slot Ċ import Ġcom . s ama . meeting . domain . Meeting Status Ċ import Ġcom . s ama . meeting . domain . S ama Non S ama Pro posed Meeting Ċ import Ġcom . s ama . meeting . domain . S ama S ama Pro posed Meeting Ċ import Ġcom . s ama . meeting . domain . User Recipient Ċ import Ġjava . time . Instant Ċ import Ġjava . time . Z onedDateTime Ċ import Ġjavax . persistence . Attribute Override Ċ import Ġjavax . persistence . Attribute Overrides Ċ import Ġjavax . persistence . Cascade Type Ċ import Ġjavax . persistence . Column Ċ import Ġjavax . persistence . Embed d able Ċ import Ġjavax . persistence . Embedded Ċ import Ġjavax . persistence . Entity Ċ import Ġjavax . persistence . Enum Type Ċ import Ġjavax . persistence . Enumer ated Ċ import Ġjavax . persistence . Fetch Type Ċ import Ġjavax . persistence . GeneratedValue Ċ import Ġjavax . persistence . Generation Type Ċ import Ġjavax . persistence . Id Ċ import Ġjavax . persistence . JoinColumn Ċ import Ġjavax . persistence . OneToMany Ċ import Ġjavax . persistence . Table Ċ import Ġorg . springframework . data . annotation . Created Date Ċ import Ġorg . springframework . data . annotation . Last ModifiedDate Ċ Ċ @ Entity Ċ @ Table ( schema Ġ= Ġ" s ama ", Ġname Ġ= Ġ" meeting ") Ċ class ĠMeeting Entity Ġ{ ĊĊĠĠĠ Ġ@ Factory ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew ( pro posed Meeting : ĠS ama Non S ama Pro posed Meeting ): ĠMeeting Entity Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġentity Ġ= ĠMeeting Entity () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . id Ġ= Ġproposed Meeting . meeting Id . id ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . code Ġ= Ġproposed Meeting . meeting Code . code ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . meeting Intent Id Ġ= Ġproposed Meeting . meeting Intent Id . id ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . meeting Recipient Ġ= Ġnull ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . current Actor Ġ= ĠActor . RE CI PI ENT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . createdAt Ġ= ĠInstant . now () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . updatedAt Ġ= ĠInstant . now () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . status Ġ= Ġproposed Meeting . status ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . title Ġ= Ġproposed Meeting . meeting Title ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . permanent Link Ġ= Ġproposed Meeting . meeting Preferences . permanent Link ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġproposed Slots Ġ= Ġproposed Meeting . pro posed Slots . map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġit . to Entity ( pro posed Meeting . meeting Id , ĠMeeting Slot Status . PRO POSE D ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . pro posed Slots . addAll ( pro posed Slots ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġentity ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun Ġnew ( pro posed Meeting : ĠS ama S ama Pro posed Meeting ): ĠMeeting Entity Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġentity Ġ= ĠMeeting Entity () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . id Ġ= Ġproposed Meeting . meeting Id . id ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . code Ġ= Ġproposed Meeting . meeting Code . code ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . meeting Intent Id Ġ= Ġproposed Meeting . meeting Intent Id . id ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . meeting Recipient Ġ= ĠMeeting Recipient Entity ( pro posed Meeting . recipient Id . id , Ġnull ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . current Actor Ġ= Ġproposed Meeting . current Actor ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . status Ġ= Ġproposed Meeting . status ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . title Ġ= Ġproposed Meeting . meeting Title ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . permanent Link Ġ= Ġproposed Meeting . meeting Preferences . permanent Link ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġproposed Slots Ġ= Ġproposed Meeting . pro posed Slots . map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġit . to Entity ( pro posed Meeting . meeting Id , ĠMeeting Slot Status . PRO POSE D ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġrejected Slots Ġ= Ġproposed Meeting . rejected Slots . map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġit . to Entity ( pro posed Meeting . meeting Id , ĠMeeting Slot Status . RE JECT ED ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . pro posed Slots . addAll ( pro posed Slots ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . pro posed Slots . addAll ( rejected Slots ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġnow Ġ= ĠInstant . now () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . createdAt Ġ= Ġnow ĊĠĠĠĠĠĠĠĠĠĠĠ Ġentity . updatedAt Ġ= Ġnow ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġentity ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġapply Changes ( pro posed Meeting : ĠS ama Non S ama Pro posed Meeting ): ĠMeeting Entity Ġ{ ĊĠĠĠĠĠĠĠ Ġtitle Ġ= Ġproposed Meeting . meeting Title ĊĠĠĠĠĠĠĠ Ġpermanent Link Ġ= Ġproposed Meeting . meeting Preferences . permanent Link ĊĠĠĠĠĠĠĠ Ġval Ġnow Ġ= ĠInstant . now () ĊĠĠĠĠĠĠĠ Ġthis . updatedAt Ġ= Ġnow ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġapply Changes ( pro posed Meeting : ĠS ama S ama Pro posed Meeting ): ĠMeeting Entity Ġ{ ĊĠĠĠĠĠĠĠ Ġtitle Ġ= Ġproposed Meeting . meeting Title ĊĠĠĠĠĠĠĠ Ġpermanent Link Ġ= Ġproposed Meeting . meeting Preferences . permanent Link ĊĠĠĠĠĠĠĠ Ġmeeting Recipient Ġ= ĠMeeting Recipient Entity ( pro posed Meeting . recipient Id . id , Ġnull ) ĊĠĠĠĠĠĠĠ Ġcurrent Actor Ġ= Ġproposed Meeting . current Actor ĊĠĠĠĠĠĠĠ Ġval Ġproposed Slots Ġ= Ġproposed Meeting . pro posed Slots . map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . to Entity ( pro posed Meeting . meeting Id , ĠMeeting Slot Status . PRO POSE D ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġrejected Slots Ġ= Ġproposed Meeting . rejected Slots . map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . to Entity ( pro posed Meeting . meeting Id , ĠMeeting Slot Status . RE JECT ED ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġthis . pro posed Slots . clear () ĊĠĠĠĠĠĠĠ Ġthis . pro posed Slots . addAll ( pro posed Slots ) ĊĠĠĠĠĠĠĠ Ġthis . pro posed Slots . addAll ( rejected Slots ) ĊĠĠĠĠĠĠĠ Ġval Ġnow Ġ= ĠInstant . now () ĊĠĠĠĠĠĠĠ Ġthis . updatedAt Ġ= Ġnow ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġapply Changes ( confirmed Meeting : ĠConf irmed Meeting ): ĠMeeting Entity Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . status Ġ= Ġconfirmed Meeting . status ĊĠĠĠĠĠĠĠ Ġthis . meeting Recipient Ġ= Ġwhen Ġ( val Ġrecipient Ġ= Ġconfirmed Meeting . recipient ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠEmail Recipient Ġ-> ĠMeeting Recipient Entity ( null , Ġrecipient . email ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠUser Recipient Ġ-> ĠMeeting Recipient Entity ( recipient . recipient Id . id , Ġnull ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġthis . confirmed Slot Ġ= Ġconfirmed Meeting . slot ĊĠĠĠĠĠĠĠ Ġval Ġnow Ġ= ĠInstant . now () ĊĠĠĠĠĠĠĠ Ġthis . confirmed At Ġ= Ġnow ĊĠĠĠĠĠĠĠ Ġthis . updatedAt Ġ= Ġnow ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Id ĊĠĠĠ Ġvar Ġid : ĠLong ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġvar Ġmeeting Intent Id : ĠLong ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġ@ Enumer ated ( Enum Type . STRING ) ĊĠĠĠ Ġvar Ġstatus : ĠMeeting Status ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Column ( name Ġ= Ġ" meeting _ code ") ĊĠĠĠ Ġvar Ġcode : ĠString ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġvar Ġtitle : ĠString ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Column ĊĠĠĠ Ġvar Ġpermanent Link : ĠBoolean ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Column ĊĠĠĠ Ġvar Ġblock Out Slots : ĠBoolean ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġ@ Enumer ated ( Enum Type . STRING ) ĊĠĠĠ Ġvar Ġcurrent Actor : ĠActor ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ OneToMany ( cascade Ġ= Ġ[ Cascade Type . ALL ], Ġorphan Removal Ġ= Ġtrue , Ġfetch Ġ= ĠFetch Type . LA ZY ) ĊĠĠĠ Ġ@ JoinColumn ( name Ġ= Ġ" meeting Id ", Ġnullable Ġ= Ġfalse , Ġup datable Ġ= Ġfalse , Ġinser table Ġ= Ġfalse ) ĊĠĠĠ Ġvar Ġproposed Slots : ĠMutable List < Meeting Pro posed Slot Entity > Ġ= Ġmutable ListOf () ĊĊĠĠĠ Ġ@ Embedded ĊĠĠĠ Ġ@ Attribute Overrides ( ĊĠĠĠĠĠĠĠ ĠAttribute Override ( name Ġ= Ġ" recipient Id ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" recipient _ id ")), ĊĠĠĠĠĠĠĠ ĠAttribute Override ( name Ġ= Ġ" email ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" recipient _ email ")) ĊĠĠĠ Ġ) ĊĠĠĠ Ġvar Ġmeeting Recipient : ĠMeeting Recipient Entity ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Embedded ĊĠĠĠ Ġ@ Attribute Overrides ( ĊĠĠĠĠĠĠĠ ĠAttribute Override ( name Ġ= Ġ" start DateTime ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" confirmed _ slot _ start _ date _ time ")), ĊĠĠĠĠĠĠĠ ĠAttribute Override ( name Ġ= Ġ" end DateTime ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" confirmed _ slot _ end _ date _ time ")) ĊĠĠĠ Ġ) ĊĠĠĠ Ġvar Ġconfirmed Slot : ĠMeeting Slot ? Ġ= Ġnull ĊĊĠĠĠ Ġvar Ġconfirmed At : ĠInstant ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Created Date ĊĠĠĠ Ġvar ĠcreatedAt : ĠInstant ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Last ModifiedDate ĊĠĠĠ Ġvar ĠupdatedAt : ĠInstant ? Ġ= Ġnull Ċ } Ċ Ċ @ Entity Ċ @ Table ( schema Ġ= Ġ" s ama ", Ġname Ġ= Ġ" meeting _ pro posed _ slot ") Ċ class ĠMeeting Pro posed Slot Entity ( ĊĠĠĠ Ġ@ Id Ġ@ GeneratedValue ( strategy Ġ= ĠGeneration Type . IDENTITY ) ĊĠĠĠ Ġvar Ġid : ĠLong ? Ġ= Ġnull , ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġprivate Ġval Ġmeeting Id : ĠMeeting Id , ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġvar Ġstart DateTime : ĠZ onedDateTime , ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġvar Ġend DateTime : ĠZ onedDateTime , ĊĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġ@ Enumer ated ( Enum Type . STRING ) ĊĠĠĠ Ġvar Ġstatus : ĠMeeting Slot Status , ĊĊĠĠĠ Ġ@ Created Date ĊĠĠĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠĠĠ Ġvar ĠcreatedAt : ĠInstant ? Ġ= Ġnull , Ċ ) Ċ Ċ enum Ġclass ĠMeeting Slot Status Ġ{ ĊĠĠĠ ĠPRO POSE D , ĠRE JECT ED Ċ } Ċ Ċ @ Embed d able Ċ data Ġclass ĠMeeting Recipient Entity ( val Ġrecipient Id : ĠLong ?, Ġval Ġemail : ĠString ?) Ċ Ċ private Ġfun ĠMeeting Slot . to Entity ( meeting Id : ĠMeeting Id , Ġstatus : ĠMeeting Slot Status ): ĠMeeting Pro posed Slot Entity Ġ{ ĊĠĠĠ Ġreturn ĠMeeting Pro posed Slot Entity ( ĊĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠ Ġmeeting Id , ĊĠĠĠĠĠĠĠ Ġstart DateTime , ĊĠĠĠĠĠĠĠ Ġend DateTime , ĊĠĠĠĠĠĠĠ Ġstatus , ĊĠĠĠĠĠĠĠ ĠInstant . now () ĊĠĠĠ Ġ) Ċ }