# BUY 1616 --> direct sales phone number https://casavo.atlassian.net/browse/BUY-1616 ## TODO - [ ] ~~che fare con le città in provincia di (it/sesto-san-giovanni) ?~~ - andando su le modifiche sia su Doris che su Cate, avremo che per queste città (nel caso di immobile casavo) il numero che verrà proiettato (e quindi mostrato nel dettaglio) sarà quello messo all'interno dell'evento e non quello della città di riferimento - forse non servirà mai in quanto al momento mai nessun listing di immobile casavo è stato pubblicato in quelle città - nel caso servisse si può - soluzione a - veloce e sporca: estendere questa mappa con anche quelle città `lib/cate/listing/projector/listing_detail_adapter.ex` - soluzione b - più lenta e pulita: provare a capire in Cate, così come faceva Doris, a quale "reference area" appartiene quella città (es `it/scandicci` ha come reference area `it/firenze`) - [ ] ~~what about email on casavo properties and direct sales ? ('sales.firenze@casavo.com', etc etc)~~ - diamo per buono quello che arriva nell'evento - lato "listing platform" non usiamo per ora l'email (anche se è esposta via graphql dentro contact_info) - [ ] ~~fallback on agency contacts when listing contacts are nil (?)~~ - currently email and phone are mandatory on doris during listing compile and provided data is passed as listing contacts (email + phone) - we can always ignore contacts in agency node - [ ] remove phone overwrite from lisa ## Current Events * `ListingApproved` & `ListingUpdateApproved` * issues * contact phone -> get the one from listing and apply to agency * contact email -> get the one from listing and apply to agency * logo * agency address -> from listing * agency name -> from listing, if not from agency.companyName current event: ```json "ListingApproved.Payload" : { "listingId": "listing-uuid" "agencyId": "agency-uuid" "agency": { "telephoneNumberContact": "0909080", "emailContact": "agent007@agency.com", "name": "An Agency", "address": "Via Non So Chi, 23, Città", "logo": "url://img" }, "telephoneNumberContact": "0909080", "emailContact": "agent007@agency.com", } ``` proposed ```json "ListingApproved.Payload" : { "id": "listing-uuid", "listingId": "listing-uuid", "agencyId": "agency-uuid", "agency": { "id": "agency-uuid", "telephoneNumberContact": "0808", "emailContact": "info@agency.com", "name": "An Agency", "address": "Via Non So Chi, 23, Città", "logo": "url://img" }, "telephoneNumberContact": "0909080", "emailContact": "agent007@agency.com", "nameContact": "Agente 007", "addressContact": "Via Qualcosa" } ``` ## Event Desiderata by Use Case ### Agency Approved (pubblica suoi annunci ma non annunci casavo) * nodo "agency" * riempito con dati agenzia * nodo "contact": * riempi con telefono ed email eventualmente inseriti in fase di pubblicazione singolo listing (fallback su telefono/email agenzia) Contatto modificato: ```json "ListingApproved.Payload" : { "id": "listing-uuid", "listingId": "listing-uuid", "agencyId": "agency-uuid", "ownedByCasavo": false, "casavoDirectSale": false, "agency": { "id": "agency-uuid" "telephoneNumberContact": "0234567", "emailContact": "info@agency.com", "name": "An Agency", "address": "Via Non So Chi, 23, Città", "logo": "url://something" }, "telephoneNumberContact": "0909080", "emailContact": "agent007@agency.com", "nameContact": null, "addressContact": null } ``` Contatto prefilled: ```json "ListingApproved.Payload" : { "id": "listing-uuid", "listingId": "listing-uuid", "agencyId": "agency-uuid", "ownedByCasavo": false, "casavoDirectSale": false, "agency": { "id": "agency-uuid" "telephoneNumberContact": "0234567", "emailContact": "info@agency.com", "name": "An Agency", "address": "Via Non So Chi, 23, Città", "logo": "url://something" }, "telephoneNumberContact": "0234567", "emailContact": "info@agency.com", "nameContact": null, "addressContact": null } ``` Notes & Improvements: * agency -> logo ---> recuperare logo agenzia da zuul ### Agency Reseller (pubblica annunci suoi e brokered casavo) #### Annunci suoi :top: come sopra :top: #### Annunci Casavo brokered * nodo "agency" * riempito con dati agenzia * nodo "contact": * vuoto, non mostro campo a FE ```json "ListingApproved.Payload" : { "listingId": "listing-uuid", "agencyId": "agency-uuid", "id": "listing-uuid", "ownedByCasavo": true, "casavoDirectSale": false, "agency": { "id": "agency-uuid" "telephoneNumberContact": "0234567", "emailContact": "info@agency.com", "name": "An Agency", "address": "Via Non So Chi, 23, Città", "logo": "url://something" }, "telephoneNumberContact": null, "emailContact": null, "nameContact": null, "addressContact": null } ``` ### Casavo Publisher (casavo direct sales o brokered sales non inserite da reseller) * superpoteri: può inserire nome agenzia e indirizzo agenzia come testo libero per le brokered di agenzie pigre (i.e. che non hanno inserito listing casavo a loro affidati con il loro account doris) #### Brokered Pigro ```json "ListingApproved.Payload" : { "id": "listing-uuid", "listingId": "listing-uuid", "agencyId": "casavo-publisher-uuid", "ownedByCasavo": true, "casavoDirectSale": false, "agency": { "id": "casavo-publisher-uuid" "telephoneNumberContact": "02.casavo.publisher", "emailContact": "casavo.publisher@casavo.com", "name": "Casavo Publisher", "address": "Via Lombardini 10, Milano", "logo": "url://something" }, "telephoneNumberContact": "05657676767", "emailContact": "agency@svogliato.com", "nameContact": "Agenzia Svogliata", "addressContact": "Via della Pigrizia, 23" } ``` #### Direct Sale ```json "ListingApproved.Payload" : { "id": "listing-uuid", "listingId": "listing-uuid", "agencyId": "casavo-publisher-uuid", "ownedByCasavo": true, "casavoDirectSale": true, "agency": { "id": "casavo-publisher-uuid" "telephoneNumberContact": "02.casavo.publisher", "emailContact": "casavo.publisher@casavo.com", "name": "Casavo Publisher", "address": "Via Lombardini 10, Milano", "logo": "url://something" }, "telephoneNumberContact": null, "emailContact": null, "nameContact": null, "addressContact": null } ``` ## Cose varie ... * cosa possiamo fare ora: * nodo `agency` di evento -> info della "agenzia doris" sta pubblicando/aggiornando il listing * aggiungere `nameContact` e `addressContact` a nodo root di evento per gestire caso di CasavoPublisher>BrokeredPigro * togliere inserimento logo agenzia da FE doris * lato `doris` non servirà più sovrascrivere con dati contatto sales casavo per "is owned by casavo" * lato `cate` andrà a "sovrascrivere" le info di contatto per gli immobili "is owned by casavo | is direct sale" * fuck off carol :P * far morire Casavo Publisher > Broker pigro ... è l'unico caso incasinato nella gestione agency/contact * ragionare su altro sistema (i.e. non doris) per la pubblicazione di tutto quello che è immobile casavo (sia direct che brokered), che emetterebbe altro evento