This commit is contained in:
@@ -27,16 +27,7 @@ Once that is done then can steam ahead on the biz objects but until I have the c
|
|||||||
|
|
||||||
IMMEDIATE ITEMS:
|
IMMEDIATE ITEMS:
|
||||||
================
|
================
|
||||||
|
Happy monday Radiant Maiden ;)
|
||||||
|
|
||||||
- Tag groups (modify tags already coded)
|
|
||||||
|
|
||||||
- Tag: add test for untag everything
|
|
||||||
- TAG: add test that can't delete if it's in a taggroup mapping
|
|
||||||
- TAGGrOUP: add tests for all crud ops
|
|
||||||
- TESTS: Make a test for each type of group operation from biz point of view
|
|
||||||
- TAGMAP: CREATEASYNC code to tag an item should take into account if it's already tagged and not make a new record, just return existing
|
|
||||||
- TAGGROUPMAP: add tagGROUPMAP CREATEASYNC should take into account if already added //TODO: see if already present and just return inObj if so
|
|
||||||
- Need an ObjectExists type object for checking if something exists when specified by type and ID
|
- Need an ObjectExists type object for checking if something exists when specified by type and ID
|
||||||
- Could this be a combined method to get the name as well just to save time?
|
- Could this be a combined method to get the name as well just to save time?
|
||||||
- Or should that be another method (YES, first code a translator to translate types to db tables (however the fuck that works with EF), then can use it in turn to verify existance and get name separately)
|
- Or should that be another method (YES, first code a translator to translate types to db tables (however the fuck that works with EF), then can use it in turn to verify existance and get name separately)
|
||||||
|
|||||||
@@ -35,8 +35,14 @@ namespace AyaNova.Biz
|
|||||||
//CREATE
|
//CREATE
|
||||||
internal async Task<TagGroupMap> CreateAsync(TagGroupMapInfo inObj)
|
internal async Task<TagGroupMap> CreateAsync(TagGroupMapInfo inObj)
|
||||||
{
|
{
|
||||||
//TODO: see if already present and just return inObj if so
|
|
||||||
// if(ct.TagGroupMap.Any().where)
|
//Is this taggroup mapping already present?
|
||||||
|
var Existing = await ct.TagGroupMap.Where(m => m.TagId == inObj.TagId && m.TagGroupId == inObj.TagGroupId).FirstOrDefaultAsync();
|
||||||
|
if (Existing != null)
|
||||||
|
{
|
||||||
|
//yup so just return it, don't make a new one
|
||||||
|
return Existing;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Validate(inObj, true);
|
Validate(inObj, true);
|
||||||
|
|||||||
@@ -35,7 +35,13 @@ namespace AyaNova.Biz
|
|||||||
//CREATE
|
//CREATE
|
||||||
internal async Task<TagMap> CreateAsync(TagMapInfo inObj)
|
internal async Task<TagMap> CreateAsync(TagMapInfo inObj)
|
||||||
{
|
{
|
||||||
//TODO: Does object exist before attempting to tag it??
|
//Is this tag already present?
|
||||||
|
var Existing = await ct.TagMap.Where(m => m.TagId == inObj.TagId && m.TagToObjectId == inObj.TagToObjectId && m.TagToObjectType == inObj.TagToObjectType).FirstOrDefaultAsync();
|
||||||
|
if (Existing != null)
|
||||||
|
{
|
||||||
|
//yup so just return it, don't make a new one
|
||||||
|
return Existing;
|
||||||
|
}
|
||||||
|
|
||||||
Validate(inObj, true);
|
Validate(inObj, true);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ namespace AyaNova.Util
|
|||||||
if (currentSchema < 6)
|
if (currentSchema < 6)
|
||||||
{
|
{
|
||||||
LogUpdateMessage(log);
|
LogUpdateMessage(log);
|
||||||
|
// LOOKAT: Should taggroupmap have an index that enforces no taggroup can have the same tag more than once? Same for objects being tagged?
|
||||||
exec("CREATE TABLE atag (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null)");
|
exec("CREATE TABLE atag (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null)");
|
||||||
exec("CREATE UNIQUE INDEX tagname_idx ON atag (name);");
|
exec("CREATE UNIQUE INDEX tagname_idx ON atag (name);");
|
||||||
exec("CREATE TABLE atagmap (id BIGSERIAL PRIMARY KEY, ownerid bigint not null," +
|
exec("CREATE TABLE atagmap (id BIGSERIAL PRIMARY KEY, ownerid bigint not null," +
|
||||||
|
|||||||
Reference in New Issue
Block a user