Skip to content

Update API v5 method coverage#118

Merged
gwinn merged 2 commits into
retailcrm:masterfrom
gwinn:master
May 8, 2026
Merged

Update API v5 method coverage#118
gwinn merged 2 commits into
retailcrm:masterfrom
gwinn:master

Conversation

@gwinn
Copy link
Copy Markdown
Member

@gwinn gwinn commented May 8, 2026

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.

Security:

  • Update indirect dependency gopkg.in/yaml.v3 from v3.0.0-20200313102051-9f266ea9e77c to v3.0.1 to address the Dependabot security alert.

gwinn added 2 commits May 8, 2026 17:37
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 ./...
@gwinn gwinn merged commit ea3ed8b into retailcrm:master May 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant