Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

## Overview

---

## Stakeholders

---

## High Level Design – Component

---

## High Level Design – Deployment

---

## Core Application

---

## Diagrams & Processes

---

## Tech Stack

---

## DevOps

---
### Deployment

### Checklist

### Security

### Database Configuration

### Configuration

The key configuration files are:

### Operational Tasks

## Functional

---

## Scheduled Jobs

Jobs are scheduled in Osmtech via Cron.  The specific jobs only run on the primary server.

CRON TIME FUNCTIONALITY


dayPartingStateUpdate(currentDay, currentHour, time) At every 15th
minute.
activateDayPartQueueProcess() At minute 55.
dayPartQueueProcess() At minute 46
past every
hour.
fetchAndStoreCampaignsPortfolio() At minute 40
past every
12th hour.
fetchAndStoreSBVideoData() At 03:00.
generateDynamicFunctionForAllReport(null, 1, 1, At 07:05.
"reports", "everydayCronForReportsForToday1-
today2", [], true, 'productAds')
generateDynamicFunctionForAllReport(null, 1, 1, At 08:05.
"reports", "everydayCronForReportsForToday1-
today2", [], true, 'campaigns');
generateDynamicFunctionForAllReport(null, 1, 1, At 09:05.
"reports", "everydayCronForReportsForToday1-
today2", [], true, 'adGroups')

generateDynamicFunctionForAllReport(null, 1, 1, At 10:05.
"reports", "everydayCronForReportsForToday1-
today2", [], true, 'targets')
generateDynamicFunctionForAllReport(null, 1, 1, At 11:05.
"reports", "everydayCronForReportsForToday1-
today2", [], true, 'keywords')
monthlyAndWeeklyAggDataStore(“MONTHLY”) At minute 40
monthlyAndWeeklyAggDataStore(‘WEEKLY”) past every 8th
hour.
monitorServerProcessAndStatusCheck() At every 15th
minute from 5
through 59.
generateDynamicFunctionForAllReport(null, 1, 1, At 01:05.
"snapshots", "snapshotsCron", [])
generateDynamicFunctionForAllReport(null, 1, 1, At 03:05.
"snapshots", "snapshotsCron", [], true);

generateDynamicFunctionForAllReport(null, 1, 1, At 14:05.
"snapshots", "snapshotsCron", [], true);
generateDynamicFunctionForAllReport(null, 1, 1, At 15:05
"snapshots", "snapshotsCron", [])
generateDynamicFunctionForAllReport(null, 1, 1, At 02:05
"snapshotsForRecentBid",
"snapshotsForRecentBidCron", [])
generateDynamicFunctionForAllReport(null, 1, 1, At 16:05.
"snapshotsForRecentBid",
"snapshotsForRecentBidCron", [])
findTimeZoneForCreateDynamic- At every 10th
CronForRuleseTaskExecution(arrayForCron) minute.
executeRulesetTask(timezoneValue) At 12:07
getAndConvertCurrencyRates() At minute 25
past every 6th
hour
storeDataForProductadsTracker() At minute 16
executeKeywordAutomation() At minute 55
past every 6th
hour.
getPanasonicSheetData() At 02:00 on
Monday and
Thursday
storeReportsToGCS(isForSpecificCustomer) At minute 35
past every 8th
hour.
storeWeeklyReportDataForAccountAndAccountGroup() At 10:49
storeASINListData() At 11:22.
updateAccessPermission() At minute 30
past every 3rd
hour.
registerUserForQuickSight() At minute 30.
updateAccessPermissionForInviteUser() At minute 0
past every
2nd hour
fetchAndStoreCampaignsPortfolio() At minute 40
past every
12th hour
automateAmazonAmsprofiles() At minute 35
past every 6th
hour
activateAmazonAmsprofiles() At minute 0
past every
12th hour
from 4
through 23
customersubscriptionDetailsUpdate() At 00:00
customerCardDetailsUpdate() At minute 0
past every 6th
hour

### Overview

### Core product functionality

### Back-office functionality

## Data Analysis

---

## Databases

---

## Key Data Models

---
## APIs

 ROUTER ENDPOINT = /api/user

HTTP METHOD END POINT FUNCTIONALITY


GET /userFromReq To get user data from tables hmgaccounts,
amazonaccounts, customers and user_config
PUT /config To update default currenct in user_config table.
GET /amazonAccounts To get amsprofiles,amazonaccountId and
amazonprofiles
POST /registerCustomer To insert cutomer data in customer table
GET /refershAmsProfiles

 ROUTER ENDPOINT = /api/ams

HTTP METHOD END POINT FUNCTIONALITY


GET /products To get all data from amsproducts
GET /storeAllReports
GET /reports/:reportType
GET /getSalesByLocation To fetch data from campaigns_report and amsprofiles
GET /keywords/:start/:end To fetch data from keywords_report_agg table.
GET /campaigns/:start/:end To fetch data from campaigns_report_agg table.
GET /crontime To get all data from cron_time table.
GET /asinProductTracker Get data from productads_tracker, productads_info and new_products.
POST /addProductWithAsin
GET /getUserAsinLimitStatus Get count of new_products and asin_limit from user_extra_asin_limit
POST /updateUserAsinLimit
GET /validate-for-brand-
selection-process
GET /get-all-brands To get data from Hmgaccounts, amazonaccounts, amsprofiles tables
GET /choose-brands

 ROUTER ENDPOINT => /api/backup

HTTP METHOD END POINT FUNCTIONALITY


POST /generateCsv

 ROUTER ENDPOINT => /api/verify

HTTP METHOD END POINT FUNCTIONALITY


GET /check To verify token.

 ROUTER ENDPOINT => /api/rulesetManager

HTTP METHOD END POINT FUNCTIONALITY


POST /ruleset
GET /ruleset To fetch data from cm_rulesets, cm_rulesets_data
tables.
PUT /ruleset
DELETE /ruleset/:id To delete data from cm_rulesets, cm_rulesets_data
tables.
POST /task Insert data to cm_tasks table and update status field
in cm_rulesets table where hmgaccountid has been
match
GET /task To fetch data from cm_tasks where hmgaccountid
has been match
DELETE /task/:id/rulesetid To delete data from cm_tasks where hmgaccountid
has been match, update data in cm_rulesets table
PUT /task
PUT /ruleset/status To update status from cm_rulesets table where
hmgaccountid has been match
GET /ruleset/getLogHistory To fetch data from execution_calculation_history
tables
GET /ruleset/
getLogHistoryById/:rul
esetid/:tasked/:date

 ROUTER ENDPOINT => /api/feedback

HTTP METHOD END POINT FUNCTIONALITY


POST /post Insert feedback data into feedback table

 ROUTER ENDPOINT => /api/group

HTTP METHOD END POINT FUNCTIONALITY


POST /addAccountGroup Insert data into account_groups table
GET /getAccountGroup To get account groups.
DELETE / Delete account_group data from accounts_groups
deleteAccountGroup/:id table, update account_group_id =null in amsprofile
table where id and hmgaccountId has been match
PUT /updateAccountGroup For update name and updatedate in
account_groups table where id and hmgaccountId,
update account_group_name in amsprofile table
where id and hmgaccountId has been match
PUT /setAccountGroup Update account_group_id and
account_group_name in amsprofiles table where id
has been match.
POST /addPortfolioGroup
PUT /updatePortfolioGroup
GET /getPortfolioGroup To get PortfolioGroups data, get data from
portfolio_groups and portfolio_details using
hmgaccountID and amsprofileId.
GET /getAllPortfolioGroup To get PortfolioGroups data, get data from
portfolio_groups and portfolio_details using
hmgaccountID and amsprofileId.
POST /setPortfolioGroup
POST /createCampaign
POST /associate-asins

 ROUTER ENDPOINT => /api/stripePayment

HTTP METHOD END POINT FUNCTIONALITY


POST /addCustomer
PUT /updateCustomerCard
POST /getSubscription
GET /
updateStripePlansInDatabase
GET /getStripePlansInDatabase To get all the plans active in database from
plans table.
GET /verify-coupon For verify the coupon
GET /getCustomerSubscribedPlan

 ROUTER ENDPOINT => /api/embed

HTTP METHOD END POINT FUNCTIONALITY


GET /getUrl Fetch data from qs_user_arn_details table,
basically used to fetch data from Amazon’s
quick sight.
POST /inviteUser
GET /getInvitedUser Fetch data from hmgaccounts table,
invited_user_data_access table.
POST /updateInvitedUser Update name, salt, hash and updatedate in
hmgaccounts table, update
data_access_accountgroupid
invited_user_data_access table
POST /updateInvitedUserStatus Update status field in invited_user_data_access
table
POST /deleteInvitedUser

 ROUTER ENDPOINT => /api/asinGroup

HTTP METHOD END POINT FUNCTIONALITY


POST /addAsinGroup
GET /getAsinGroup
GET /getStoredAsinForGroup
GET /getStoredAsins/:country
POST /assignAsinToAsinGroup
DELETE /deleteAsinGroup
PUT /updateAsinGroup
PUT /updateAsinGroupDetails
GET /
getAsinGroupWithDetails/:as
ingroupid
POST /getAsinsStats
POST /getAsinsStatsForTable
 ROUTER ENDPOINT => /api/bid

HTTP METHOD END POINT FUNCTIONALITY


GET /portfolio-group-
details/:amsprofileid
GET /available-date-for-stored- Fetch date from keyword_snapshots where
bid/:amsprofileid hmgaccountid and amsprofileid has been
matched
POST /restore
POST /bulk-update
GET /count-history
GET /download-history/:date Fetch date, brandname, campaigntype,
keyworded, targetid and bid from
bulk_bid_update_history where hmgaccountid
and date has been matched
GET /trigger-download-recent- Downloading for recent bid
bid
GET /available-recent-bid 1. Find recent bid in keyword reportType
from keyword_snapshot_recent where
hmgaccountid has been match
2. Find recent bid in target reportType
from targets_snapshot_recent where
accountedtid has been match

GET /download-available-recent-
bid/:reportType/:time
POST /quick-asin-update
POST /quick-update

 ROUTER ENDPOINT => /api/day-part

HTTP METHOD END POINT FUNCTIONALITY


POST /details
GET /details Select daypart details from day_part where
hmgaccountid has been match
PUT /details
DELETE /details/:dayPartId Delete day_part details and extra details from
day_part database where id and hmgaccountid
has been match

 ROUTER ENDPOINT => /api/campaign-console

HTTP METHOD END POINT FUNCTIONALITY


GET /
details/:campaignType/:statu
s/:endDate/:startDate/:limit/:
page
PUT /details
PUT /details/default-bid
 ROUTER ENDPOINT => /api/keyword-automation

HTTP METHOD END POINT PURPOSE


GET /process
POST /process
PUT /process
DELETE / Delete keyword_automation and
process/:keywordAutomationI keyword_automation_execution details where
temId id has been match
PUT /process/queue-approve
POST /process/upload
GET /execution-
history/:keywordAutomationI
d/:campaignId/:date

 ROUTER ENDPOINT => /api/goal-tracker

HTTP METHOD END POINT FUNCTIONALITYD


POST /details
GET /details To get data from goal_tracker.
PUT /details
DELETE /details/:goalTrackerId
GET /refresh-actuals

 ROUTER ENDPOINT => /api/dashboard

HTTP METHOD END POINT FUNCTIONALITY


GET /currency-rates Select all data from currency_rates
GET /sales-spend To get sales spend data, only fetched if account
is active i.e. when base plan is subscribed or in
trial period, default we fetch data of last week.
GET /acos-over-time
GET /sales-by-location
GET /manual-spend To get manual spend data, only fetched if
account is active i.e. when base plan is
subscribed or in trial period, default we fetch
data of last week.
GET /top-keywords
GET /top-asins
GET /top-portfolio
GET /keywords-sales-rank

 ROUTER ENDPOINT => /api/label

HTTP METHOD END POINT FUNCTIONALITY


POST /details
GET /details To get all data from labels where hmgaccountid
has been match
GET /details/chart
POST /details/download
DELETE /details/:labelId For delete labels, label_portfolios,
label_compaigns, label_adgroup,
label_keywords, label_pat where labelId and
hmgaccountId has been match
PUT /details Update label name where labelId and
hmgaccountId has been match
POST /associate-labels
GET /add-default-label fetch label data where default_label is true
POST /upload

 ROUTER ENDPOINT => /api/admin-portal

HTTP METHOD END POINT PURPOSE


POST /upload
GET /download Fetch tracking_hours_data from track_hours
GET /create-invoice

---

## User Onboarding

---

## Dependencies and Third-Party Tools

---

[Dependencies and Third-Party Tools](https://www.notion.so/df4df852ceff48d4be64965741fbee70)

You might also like