Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Apps/W1/Shopify/app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"idRanges": [
{
"from": 30100,
"to": 30350
"to": 30360
}
],
"internalsVisibleTo": [
Expand Down
103 changes: 0 additions & 103 deletions Apps/W1/Shopify/app/src/Base/Tables/ShpfyMetafield.Table.al

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ codeunit 30116 "Shpfy Customer Export"
Metafield.Namespace := 'Microsoft.Dynamics365.BusinessCentral';
Metafield.Validate("Parent Table No.", Database::"Shpfy Customer");
Metafield."Owner Id" := ShopifyCustomer.Id;
Metafield."Value Type" := Metafield."Value Type"::String;
Metafield.Type := Metafield.Type::string;
Metafield.Value := Format(MetadataFieldRef.Value);
end;
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ table 30105 "Shpfy Customer"
if not Tag.IsEmpty() then
Tag.DeleteAll();

Metafield.SetRange("Parent Table No.", Database::"Shpfy Customer");
Metafield.SetRange("Owner Id", Id);
if not Metafield.IsEmpty then
Metafield.DeleteAll();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace Microsoft.Integration.Shopify;

/// <summary>
/// Codeunit Shpfy GQL MetafieldSet (ID 30168) implements Interface Shpfy IGraphQL.
/// </summary>
codeunit 30350 "Shpfy GQL MetafieldsSet" implements "Shpfy IGraphQL"
{
Access = Internal;

/// <summary>
/// GetGraphQL.
/// </summary>
/// <returns>Return value of type Text.</returns>
internal procedure GetGraphQL(): Text
begin
exit('{"query": "mutation { metafieldsSet(metafields: [{{Metafields}}]) { metafields {legacyResourceId namespace key} userErrors {field, message}}}"}');
end;

/// <summary>
/// GetExpectedCost.
/// </summary>
/// <returns>Return value of type Integer.</returns>
internal procedure GetExpectedCost(): Integer
begin
exit(10);
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ codeunit 30146 "Shpfy GQL ProductById" implements "Shpfy IGraphQL"
/// <returns>Return value of type Text.</returns>
internal procedure GetGraphQL(): Text
begin
exit('{"query":"{product(id: \"gid://shopify/Product/{{ProductId}}\") {createdAt updatedAt hasOnlyDefaultVariant description(truncateAt: {{MaxLengthDescription}}) descriptionHtml onlineStorePreviewUrl onlineStoreUrl productType status tags title vendor seo{description, title} images(first: 1) {edges{node{id}}} metafields(namespace: \"Microsoft.Dynamics365.BusinessCentral\", first: 10) {edges {node {id namespace type legacyResourceId key value}}}}}"}');
exit('{"query":"{product(id: \"gid://shopify/Product/{{ProductId}}\") {createdAt updatedAt hasOnlyDefaultVariant description(truncateAt: {{MaxLengthDescription}}) descriptionHtml onlineStorePreviewUrl onlineStoreUrl productType status tags title vendor seo{description, title} images(first: 1) {edges{node{id}}} metafields(first: 50) {edges {node {id namespace type legacyResourceId key value}}}}}"}');
end;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Microsoft.Integration.Shopify;

/// <summary>
/// Codeunit Shpfy GQL ProductMetafieldIds (ID 30332) implements Interface Shpfy IGraphQL.
/// </summary>
codeunit 30332 "Shpfy GQL ProductMetafieldIds" implements "Shpfy IGraphQL"
{
Access = Internal;

/// <summary>
/// GetGraphQL.
/// </summary>
/// <returns>Return value of type Text.</returns>
internal procedure GetGraphQL(): Text
begin
exit('{"query":"{product(id: \"gid://shopify/Product/{{ProductId}}\") { metafields(first: 50) {edges{node{legacyResourceId updatedAt}}}}}"}');
end;

/// <summary>
/// GetExpectedCost.
/// </summary>
/// <returns>Return value of type Integer.</returns>
internal procedure GetExpectedCost(): Integer
begin
exit(50);
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ codeunit 30150 "Shpfy GQL VariantById" implements "Shpfy IGraphQL"
/// <returns>Return value of type Text.</returns>
internal procedure GetGraphQL(): Text
begin
exit('{"query":"{productVariant(id: \"gid://shopify/ProductVariant/{{VariantId}}\") {createdAt updatedAt availableForSale barcode compareAtPrice displayName inventoryPolicy position price sku taxCode taxable title weight product{id}selectedOptions{name value} inventoryItem{countryCodeOfOrigin createdAt id inventoryHistoryUrl legacyResourceId provinceCodeOfOrigin requiresShipping sku tracked updatedAt unitCost { amount currencyCode }} metafields(namespace: \"Microsoft.Dynamics365.BusinessCentral\", first: 10) {edges {node {id namespace ownerType legacyResourceId key value}}}}}"}');
exit('{"query":"{productVariant(id: \"gid://shopify/ProductVariant/{{VariantId}}\") {createdAt updatedAt availableForSale barcode compareAtPrice displayName inventoryPolicy position price sku taxCode taxable title weight product{id}selectedOptions{name value} inventoryItem{countryCodeOfOrigin createdAt id inventoryHistoryUrl legacyResourceId provinceCodeOfOrigin requiresShipping sku tracked updatedAt unitCost { amount currencyCode }} metafields(first: 50) {edges {node {id namespace ownerType legacyResourceId key value}}}}}"}');
end;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Microsoft.Integration.Shopify;

/// <summary>
/// Codeunit Shpfy GQL VariantMetafieldIds (ID 30336) implements Interface Shpfy IGraphQL.
/// </summary>
codeunit 30336 "Shpfy GQL VariantMetafieldIds" implements "Shpfy IGraphQL"
{
Access = Internal;

/// <summary>
/// GetGraphQL.
/// </summary>
/// <returns>Return value of type Text.</returns>
internal procedure GetGraphQL(): Text
begin
exit('{"query":"{productVariant(id: \"gid://shopify/ProductVariant/{{VariantId}}\") { metafields(first: 50) {edges{ node{legacyResourceId updatedAt}}}}}"}');
end;

/// <summary>
/// GetExpectedCost.
/// </summary>
/// <returns>Return value of type Integer.</returns>
internal procedure GetExpectedCost(): Integer
begin
exit(50);
end;

}
15 changes: 15 additions & 0 deletions Apps/W1/Shopify/app/src/GraphQL/Enums/ShpfyGraphQLType.Enum.al
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,21 @@ enum 30111 "Shpfy GraphQL Type" implements "Shpfy IGraphQL"
Caption = 'Get Order Transactions';
Implementation = "Shpfy IGraphQL" = "Shpfy GQL OrderTransactions";
}
value(79; MetafieldSet)
{
Caption = 'MetfieldSet';
Implementation = "Shpfy IGraphQL" = "Shpfy GQL MetafieldsSet";
}
value(80; ProductMetafieldIds)
{
Caption = 'Product Metafield Ids';
Implementation = "Shpfy IGraphQL" = "Shpfy GQL ProductMetafieldIds";
}
value(81; VariantMetafieldIds)
{
Caption = 'Variant Metafield Ids';
Implementation = "Shpfy IGraphQL" = "Shpfy GQL VariantMetafieldIds";
}
value(85; ProductVariantDelete)
{
Caption = 'Product Variant Delete';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace Microsoft.Integration.Shopify;

codeunit 30338 "Shpfy Mtfld Type Boolean" implements "Shpfy IMetafield Type"
{
procedure HasAssistEdit(): Boolean
begin
exit(false);
end;

procedure IsValidValue(Value: Text): Boolean
var
DummyBoolean: Boolean;
begin
exit(Evaluate(DummyBoolean, Value, 9));
end;

procedure AssistEdit(var Value: Text[2048]): Boolean
begin
Value := Value;
exit(false);
end;

procedure GetExampleValue(): Text
begin
exit('true');
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Microsoft.Integration.Shopify;

using System.Utilities;

codeunit 30321 "Shpfy Mtfld Type Collect. Ref" implements "Shpfy IMetafield Type"
{
procedure HasAssistEdit(): Boolean
begin
exit(false);
end;

procedure IsValidValue(Value: Text): Boolean
var
Regex: Codeunit Regex;
begin
exit(Regex.IsMatch(Value, '^gid:\/\/shopify\/Collection\/\d+$'));
end;

procedure AssistEdit(var Value: Text[2048]): Boolean
begin
Value := Value;
exit(false);
end;

procedure GetExampleValue(): Text
begin
exit('gid://shopify/Collection/1234567890');
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Microsoft.Integration.Shopify;

using System.Utilities;

codeunit 30319 "Shpfy Mtfld Type Color" implements "Shpfy IMetafield Type"
{
procedure HasAssistEdit(): Boolean
begin
exit(false);
end;

procedure IsValidValue(Value: Text): Boolean
var
Regex: Codeunit Regex;
begin
exit(Regex.IsMatch(Value, '^#[0-9A-Fa-f]{6}$'));
end;

procedure AssistEdit(var Value: Text[2048]): Boolean
begin
Value := Value;
exit(false);
end;

procedure GetExampleValue(): Text
begin
exit('#fff123');
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace Microsoft.Integration.Shopify;

codeunit 30318 "Shpfy Mtfld Type Date" implements "Shpfy IMetafield Type"
{
procedure HasAssistEdit(): Boolean
begin
exit(false);
end;

procedure IsValidValue(Value: Text): Boolean
var
DummyDate: Date;
begin
exit(Evaluate(DummyDate, Value, 9));
end;

procedure AssistEdit(var Value: Text[2048]): Boolean
begin
Value := Value;
exit(false);
end;

procedure GetExampleValue(): Text
begin
exit('2022-02-02');
end;
}
Loading