Update API v5 method coverage#118
Merged
Merged
Conversation
Added client methods:
* `PaymentCheck`: implements `POST` `/api/v5/payment/check`, sends `PaymentCheckRequest` as the `check` form field, and returns `PaymentCheckResponse`.
* `PaymentCreateInvoice`: implements `POST` `/api/v5/payment/create-invoice`, sends `PaymentCreateInvoiceRequest` as the `createInvoice` form field, and returns `PaymentCreateInvoiceResponse`.
* `PaymentInvoiceImport`: implements `POST` `/api/v5/payment/invoice/import`, sends `PaymentInvoiceImportRequest` as the `invoice` form field, and returns `PaymentInvoiceResponse`.
* `PaymentInvoice`: implements `GET` `/api/v5/payment/invoice/{invoiceUuid}` and returns `PaymentInvoiceResponse`.
* `PaymentUpdateInvoice`: implements `POST` `/api/v5/payment/update-invoice`, sends `PaymentUpdateInvoiceRequest` as the `updateInvoice` form field, and returns `SuccessfulResponse`.
* `ProductsPropertiesValues`: implements `GET` `/api/v5/store/products/properties/values` with `propertyCode`, `propertyName`, `groups`, `limit`, and `page` parameters.
* `MGChannels`: implements `GET` `/api/v5/reference/mg-channels`.
* `Subscriptions`: implements `GET` `/api/v5/reference/subscriptions`.
* `SubscriptionEdit`: implements `POST` `/api/v5/reference/subscriptions/{channel}/{code}/edit` and sends `Subscription` as the `subscription` form field.
Added request/filter/response DTOs:
* `ProductsPropertiesValuesFilter` and `ProductsPropertiesValuesRequest` for `/api/v5/store/products/properties/values` filtering and pagination.
* `ProductsPropertiesValuesResponse` for `productPropertyValues` payloads.
* `PaymentCheckRequest` and `PaymentCheckResponse` for payment check calls.
* `PaymentCreateInvoiceRequest` and `PaymentCreateInvoiceResponse` for payment invoice link creation.
* `PaymentInvoiceImportRequest` and `PaymentInvoiceResponse` for invoice import and invoice read calls.
* `PaymentUpdateInvoiceRequest` for invoice status/data updates.
* `MGChannelsResponse` for reference `mgChannels` payloads.
* `SubscriptionsResponse` for reference `subscriptions` payloads.
Changed and extended shared DTOs:
* `Property`: adds `isNumeric`, `visible`, and `variative` fields; fixes the `sites` JSON field name.
* `ProductPropertyValue`: adds a new DTO for property value rows returned by `/api/v5/store/products/properties/values`.
* `Address`: adds `coordinates`; `Point` is added for `latitude`/`longitude`.
* `PaymentInvoice`, `PaymentInvoiceRefund`, `PaymentCheckResult`, and `PaymentCreateInvoiceResult` are added for payment invoice APIs.
* `PaymentType`: fixes the `paymentStatuses` JSON field name.
* `Site`: adds `senderEmail`, `senderName`, and `usedInSimlaweb`.
* `Store`: adds `ordering`, `contact`, and optional `workTime`; `WorkTimeByDay` and `StoreWorkTime` are added for warehouse schedules.
* `Integrations`: adds `recommendation`, `payment`, and `embedJs` integration blocks.
* `Delivery`: adds `duplicateOrderProductSupported` and `settings`.
* `DeliverySettings`, `DeliverySettingsPaymentType`, `DeliverySettingsShipmentPoint`, and `DeliverySettingsStatus` are added for delivery integration configuration.
* `Plate`: adds `type`.
* `DeliveryDataField`: adds `choices` and `visible`.
* `Recommendation` and `RecommendationMode` are added for recommendation integrations.
* `PaymentModule`, `PaymentModuleActions`, and `PaymentModuleShop` are added for payment integrations.
* `EmbedJS` and `EmbedJSPage` are added for embedded JavaScript integration metadata.
* `MgTransport`: adds `token` and `isActive`.
* `MgBot`: adds `isActive`, `logo`, `token`, and `name`.
Comments and examples:
* Adds structured example comments for all newly added client methods.
* Adds missing structured example comments for existing reference API methods and MessageGateway template methods.
* Fixes the `ProductsProperties` example slice literal.
Tests:
* Adds coverage for `PaymentCheck`, `PaymentCreateInvoice`, `PaymentInvoiceImport`, `PaymentInvoice`, and `PaymentUpdateInvoice`.
* Adds coverage for `ProductsPropertiesValues`.
* Adds coverage for `MGChannels`, `Subscriptions`, and `SubscriptionEdit`.
* Keeps existing `CustomersCombine` and `OrdersCombine` behavior unchanged.
Backward compatibility:
* Potentially breaking: `Property.Sites` now uses JSON `sites` instead of the previous incorrect JSON `Sites` tag. Go field access remains `Property.Sites`, but exact JSON serialization/deserialization expectations using the uppercase key must be updated.
* Potentially breaking: `PaymentType.PaymentStatuses` now uses JSON `paymentStatuses` instead of the previous incorrect JSON `PaymentStatuses` tag. Go field access remains `PaymentType.PaymentStatuses`, but exact JSON payloads expecting the uppercase key must be updated.
* `Store.WorkTime` is added as an optional pointer field, so zero-value `Store` serialization remains compatible.
* All added methods and all other added DTO fields are additive and do not change existing method signatures.
Update indirect dependency gopkg.in/yaml.v3 from v3.0.0-20200313102051-9f266ea9e77c to v3.0.1 to address the Dependabot security alert. Verification: * go mod tidy * go test -tags testutils ./...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added client methods:
PaymentCheck: implementsPOST/api/v5/payment/check, sendsPaymentCheckRequestas thecheckform field, and returnsPaymentCheckResponse.PaymentCreateInvoice: implementsPOST/api/v5/payment/create-invoice, sendsPaymentCreateInvoiceRequestas thecreateInvoiceform field, and returnsPaymentCreateInvoiceResponse.PaymentInvoiceImport: implementsPOST/api/v5/payment/invoice/import, sendsPaymentInvoiceImportRequestas theinvoiceform field, and returnsPaymentInvoiceResponse.PaymentInvoice: implementsGET/api/v5/payment/invoice/{invoiceUuid}and returnsPaymentInvoiceResponse.PaymentUpdateInvoice: implementsPOST/api/v5/payment/update-invoice, sendsPaymentUpdateInvoiceRequestas theupdateInvoiceform field, and returnsSuccessfulResponse.ProductsPropertiesValues: implementsGET/api/v5/store/products/properties/valueswithpropertyCode,propertyName,groups,limit, andpageparameters.MGChannels: implementsGET/api/v5/reference/mg-channels.Subscriptions: implementsGET/api/v5/reference/subscriptions.SubscriptionEdit: implementsPOST/api/v5/reference/subscriptions/{channel}/{code}/editand sendsSubscriptionas thesubscriptionform field.Added request/filter/response DTOs:
ProductsPropertiesValuesFilterandProductsPropertiesValuesRequestfor/api/v5/store/products/properties/valuesfiltering and pagination.ProductsPropertiesValuesResponseforproductPropertyValuespayloads.PaymentCheckRequestandPaymentCheckResponsefor payment check calls.PaymentCreateInvoiceRequestandPaymentCreateInvoiceResponsefor payment invoice link creation.PaymentInvoiceImportRequestandPaymentInvoiceResponsefor invoice import and invoice read calls.PaymentUpdateInvoiceRequestfor invoice status/data updates.MGChannelsResponsefor referencemgChannelspayloads.SubscriptionsResponsefor referencesubscriptionspayloads.Changed and extended shared DTOs:
Property: addsisNumeric,visible, andvariativefields; fixes thesitesJSON field name.ProductPropertyValue: adds a new DTO for property value rows returned by/api/v5/store/products/properties/values.Address: addscoordinates;Pointis added forlatitude/longitude.PaymentInvoice,PaymentInvoiceRefund,PaymentCheckResult, andPaymentCreateInvoiceResultare added for payment invoice APIs.PaymentType: fixes thepaymentStatusesJSON field name.Site: addssenderEmail,senderName, andusedInSimlaweb.Store: addsordering,contact, and optionalworkTime;WorkTimeByDayandStoreWorkTimeare added for warehouse schedules.Integrations: addsrecommendation,payment, andembedJsintegration blocks.Delivery: addsduplicateOrderProductSupportedandsettings.DeliverySettings,DeliverySettingsPaymentType,DeliverySettingsShipmentPoint, andDeliverySettingsStatusare added for delivery integration configuration.Plate: addstype.DeliveryDataField: addschoicesandvisible.RecommendationandRecommendationModeare added for recommendation integrations.PaymentModule,PaymentModuleActions, andPaymentModuleShopare added for payment integrations.EmbedJSandEmbedJSPageare added for embedded JavaScript integration metadata.MgTransport: addstokenandisActive.MgBot: addsisActive,logo,token, andname.Comments and examples:
ProductsPropertiesexample slice literal.Tests:
PaymentCheck,PaymentCreateInvoice,PaymentInvoiceImport,PaymentInvoice, andPaymentUpdateInvoice.ProductsPropertiesValues.MGChannels,Subscriptions, andSubscriptionEdit.CustomersCombineandOrdersCombinebehavior unchanged.Backward compatibility:
Property.Sitesnow uses JSONsitesinstead of the previous incorrect JSONSitestag. Go field access remainsProperty.Sites, but exact JSON serialization/deserialization expectations using the uppercase key must be updated.PaymentType.PaymentStatusesnow uses JSONpaymentStatusesinstead of the previous incorrect JSONPaymentStatusestag. Go field access remainsPaymentType.PaymentStatuses, but exact JSON payloads expecting the uppercase key must be updated.Store.WorkTimeis added as an optional pointer field, so zero-valueStoreserialization remains compatible.Security: