TODO:


- Subscriptions need to be a first class root object and drive other stuff, it's not good enough to have licenses and purchases
    Make subscriptions fully realized and populate and update.
    - Need to be able to run an revenue projected report based on timeframe
    - need to be able to start stop and archive subscriptions and use them to make licenses from multiple selected
    - Subscription "group"?? (was "site" :) 
    - works like taskgroup and taskitems one collection open and has table in form with subitems
        in other words not like workorder where items are a separate data table


    Subscription object (ICON "file-contract")
        - customer id
        - active
        - product group
        subscription item
            - product
            - quantity
            - expires
            - active



-- Database: sockeye

-- DROP DATABASE IF EXISTS sockeye;

CREATE DATABASE sockeye
    WITH
    OWNER = postgres
    ENCODING = 'UTF8'
    LC_COLLATE = 'English_United States.1252'
    LC_CTYPE = 'English_United States.1252'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1
    IS_TEMPLATE = False;













- 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


- Replace old rockfish docs site with something in sockeye so one place for all



FUTURE STUFF

- 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



- 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)



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.
