Coverage for mindsdb / integrations / handlers / shopify_handler / models / inventory_items.py: 0%

16 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-21 00:36 +0000

1from .common import AliasesEnum, MoneyV2 

2 

3 

4class InventoryItems(AliasesEnum): 

5 """A class to represent a Shopify GraphQL inventory item. 

6 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryItem 

7 Require `read_inventory` or `read_products` permission. 

8 """ 

9 

10 countryCodeOfOrigin = "countryCodeOfOrigin" 

11 # countryHarmonizedSystemCodes = "countryHarmonizedSystemCodes" 

12 createdAt = "createdAt" 

13 duplicateSkuCount = "duplicateSkuCount" 

14 harmonizedSystemCode = "harmonizedSystemCode" 

15 id = "id" 

16 inventoryHistoryUrl = "inventoryHistoryUrl" 

17 # inventoryLevel = "inventoryLevel" 

18 # inventoryLevels = "inventoryLevels" 

19 legacyResourceId = "legacyResourceId" 

20 # locationsCount = "locationsCount" 

21 # measurement = "measurement" 

22 provinceCodeOfOrigin = "provinceCodeOfOrigin" 

23 requiresShipping = "requiresShipping" 

24 sku = "sku" 

25 tracked = "tracked" 

26 # trackedEditable = "trackedEditable" 

27 unitCost = MoneyV2 

28 updatedAt = "updatedAt" 

29 # variant = "variant" 

30 

31 

32columns = [ 

33 { 

34 "TABLE_NAME": "inventory_items", 

35 "COLUMN_NAME": "countryCodeOfOrigin", 

36 "DATA_TYPE": "TEXT", 

37 "COLUMN_DESCRIPTION": "The ISO 3166-1 alpha-2 country code of where the item originated from.", 

38 "IS_NULLABLE": None, 

39 }, 

40 # { 

41 # "TABLE_NAME": "inventory_items", 

42 # "COLUMN_NAME": "countryHarmonizedSystemCodes", 

43 # "DATA_TYPE": "JSON", 

44 # "COLUMN_DESCRIPTION": "A list of country specific harmonized system codes.", 

45 # "IS_NULLABLE": False 

46 # }, 

47 { 

48 "TABLE_NAME": "inventory_items", 

49 "COLUMN_NAME": "createdAt", 

50 "DATA_TYPE": "TIMESTAMP", 

51 "COLUMN_DESCRIPTION": "The date and time when the inventory item was created.", 

52 "IS_NULLABLE": False, 

53 }, 

54 { 

55 "TABLE_NAME": "inventory_items", 

56 "COLUMN_NAME": "duplicateSkuCount", 

57 "DATA_TYPE": "INT", 

58 "COLUMN_DESCRIPTION": "The number of inventory items that share the same SKU with this item.", 

59 "IS_NULLABLE": False, 

60 }, 

61 { 

62 "TABLE_NAME": "inventory_items", 

63 "COLUMN_NAME": "harmonizedSystemCode", 

64 "DATA_TYPE": "TEXT", 

65 "COLUMN_DESCRIPTION": "The harmonized system code of the item. This must be a number between 6 and 13 digits.", 

66 "IS_NULLABLE": None, 

67 }, 

68 { 

69 "TABLE_NAME": "inventory_items", 

70 "COLUMN_NAME": "id", 

71 "DATA_TYPE": "TEXT", 

72 "COLUMN_DESCRIPTION": "A globally-unique ID.", 

73 "IS_NULLABLE": False, 

74 }, 

75 { 

76 "TABLE_NAME": "inventory_items", 

77 "COLUMN_NAME": "inventoryHistoryUrl", 

78 "DATA_TYPE": "TEXT", 

79 "COLUMN_DESCRIPTION": "The URL that points to the inventory history for the item.", 

80 "IS_NULLABLE": None, 

81 }, 

82 # { 

83 # "TABLE_NAME": "inventory_items", 

84 # "COLUMN_NAME": "inventoryLevel", 

85 # "DATA_TYPE": "JSON", 

86 # "COLUMN_DESCRIPTION": "The inventory item's quantities at the specified location.", 

87 # "IS_NULLABLE": None 

88 # }, 

89 # { 

90 # "TABLE_NAME": "inventory_items", 

91 # "COLUMN_NAME": "inventoryLevels", 

92 # "DATA_TYPE": "JSON", 

93 # "COLUMN_DESCRIPTION": "A list of the inventory item's quantities for each location that the inventory item can be stocked at.", 

94 # "IS_NULLABLE": False 

95 # }, 

96 { 

97 "TABLE_NAME": "inventory_items", 

98 "COLUMN_NAME": "legacyResourceId", 

99 "DATA_TYPE": "INT", 

100 "COLUMN_DESCRIPTION": "The ID of the corresponding resource in the REST Admin API.", 

101 "IS_NULLABLE": False, 

102 }, 

103 # { 

104 # "TABLE_NAME": "inventory_items", 

105 # "COLUMN_NAME": "locationsCount", 

106 # "DATA_TYPE": "JSON", 

107 # "COLUMN_DESCRIPTION": "The number of locations where this inventory item is stocked.", 

108 # "IS_NULLABLE": None 

109 # }, 

110 # { 

111 # "TABLE_NAME": "inventory_items", 

112 # "COLUMN_NAME": "measurement", 

113 # "DATA_TYPE": "JSON", 

114 # "COLUMN_DESCRIPTION": "The packaging dimensions of the inventory item.", 

115 # "IS_NULLABLE": False 

116 # }, 

117 { 

118 "TABLE_NAME": "inventory_items", 

119 "COLUMN_NAME": "provinceCodeOfOrigin", 

120 "DATA_TYPE": "TEXT", 

121 "COLUMN_DESCRIPTION": "The ISO 3166-2 alpha-2 province code of where the item originated from.", 

122 "IS_NULLABLE": None, 

123 }, 

124 { 

125 "TABLE_NAME": "inventory_items", 

126 "COLUMN_NAME": "requiresShipping", 

127 "DATA_TYPE": "BOOL", 

128 "COLUMN_DESCRIPTION": "Whether the inventory item requires shipping.", 

129 "IS_NULLABLE": False, 

130 }, 

131 { 

132 "TABLE_NAME": "inventory_items", 

133 "COLUMN_NAME": "sku", 

134 "DATA_TYPE": "TEXT", 

135 "COLUMN_DESCRIPTION": "Inventory item SKU. Case-sensitive string.", 

136 "IS_NULLABLE": None, 

137 }, 

138 { 

139 "TABLE_NAME": "inventory_items", 

140 "COLUMN_NAME": "tracked", 

141 "DATA_TYPE": "BOOL", 

142 "COLUMN_DESCRIPTION": "Whether inventory levels are tracked for the item.", 

143 "IS_NULLABLE": False, 

144 }, 

145 # { 

146 # "TABLE_NAME": "inventory_items", 

147 # "COLUMN_NAME": "trackedEditable", 

148 # "DATA_TYPE": "JSON", 

149 # "COLUMN_DESCRIPTION": "Whether the value of the tracked field for the inventory item can be changed.", 

150 # "IS_NULLABLE": False 

151 # }, 

152 { 

153 "TABLE_NAME": "inventory_items", 

154 "COLUMN_NAME": "unitCost", 

155 "DATA_TYPE": "JSON", 

156 "COLUMN_DESCRIPTION": "Unit cost associated with the inventory item. Note: the user must have View product costs permission granted in order to access this field once product granular permissions are enabled.", 

157 "IS_NULLABLE": None, 

158 }, 

159 { 

160 "TABLE_NAME": "inventory_items", 

161 "COLUMN_NAME": "updatedAt", 

162 "DATA_TYPE": "TIMESTAMP", 

163 "COLUMN_DESCRIPTION": "The date and time when the inventory item was updated.", 

164 "IS_NULLABLE": False, 

165 }, 

166 # { 

167 # "TABLE_NAME": "inventory_items", 

168 # "COLUMN_NAME": "variant", 

169 # "DATA_TYPE": "JSON", 

170 # "COLUMN_DESCRIPTION": "The variant that owns this inventory item.", 

171 # "IS_NULLABLE": False 

172 # } 

173]