Panier - Persist

Enregistre un panier existant.

Si finalize=true, l’enregistre dans Odoo, et crée un nouveau panier vide

finalize = false

Async

sequenceDiagram participant U as UI participant A as API participant K as Kafka participant J as Job participant N as KafkaNotif participant O as Odoo activate U U->>A: persist(finalize=false) activate A A->>K: persist(finalize=false) A->>U: retour API (isSync=false) K->>J: persist(finalize=false) activate J J->>J: save BDD J->>K: ItemNotif J->>K: DoneNotif J->>K: Data J->>K: ToCentral deactivate J K->>N: ItemNotif,DoneNotif N->>U: ItemNotif,DoneNotif deactivate U

Sync

sequenceDiagram participant U as UI participant A as API participant K as Kafka participant J as Job participant N as KafkaNotif participant O as Odoo activate U U->>A: persist(finalize=false) activate A A->>A: save BDD A->>K: ItemNotif A->>K: DoneNotif A->>K: Data A->>K: ToCentral A->>U: retour API (isSync=true) deactivate A deactivate U K->>N: ItemNotif,DoneNotif N->>U: ItemNotif,DoneNotif

finalize = true

Lors d’un persist finalize=true, le panier courant est enregistré en BDD, créé dans Odoo, et un nouveau panier vide est renvoyé.

Async

sequenceDiagram participant U as UI participant A as API participant K as Kafka participant J as Job participant N as KafkaNotif participant O as Odoo activate U U->>A: persist(finalize=true) activate A A->>K: persist(finalize=true) A->>U: retour API (isSync=false) K->>J: persist(finalize=true) activate J J->>J: save BDD J->>O: save Odoo J->>K: ItemNotif (finalize) J->>K: Data (finalize) J->>K: ToCentral (finalize) J->>J: new basket + save BDD J->>K: ItemNotif (newBasket) J->>K: Data (newBasket) J->>K: DoneNotif (finalize+new basket) deactivate J K->>N: ItemNotif*2,DoneNotif N->>U: ItemNotif*2,DoneNotif deactivate U

Sync

sequenceDiagram participant U as UI participant A as API participant K as Kafka participant J as Job participant N as KafkaNotif participant O as Odoo activate U U->>A: persist(finalize=false) activate A A->>A: save BDD A->>O: save Odoo A->>K: ItemNotif (finalize) A->>K: Data (finalize) A->>K: ToCentral (finalize) A->>A: new basket + save BDD A->>K: ItemNotif (newBasket) A->>K: Data (newBasket) A->>K: DoneNotif (finalize+new basket) A->>U: retour API (isSync=true + new basket) deactivate A deactivate U K->>N: ItemNotif*2,DoneNotif N->>U: ItemNotif*2,DoneNotif