Native Ads Weekly Dev Update #3

in #hivemind5 years ago

This week had quite a lot of "work-in-progress" code, so I created a dev branch: native-ads-alpha-dev.

https://github.com/imwatsi/hivemind/tree/native-ads-alpha-dev

This code will be merged into the native-ads-alpha branch once the codebase is stable and finalized.

The commits I made this week dealt with implementing ad settings. I update the DB schema to include a new table hive_ads_settings that hosts ad-related settings/preferences for communities.

    community_id integer PRIMARY KEY REFERENCES hive_communities (id),
    enabled boolean NOT NULL DEFAULT false,
    token varchar(10) NOT NULL DEFAULT 'STEEM',
    burn boolean NOT NULL DEFAULT false,
    min_bid numeric(10,3),
    max_time_bid integer,
    max_time_active integer

I also added basic validation techniques to handle ad related operations: adSubmit, adBid, adApprove, adReject and adAllocate. Mostly groundwork really:

  • checking user permissions versus their "Role" in the community to which the actions are being sent
  • loading a community's ad settings as context and handling missing entries
  • respecting a community's ad preferences (denying actions if opted-out of Native Ads)
  • changes to DB schema
  • updates to docs

You can see all the commits here.

This coming week, I will continue working on ad actions, by implementing the ordered workflow that dictates an ad's lifecycle (draft, submitted, approved, funded, scheduled), with checks and balances to avail limited permissions to the operations at each stage. I'll also write code to change DB state accordingly.



See my current branches on GitHub:

https://github.com/imwatsi/hivemind/branches

Coin Marketplace

STEEM 0.19
TRX 0.18
JST 0.033
BTC 87757.32
ETH 3103.63
USDT 1.00
SBD 2.75