TODO:


- JOB: Process purchases that are from vendor notification
    - create customer if necessary from purchase notification or add to existing
    - if v7 needs to account for there being a delay sometimes in order completeness
        maybe just keep adding to the order and refreshing 

- JOB: make a license from purchases but not active ready to send / in waiting only for approval
    - if v7 needs to account for there being a delay sometimes in order completeness
        maybe just keep adding to the order and refreshing 
        IDEA: if v7 don't process into a license until the newest purchase for the same customer are at least XX minutes old
            they almost seem to be done manually by mycommerce but I'd say there's no more than 15 minutes max for all to come in
            !!! maybe look at email history of previous orders and see what the max delay is between order recepts !!!!
    

- JOB: "SOCKBOT" virtual staff member, 
    sockbot - does everything we have to do manually on a delay if it hasn't been done by us yet 
    or tees up as much as possible whatever we need so we can just ok it or if too much time elapses just goes ahead with some things
    will require a bit of a UI for config and stuff but that's ok
    i.e. if a day goes by without intervention then just process 
    should cover every customer need possible:
        Trial license request
            this could potentially just be done automatically now becuase they can't use it to continually use raven so were not protecting anything
        Purchase
            v8 subscription renewal
            v8 perpetual new or renewal
            v7 renewal or new
        Tech support email
            if a support request is received or email to support@ayanova.com
            it should check if they are a known email address of a customer and auto-reply if still sitting in inbox for  certain length of time
            i.e. if it's outside biz hours then auto-respond with biz hours will get back to them here's a manual link just in case their question is already answered etc



- manually simulate v7 fetch from rockfish compare to manual test locally in sockey confirm
    Same data shape and format
    fetched is set correctly
    headers
    tls version (once online are the same, should be since it's going through nginx technically for the tls part)
- Test v8 key fetch, trial request, all critical event notifications, event logging -  the whole shebang locally 
- ONLINE TEST
    Install and put on sockeye.ayanova.com subdomain in nginx on alternate port
    Test ui functionality logins etc


- SUBSCRIPTION SERVER UI
    - Menu option generate server creation standup script based on settings in form
    can fill out form, click on it and it will generate the script needed to paste into new server
    - Button to trigger D.O. API to requisition server automatically, spin it up etc


- Add ui to front the route under /api/v8/license/v7-reset-manager-creds

- direct open a case by case number like workorder
(id's differ so it isn't easy to just open a case in the url)

WHEN RUNNING
- Subscribe to following notifications:
    Ops problem event should notify me immediately
    server state first and second fails notify for starters but on a non alerting method so for FYI purposes
    server state 3rd fail should notify via some immediate and loud means regardless of time of day for starters
    server state 3rd fail age of more than XX minutes should esclate to a secondary means of alerting, maybe email to text?
        todo: see if email to text can be set at phone end to recognize sender as a spcecific contact and set a crazy loud any time alarm for it

LATER

- ** DOCS Once it's up and running update docs to mention that perpetual trial period is two weeks subscription is one week
- trial server request route that contact form can trigger
- Subscription server trial request form through Sockeye instead?
    or perhaps it sends to sockeye route?
    this allows for automation and notification handling and auto generation
- Contact form via sockeye instead?
    or perhaps it sends to sockey contact route?
    this allows for automation and notification handling and auto reply once qualified if a customer or not
- Need ui that shows money required for paying future for yearly subs so at a glance know what money need in bank each month


////////////////////////////////////////////////////////////////////////////////////////////
//OLD 



    ==============================
    certbot expand

    root@devops:/etc/nginx/sites-available# certbot --nginx --cert-name test.onayanova.com -d test.onayanova.com,subtest.onayanova.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You are updating certificate test.onayanova.com to include new domain(s):
+ subtest.onayanova.com

You are also removing previously included domain(s):
(None)

Did you intend to make this change?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(U)pdate certificate/(C)ancel: u
Renewing an existing certificate for test.onayanova.com and subtest.onayanova.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/test.onayanova.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/test.onayanova.com/privkey.pem
This certificate expires on 2023-04-04.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for test.onayanova.com to /etc/nginx/sites-enabled/default
Could not install certificate

NEXT STEPS:
- The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running:
  certbot install --cert-name test.onayanova.com

Could not automatically find a matching server block for subtest.onayanova.com. Set the `server_name` directive to use the Nginx installer.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
