Inherited Classes indexes & typescript dtos oh my

I have some inherited dtos that I added base properties using “new” back in because ormlite was not generating indexes. This then caused the ts dto generator to start getting syntax errors because the inherited properties did not have a “declare” statement in them.

What am I doing wrong? My preference would be that ormlite generate indexes from base classes… but I also think there is a defect in x ts…

Please provide a complete example of the DTOs with the issue along with the generated DTOs with the issues.

classes are below. the “new’s” in DailySkuMetrics where put there because indexes from the [Index] property were not being created when doing Db.xxTablexx<>(). My preference to solve this is not the dto generator bug, which is definitely a bug as it doesn’t generate compilable- typescript, but rather to understand how to have ormlite generate indexes for inherited classes. Postgres dialect by the way.

public class DailySkuMetrics : DailyMetrics
{
    [Index]
    public string SellerSku { get; set; }

    [Index]
    public new DateTime dt {get;set;}

    [Index]
    public new string CustomerId {get;set;}

    [Index]
    public string ASIN {get;set;}
    
    public string ProductName { get; set; }

    public string VariationName { get; set; }

    public string FulfillmentChannel { get; set; }

    public string ParentProduct { get; set; }
    public string ParentASIN { get; set; }
    public string BrandTier { get; set; }
    public string ItemNumber {get;set;}
    public string Category {get;set;}
}
public class DailyMetrics
{
    [PrimaryKey]
    [AutoIncrement]
    public long Id { get; set; }

    public DateTime lastUpdatedDt { get; set; }

    [Index]
    public string CustomerId { get; set; }

    public string SellerId { get; set; }
    public string MarketplaceId { get; set; }
    [Index]
    public DateTime dt { get; set; }
    [Ignore]
    public string dtIso8601 { get { return dt.ToUniversalTime().Date.ToString("o"); } }

    public int OrderCnt { get; set; }
    public int OrderedItemsCnt { get; set; }
    public int OrderedItemQty { get; set; }

    public int OrderPendingCnt { get; set; }
    public int OrderCancelledCnt { get; set; }

    public int ShippedItemsCnt { get; set; }
    public int ShippedItemQty { get; set; }

    public decimal OrderedItemsAmt { get; set; }
    public decimal ShippedItemsAmt { get; set; }

    public int AdvertisingImpressions { get; set; }

    public int AdvertisingClicks { get; set; }

    public int AdvertisingOrderCnt { get; set; }

    public int AdvertisingUnitsCnt { get; set; }
    [Default(0)]
    public decimal AdvertisingSales { get; set; }

    public decimal AdvertisingSpend { get; set; }

    public int AdvertisingNTBUnits { get; set; }
    public decimal AdvertisingNTBSales { get; set; }

    public decimal InStockPercent { get; set; }
    public decimal BuyBoxPercent { get; set; }
    [Default(0)]
    public int BuyBoxMinutes { get; set; }

    [Default(0)]
    public int BuyBoxMinutesPossible { get; set; }

    [Default(0)]
    public int InStockDays { get; set; }

    [Default(0)]
    public int InStockDaysPossible { get; set; }
}

I can’t reproduce either of these issues, indexes are created for both tables if you don’t have the new properties, e.g:

SQL: CREATE TABLE "DailySkuMetrics" 
(
  "SellerSku" VARCHAR(8000) NULL, 
  "ASIN" VARCHAR(8000) NULL, 
  "ProductName" VARCHAR(8000) NULL, 
  "VariationName" VARCHAR(8000) NULL, 
  "FulfillmentChannel" VARCHAR(8000) NULL, 
  "ParentProduct" VARCHAR(8000) NULL, 
  "ParentASIN" VARCHAR(8000) NULL, 
  "BrandTier" VARCHAR(8000) NULL, 
  "ItemNumber" VARCHAR(8000) NULL, 
  "Category" VARCHAR(8000) NULL, 
  "Id" INTEGER PRIMARY KEY AUTOINCREMENT, 
  "lastUpdatedDt" VARCHAR(8000) NOT NULL, 
  "CustomerId" VARCHAR(8000) NULL, 
  "SellerId" VARCHAR(8000) NULL, 
  "MarketplaceId" VARCHAR(8000) NULL, 
  "dt" VARCHAR(8000) NOT NULL, 
  "OrderCnt" INTEGER NOT NULL, 
  "OrderedItemsCnt" INTEGER NOT NULL, 
  "OrderedItemQty" INTEGER NOT NULL, 
  "OrderPendingCnt" INTEGER NOT NULL, 
  "OrderCancelledCnt" INTEGER NOT NULL, 
  "ShippedItemsCnt" INTEGER NOT NULL, 
  "ShippedItemQty" INTEGER NOT NULL, 
  "OrderedItemsAmt" DECIMAL(18,12) NOT NULL, 
  "ShippedItemsAmt" DECIMAL(18,12) NOT NULL, 
  "AdvertisingImpressions" INTEGER NOT NULL, 
  "AdvertisingClicks" INTEGER NOT NULL, 
  "AdvertisingOrderCnt" INTEGER NOT NULL, 
  "AdvertisingUnitsCnt" INTEGER NOT NULL, 
  "AdvertisingSales" DECIMAL(18,12) NOT NULL DEFAULT (0), 
  "AdvertisingSpend" DECIMAL(18,12) NOT NULL, 
  "AdvertisingNTBUnits" INTEGER NOT NULL, 
  "AdvertisingNTBSales" DECIMAL(18,12) NOT NULL, 
  "InStockPercent" DECIMAL(18,12) NOT NULL, 
  "BuyBoxPercent" DECIMAL(18,12) NOT NULL, 
  "BuyBoxMinutes" INTEGER NOT NULL DEFAULT (0), 
  "BuyBoxMinutesPossible" INTEGER NOT NULL DEFAULT (0), 
  "InStockDays" INTEGER NOT NULL DEFAULT (0), 
  "InStockDaysPossible" INTEGER NOT NULL DEFAULT (0) 
); 

SQL: CREATE  INDEX idx_dailyskumetrics_sellersku ON "DailySkuMetrics" ("SellerSku"); 

SQL: CREATE  INDEX idx_dailyskumetrics_asin ON "DailySkuMetrics" ("ASIN"); 

SQL: CREATE  INDEX idx_dailyskumetrics_customerid ON "DailySkuMetrics" ("CustomerId"); 

SQL: CREATE  INDEX idx_dailyskumetrics_dt ON "DailySkuMetrics" ("dt");

And I’m not sure what DTO generation bug you’re referring to.