Skip to content

Settings and activity

5 results found

  1. 237 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    Priyatham Anisetty supported this idea  · 
  2. 48 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    Priyatham Anisetty supported this idea  · 
    An error occurred while saving the comment
    Priyatham Anisetty commented  · 

    This would simplify our client side logic.

  3. 146 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    Priyatham Anisetty supported this idea  · 
  4. 26 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Priyatham Anisetty commented  · 

    Yes adding enum support will help us get rid of unnecessary tables to maintain enums. And this helps take advantage of postgress table automatic value validation

    Priyatham Anisetty supported this idea  · 
  5. 1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  General » Data Connect  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Priyatham Anisetty commented  · 

    Right now I have this struct

    public struct InventoryItem: Decodable, Sendable ,Hashable, Equatable, Identifiable {

    public var
    id: UUID

    public var
    name: String

    public var
    stockInHand: Double

    public var
    unit: String

    public var
    lastUpdated: Timestamp

    public var
    costPerUnit: Double

    public var
    supplierName: String?

    public var
    threshold: Double?


    public var inventoryItemKey: InventoryItemKey {
    return InventoryItemKey(

    id: id
    )
    }


    public func hash(into hasher: inout Hasher) {

    hasher.combine(id)

    }
    public static func == (lhs: InventoryItem, rhs: InventoryItem) -> Bool {

    return lhs.id == rhs.id

    }


    enum CodingKeys: String, CodingKey {

    case id

    case name

    case stockInHand

    case unit

    case lastUpdated

    case costPerUnit

    case supplierName

    case threshold

    }

    public init(from decoder: any Decoder) throws {
    var container = try decoder.container(keyedBy: CodingKeys.self)
    let codecHelper = CodecHelper<CodingKeys>()



    self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container)



    self.name = try codecHelper.decode(String.self, forKey: .name, container: &container)



    self.stockInHand = try codecHelper.decode(Double.self, forKey: .stockInHand, container: &container)



    self.unit = try codecHelper.decode(String.self, forKey: .unit, container: &container)



    self.lastUpdated = try codecHelper.decode(Timestamp.self, forKey: .lastUpdated, container: &container)



    self.costPerUnit = try codecHelper.decode(Double.self, forKey: .costPerUnit, container: &container)



    self.supplierName = try codecHelper.decode(String?.self, forKey: .supplierName, container: &container)



    self.threshold = try codecHelper.decode(Double?.self, forKey: .threshold, container: &container)


    }
    }
    public var
    inventoryItems: [InventoryItem]

    }

    public func ref(

    storeId: String

    ) -> QueryRefObservableObject<GetAllInventoryForStoreQuery.Data,GetAllInventoryForStoreQuery.Variables> {
    var variables = GetAllInventoryForStoreQuery.Variables(storeId:storeId)

    let ref = dataConnect.query(name: "getAllInventoryForStore", variables: variables, resultsDataType:GetAllInventoryForStoreQuery.Data.self, publisher: .observableObject)
    return ref as! QueryRefObservableObject<GetAllInventoryForStoreQuery.Data,GetAllInventoryForStoreQuery.Variables>
    }

    @MainActor
    public func execute(

    storeId: String

    ) async throws -> OperationResult<GetAllInventoryForStoreQuery.Data> {
    var variables = GetAllInventoryForStoreQuery.Variables(storeId:storeId)


    let ref = dataConnect.query(name: "getAllInventoryForStore", variables: variables, resultsDataType:GetAllInventoryForStoreQuery.Data.self, publisher: .observableObject)

    let refCast = ref as! QueryRefObservableObject<GetAllInventoryForStoreQuery.Data,GetAllInventoryForStoreQuery.Variables>
    return try await refCast.execute()

    }
    }

    I can only init by creating a JSON object serialize it and then pass it to the decoder to decode. it makes me write unnecessary code in my Preview functions.

    Priyatham Anisetty shared this idea  ·