rapida-partner 3.3.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapida-partner",
3
- "version": "3.3.0",
3
+ "version": "3.6.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "index.ts",
6
6
  "files": [
@@ -28,12 +28,32 @@ export interface IPublicContract {
28
28
  * contra chamadas servidor-a-servidor (use `access: "trustedCallers"` para isso).
29
29
  */
30
30
  allowedOrigins?: string[];
31
+ /**
32
+ * Somas agrupadas por um campo, calculadas no banco e expostas com o mesmo
33
+ * `access` do contrato em `GET <endpoint>/aggregations/<id>` (aceita o mesmo
34
+ * `filters` da listagem e respeita o workspace). Ex.: saldo de estoque por
35
+ * produto sem varrer todas as movimentações.
36
+ */
37
+ aggregations?: IContractAggregation[];
31
38
  request?: IContractRequest;
32
39
  conditions?: IFormCondition;
33
40
  businessRules?: IBusinessRule[];
34
41
  userStory?: string;
35
42
  }
36
43
 
44
+ /**
45
+ * Agregação de um contrato público. A resposta é uma lista de
46
+ * `{ _id: <valor de groupBy>, <campo de sum>: <total> }`.
47
+ */
48
+ export interface IContractAggregation {
49
+ // Último segmento da rota: GET <endpoint>/aggregations/<id>.
50
+ id: string;
51
+ // Campo pelo qual os registros são agrupados (ex.: "productId").
52
+ groupBy: string;
53
+ // Campos numéricos somados em cada grupo (ex.: ["inputQuantity"]).
54
+ sum: string[];
55
+ }
56
+
37
57
  export interface IContractRequest {
38
58
  entity: string,
39
59
  relatedEntity?: {
@@ -1,6 +1,8 @@
1
1
  import type { IFormAutocomplete } from "./form-autocomplete.interface";
2
2
  import type { IList } from "./list.interface";
3
3
  import type { ITrustedCaller } from "./trusted-caller.interface";
4
+ import type { IReferralSourceIntegration } from "./referral-source.interface";
5
+ import type { IScheduledJob } from "./scheduled-job.interface";
4
6
 
5
7
  interface IDatabase {
6
8
  provider:
@@ -73,6 +75,40 @@ interface IMarketplace {
73
75
  // Campos fixos da saída de estoque gravada no vendedor a cada venda aprovada
74
76
  // (ex.: stockOutType, hasSerialNumber, responsibleId da pessoa padrão).
75
77
  stockOutDefaults?: Record<string, string | number | boolean>;
78
+ // Saldo já somado no vendedor: agregações (IPublicContract.aggregations) das
79
+ // entradas e das saídas de estoque agrupadas por productId, somando
80
+ // inputQuantity e outputQuantity. Com os dois, a loja deixa de ler todas as
81
+ // movimentações (ex.: "/stock-ins/aggregations/balance").
82
+ stockInAggregateEndpoint?: string;
83
+ stockOutAggregateEndpoint?: string;
84
+ // Pedidos enviados ao vendedor (módulo pronto getStoreOrdersModule, contrato
85
+ // público com access "trustedCallers"). A loja cria o pedido aprovado e lê
86
+ // dali o andamento da entrega (em separação, enviado, entregue, rastreio).
87
+ storeOrdersEndpoint?: string;
88
+ // Categorias e marcas do vendedor, para menu, filtros e navegação da vitrine.
89
+ categoriesEndpoint?: string;
90
+ brandsEndpoint?: string;
91
+ // Em que campo do produto do vendedor está cada informação usada pela
92
+ // vitrine. O gerador tem um padrão para cada campo omitido.
93
+ productFieldMap?: IMarketplaceProductFieldMap;
94
+ }
95
+
96
+ export interface IMarketplaceProductFieldMap {
97
+ // Referência à categoria (padrão "categoryId").
98
+ category?: string;
99
+ // Referência à marca (padrão "brandId").
100
+ brand?: string;
101
+ // Lista de tags (padrão "productsTags").
102
+ tags?: string;
103
+ // Modelo (padrão "productModel").
104
+ model?: string;
105
+ // Peso e medidas, usados por cotação de frete por transportadora.
106
+ weight?: string;
107
+ height?: string;
108
+ width?: string;
109
+ length?: string;
110
+ // Lista de propriedades da ficha técnica (padrão "othersProperties").
111
+ properties?: string;
76
112
  }
77
113
 
78
114
  export interface ISellerServiceAuth {
@@ -111,6 +147,10 @@ export interface IBackend {
111
147
  email?: IEmail;
112
148
  marketplace?: IMarketplace;
113
149
  service?: IService;
150
+ // Só para skeleton "referralCommerce": uma entrada por fonte de afiliado.
151
+ referralSources?: IReferralSourceIntegration[];
152
+ // Frequência dos jobs agendados que o skeleton/funcionalidade gera.
153
+ scheduledJobs?: IScheduledJob[];
114
154
  mercadoPagoIntegration?: {
115
155
  publicKey?: string;
116
156
  accessToken?: string;
@@ -17,6 +17,7 @@ import type { IProjectRepositories } from "./project-repositories.interface";
17
17
  import type { IStyle } from "./project-style.interface";
18
18
  import type { TTranslatable } from "./translatable.interface";
19
19
  import type { IProjectStore } from "./store-settings.interface";
20
+ import type { IReferralCuration } from "./referral-curation.interface";
20
21
 
21
22
  export interface IProject {
22
23
  id: string;
@@ -27,7 +28,18 @@ export interface IProject {
27
28
  // "ecommerce": loja de um único vendedor (o dono dos dados da instância).
28
29
  // "marketplace": vários vendedores; enquanto a camada multivendedor não existe,
29
30
  // o rapida-code-generator gera para os dois o mesmo núcleo de loja.
30
- skeleton: "backoffice" | "ecommerce" | "marketplace" | "landingPage" | "socialNetwork" | "service" | "aiAgent";
31
+ // "referralCommerce": vitrine sem venda própria; cada produto leva por link de
32
+ // afiliado para o anúncio na fonte de origem (IBackend.referralSources), com
33
+ // a curadoria de IProject.referralCuration. Requer suporte no gerador.
34
+ skeleton:
35
+ | "backoffice"
36
+ | "ecommerce"
37
+ | "marketplace"
38
+ | "referralCommerce"
39
+ | "landingPage"
40
+ | "socialNetwork"
41
+ | "service"
42
+ | "aiAgent";
31
43
  // Idiomas em que os textos TTranslatable (label, placeholder, tooltip, title)
32
44
  // são declarados. Sem languages, o projeto é monolíngue em defaultLanguage.
33
45
  languages?: TLanguage[];
@@ -83,6 +95,8 @@ export interface IProject {
83
95
  // Só para skeleton "ecommerce"/"marketplace": funcionalidades opcionais
84
96
  // geradas e valores iniciais da configuração da loja.
85
97
  store?: IProjectStore;
98
+ // Só para skeleton "referralCommerce": filtros e desempate dos produtos exibidos.
99
+ referralCuration?: IReferralCuration;
86
100
  }
87
101
 
88
102
  export interface IFrontend {
@@ -0,0 +1,95 @@
1
+ import type { TReferralSource } from "./referral-source.interface";
2
+
3
+ /**
4
+ * Critério de desempate quando o mesmo produto (mesmo GTIN/EAN) passa pelos
5
+ * filtros em mais de uma fonte. Aplicados na ordem da lista; uma fonte sem o
6
+ * dado do critério (prazo ou comissão) perde aquele desempate.
7
+ *
8
+ * Hoje nenhuma API de afiliado informa prazo de entrega por item: "fastestDelivery"
9
+ * só decide quando a fonte declara `IReferralSourceIntegration.defaultDeliveryDays`.
10
+ */
11
+ export type TReferralTieBreaker = "fastestDelivery" | "highestCommission" | "lowestPrice";
12
+
13
+ /**
14
+ * Filtros de `IReferralCuration` cujo dado nem toda fonte informa:
15
+ * - "ratingCount": `minRatingCount`;
16
+ * - "rating": `minNormalizedRating`;
17
+ * - "freeShipping": `freeShippingOnly`.
18
+ * O desconto sobre o preço médio fica fora: sem histórico não há o que comparar.
19
+ */
20
+ export type TReferralCriterion = "ratingCount" | "rating" | "freeShipping";
21
+
22
+ /**
23
+ * O que fazer com um anúncio quando a fonte não informa o dado de um critério:
24
+ * - "reject": reprova o anúncio (padrão);
25
+ * - "skip": ignora só esse critério para o anúncio, que a vitrine marca como
26
+ * não verificado nesse ponto.
27
+ */
28
+ export type TReferralMissingDataPolicy = "reject" | "skip";
29
+
30
+ export type TReferralMissingDataRules = Partial<Record<TReferralCriterion, TReferralMissingDataPolicy>>;
31
+
32
+ /**
33
+ * Exceção de uma fonte às regras de dado ausente. Vale só para os critérios
34
+ * listados; os demais seguem `IReferralCuration.missingData`.
35
+ */
36
+ export interface IReferralSourceCurationOverride {
37
+ missingData?: TReferralMissingDataRules;
38
+ }
39
+
40
+ /**
41
+ * O que buscar nas fontes. O job de captura pesquisa cada termo em cada fonte
42
+ * configurada, restrito às categorias da fonte quando declaradas.
43
+ */
44
+ export interface IReferralSearch {
45
+ // Termos de busca (ex.: "blu-ray", "box dvd"). Ao menos um.
46
+ keywords: string[];
47
+ // Ids nativos de categoria de cada fonte, para restringir a busca.
48
+ categories?: Partial<Record<TReferralSource, string[]>>;
49
+ // Máximo de anúncios lidos por termo em cada fonte. Padrão do gerador se omitido.
50
+ maxListingsPerQuery?: number;
51
+ }
52
+
53
+ /**
54
+ * Base do "preço médio" com que o preço atual é comparado.
55
+ *
56
+ * "sourceHistory": média dos preços do próprio anúncio, na mesma fonte, nos
57
+ * últimos `windowDays` dias, com um preço por dia (o último capturado no dia).
58
+ * O dia corrente fica fora da média, para o preço de hoje não puxar a base.
59
+ * Os preços vêm do job de captura (`IBackend.scheduledJobs`, id
60
+ * "referralPriceSnapshot"). Enquanto o anúncio tiver menos de `minSnapshots`
61
+ * dias com captura na janela, ele não é exibido.
62
+ */
63
+ export interface IReferralPriceBaseline {
64
+ kind: "sourceHistory";
65
+ windowDays: number;
66
+ // Mínimo de dias distintos com captura na janela (não de capturas).
67
+ minSnapshots?: number;
68
+ }
69
+
70
+ /**
71
+ * Regras de curadoria dos produtos exibidos no skeleton "referralCommerce"
72
+ * (`IProject.referralCuration`). São regras do produto, iguais em todo ambiente;
73
+ * credenciais das fontes ficam em `IBackend.referralSources`.
74
+ *
75
+ * Identidade de produto entre fontes: só GTIN/EAN normalizado (forma GTIN-14,
76
+ * dígito verificador válido). Anúncio sem GTIN válido não é descartado: concorre
77
+ * sozinho, sem entrar no desempate com as outras fontes.
78
+ */
79
+ export interface IReferralCuration {
80
+ // Mínimo de avaliações, inclusivo (">200 avaliações" = 201).
81
+ minRatingCount: number;
82
+ // Nota mínima normalizada em 0..1, inclusiva: 0.9 = 4.5/5 = 9/10.
83
+ minNormalizedRating: number;
84
+ // Desconto mínimo (0..1) do preço atual em relação a `priceBaseline`: 0.1 = 10% abaixo.
85
+ minDiscountFromBaseline: number;
86
+ priceBaseline: IReferralPriceBaseline;
87
+ // Só exibe anúncios com frete grátis.
88
+ freeShippingOnly: boolean;
89
+ tieBreakers: TReferralTieBreaker[];
90
+ search: IReferralSearch;
91
+ // Política para dado ausente, por critério. Critério omitido = "reject".
92
+ missingData?: TReferralMissingDataRules;
93
+ // Exceções por fonte, que prevalecem sobre `missingData` nos critérios listados.
94
+ sourceOverrides?: Partial<Record<TReferralSource, IReferralSourceCurationOverride>>;
95
+ }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Fontes de produto do skeleton "referralCommerce": a loja não vende, só leva
3
+ * o comprador por link de afiliado para o anúncio na fonte de origem.
4
+ *
5
+ * "mercadoLivre" é o catálogo/programa de afiliados do Mercado Livre — não
6
+ * confundir com "mercadoPago" de `IPaymentGateway`, que é gateway de pagamento.
7
+ */
8
+ export type TReferralSource = "shopee" | "amazon" | "mercadoLivre";
9
+
10
+ /**
11
+ * Campos comuns da integração com o programa de afiliados de uma fonte.
12
+ */
13
+ interface IReferralSourceIntegrationBase {
14
+ // Comissão (0..1) assumida quando a API não informa a comissão por item
15
+ // (ex.: tabela por categoria). Usada pelo desempate "highestCommission";
16
+ // sem ela e sem dado por item, a fonte perde esse desempate.
17
+ defaultCommissionRate?: number;
18
+ // Prazo de entrega (dias) assumido para os anúncios da fonte. Nenhuma API de
19
+ // afiliado informa prazo por item hoje; sem este valor, a fonte perde o
20
+ // desempate "fastestDelivery". Prazo real por CEP está fora do escopo.
21
+ defaultDeliveryDays?: number;
22
+ }
23
+
24
+ /**
25
+ * Shopee Afiliados (Open API). AppID e Secret ficam na página Open API do painel
26
+ * de afiliado. A API devolve o link de oferta já atribuído à conta dona do AppID,
27
+ * por isso `affiliateTag` é opcional e hoje não é usado pelo gerador. O uso como
28
+ * sub-id do link depende de confirmar a API com conta real.
29
+ */
30
+ export interface IShopeeReferralIntegration extends IReferralSourceIntegrationBase {
31
+ source: "shopee";
32
+ credentials: {
33
+ appId: string;
34
+ secret: string;
35
+ };
36
+ affiliateTag?: string;
37
+ }
38
+
39
+ /**
40
+ * Amazon Associates (Creators API). Credenciais do Associates Central; a API só
41
+ * é liberada depois de vendas qualificadas no marketplace.
42
+ */
43
+ export interface IAmazonReferralIntegration extends IReferralSourceIntegrationBase {
44
+ source: "amazon";
45
+ credentials: {
46
+ credentialId: string;
47
+ credentialSecret: string;
48
+ // Versão da credencial; define o endereço de emissão do token. Padrão do gerador se omitida.
49
+ version?: string;
50
+ // Marketplace alvo (ex.: "www.amazon.com.br"). Padrão do gerador se omitido.
51
+ marketplace?: string;
52
+ };
53
+ // Tag de associado (partnerTag) anexada a todo link.
54
+ affiliateTag: string;
55
+ }
56
+
57
+ /**
58
+ * Mercado Livre: aplicação no portal de desenvolvedores (clientId/clientSecret)
59
+ * para o catálogo e programa de afiliados para a comissão do link.
60
+ */
61
+ export interface IMercadoLivreReferralIntegration extends IReferralSourceIntegrationBase {
62
+ source: "mercadoLivre";
63
+ credentials: {
64
+ clientId: string;
65
+ clientSecret: string;
66
+ // Ferramenta de afiliado (parâmetro matt_tool do link).
67
+ mattTool?: string;
68
+ };
69
+ // Identificador de afiliado (parâmetro matt_word do link).
70
+ affiliateTag: string;
71
+ }
72
+
73
+ /**
74
+ * Integração com o programa de afiliados de uma fonte, por ambiente
75
+ * (`IBackend.referralSources`). Uma entrada por fonte; as chaves de
76
+ * `credentials` são as que cada programa usa.
77
+ */
78
+ export type IReferralSourceIntegration =
79
+ | IShopeeReferralIntegration
80
+ | IAmazonReferralIntegration
81
+ | IMercadoLivreReferralIntegration;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Ids dos jobs que o próprio skeleton/funcionalidade gera:
3
+ * - "referralPriceSnapshot": captura de preços dos anúncios do skeleton
4
+ * "referralCommerce" (base de `IReferralPriceBaseline`). Respeite o limite
5
+ * de requisições das APIs de afiliado ao escolher a frequência.
6
+ */
7
+ export type TScheduledJobId = "referralPriceSnapshot";
8
+
9
+ /**
10
+ * Job agendado do backend gerado (`IBackend.scheduledJobs`), por ambiente.
11
+ * O projeto só ajusta a frequência de um job que o gerador já cria.
12
+ */
13
+ export interface IScheduledJob {
14
+ id: TScheduledJobId;
15
+ // Expressão cron de 5 campos (ex.: "0 */6 * * *").
16
+ cron: string;
17
+ // Fuso IANA do agendador (ex.: "America/Sao_Paulo"); padrão do servidor se omitido.
18
+ timezone?: string;
19
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Andamento da entrega de um pedido no vendedor. O pagamento continua sendo da
3
+ * loja; separação, envio e rastreio são do vendedor (módulo pronto
4
+ * getStoreOrdersModule).
5
+ */
6
+ export type TStoreOrderFulfillmentStatus = "received" | "preparing" | "shipped" | "delivered" | "cancelled";
7
+
8
+ export interface IStoreOrderItem {
9
+ productId: string;
10
+ name: string;
11
+ quantity: number;
12
+ unitPrice: number;
13
+ }
14
+
15
+ /**
16
+ * Pedido aprovado que a loja envia ao vendedor por IMarketplace.storeOrdersEndpoint.
17
+ * Os campos são os nomes do form do módulo pronto.
18
+ */
19
+ export interface IStoreOrder {
20
+ // Id do pedido na loja; um pedido por storeOrderId.
21
+ storeOrderId: string;
22
+ storeName?: string;
23
+ customerName?: string;
24
+ customerEmail?: string;
25
+ items: IStoreOrderItem[];
26
+ // Endereço de entrega, em campos próprios (os forms não aninham objetos).
27
+ addressZipCode?: string;
28
+ addressStreet?: string;
29
+ addressNumber?: string;
30
+ addressComplement?: string;
31
+ addressDistrict?: string;
32
+ addressCity?: string;
33
+ addressState?: string;
34
+ addressCountry?: string;
35
+ subtotal: number;
36
+ discount: number;
37
+ shipping: number;
38
+ total: number;
39
+ currency: string;
40
+ status: TStoreOrderFulfillmentStatus;
41
+ trackingCode?: string;
42
+ trackingUrl?: string;
43
+ notes?: string;
44
+ }
@@ -10,7 +10,8 @@ export type TStoreFeature =
10
10
  | "cashDiscount"
11
11
  | "installments"
12
12
  | "favorites"
13
- | "blog";
13
+ | "blog"
14
+ | "shipping";
14
15
 
15
16
  export type TStoreFeatureToggle = `${TStoreFeature}Enabled`;
16
17
 
@@ -65,6 +66,24 @@ export interface IStoreSettings extends Partial<Record<TStoreFeatureToggle, bool
65
66
  // Só têm efeito com as funcionalidades "cashDiscount" e "installments".
66
67
  cashDiscountPercent?: number;
67
68
  maxInstallments?: number;
69
+
70
+ // Só têm efeito com a funcionalidade "shipping". CEP de onde os pedidos
71
+ // saem (somente dígitos), frete grátis a partir de um valor e a tabela de
72
+ // faixas de CEP com valor e prazo. CEP fora de toda faixa não é atendido.
73
+ originZipCode?: string;
74
+ freeShippingAbove?: number;
75
+ shippingRanges?: IStoreShippingRange[];
76
+ }
77
+
78
+ /** Faixa de CEP (inclusiva, somente dígitos) com valor e prazo do frete. */
79
+ export interface IStoreShippingRange {
80
+ // Nome da faixa mostrado ao cliente (ex.: "Capital", "Nordeste").
81
+ label?: string;
82
+ zipCodeStart: string;
83
+ zipCodeEnd: string;
84
+ price: number;
85
+ // Prazo de entrega em dias úteis.
86
+ deliveryDays: number;
68
87
  }
69
88
 
70
89
  /**
@@ -0,0 +1,82 @@
1
+ import { EDataType } from "../../enums/form.enum";
2
+ import type { IFormElement } from "../../interfaces/form.interface";
3
+ import type { TStoreOrderFulfillmentStatus } from "../../interfaces/store-order.interface";
4
+ import { tr } from "../store-settings/translations";
5
+
6
+ type TLabel = ReturnType<typeof tr>;
7
+
8
+ const text = (name: string, label: TLabel, extra: Partial<{ isRequired: boolean; isDisabled: boolean }> = {}): IFormElement => ({
9
+ type: "input",
10
+ name,
11
+ dataType: EDataType.TEXT,
12
+ label,
13
+ ...extra,
14
+ });
15
+
16
+ const money = (name: string, label: TLabel): IFormElement => ({
17
+ type: "input",
18
+ name,
19
+ dataType: EDataType.CURRENCY,
20
+ label,
21
+ isDisabled: true,
22
+ });
23
+
24
+ export const STORE_ORDER_STATUS_LABELS: Record<TStoreOrderFulfillmentStatus, TLabel> = {
25
+ received: tr("Recebido", "Received", "Recibido"),
26
+ preparing: tr("Em separação", "Preparing", "En preparación"),
27
+ shipped: tr("Enviado", "Shipped", "Enviado"),
28
+ delivered: tr("Entregue", "Delivered", "Entregado"),
29
+ cancelled: tr("Cancelado", "Cancelled", "Cancelado"),
30
+ };
31
+
32
+ export const fulfillmentElements: IFormElement[] = [
33
+ {
34
+ type: "select",
35
+ name: "status",
36
+ dataType: EDataType.TEXT,
37
+ label: tr("Andamento", "Status", "Estado"),
38
+ isRequired: true,
39
+ options: (Object.keys(STORE_ORDER_STATUS_LABELS) as TStoreOrderFulfillmentStatus[]).map((status) => ({
40
+ label: STORE_ORDER_STATUS_LABELS[status],
41
+ value: status,
42
+ isSelected: status === "received",
43
+ })),
44
+ },
45
+ text("trackingCode", tr("Código de rastreio", "Tracking code", "Código de seguimiento")),
46
+ text("trackingUrl", tr("Link de rastreio", "Tracking link", "Enlace de seguimiento")),
47
+ text("notes", tr("Observações", "Notes", "Observaciones")),
48
+ ];
49
+
50
+ export const orderElements: IFormElement[] = [
51
+ text("storeOrderId", tr("Pedido na loja", "Store order", "Pedido en la tienda"), { isRequired: true, isDisabled: true }),
52
+ text("storeName", tr("Loja", "Store", "Tienda"), { isDisabled: true }),
53
+ text("customerName", tr("Cliente", "Customer", "Cliente"), { isDisabled: true }),
54
+ text("customerEmail", tr("E-mail do cliente", "Customer e-mail", "Correo del cliente"), { isDisabled: true }),
55
+ {
56
+ type: "array",
57
+ name: "items",
58
+ label: tr("Itens", "Items", "Artículos"),
59
+ elements: [
60
+ text("productId", tr("Produto (id)", "Product (id)", "Producto (id)"), { isRequired: true, isDisabled: true }),
61
+ text("name", tr("Produto", "Product", "Producto"), { isRequired: true, isDisabled: true }),
62
+ { type: "input", name: "quantity", dataType: EDataType.INTEGER, label: tr("Quantidade", "Quantity", "Cantidad"), isRequired: true, isDisabled: true },
63
+ money("unitPrice", tr("Preço unitário", "Unit price", "Precio unitario")),
64
+ ],
65
+ },
66
+ money("subtotal", tr("Subtotal", "Subtotal", "Subtotal")),
67
+ money("discount", tr("Desconto", "Discount", "Descuento")),
68
+ money("shipping", tr("Frete", "Shipping", "Envío")),
69
+ money("total", tr("Total", "Total", "Total")),
70
+ text("currency", tr("Moeda", "Currency", "Moneda"), { isDisabled: true }),
71
+ ];
72
+
73
+ export const addressElements: IFormElement[] = [
74
+ text("addressZipCode", tr("CEP", "ZIP code", "Código postal"), { isDisabled: true }),
75
+ text("addressStreet", tr("Logradouro", "Street", "Calle"), { isDisabled: true }),
76
+ text("addressNumber", tr("Número", "Number", "Número"), { isDisabled: true }),
77
+ text("addressComplement", tr("Complemento", "Complement", "Complemento"), { isDisabled: true }),
78
+ text("addressDistrict", tr("Bairro", "District", "Barrio"), { isDisabled: true }),
79
+ text("addressCity", tr("Cidade", "City", "Ciudad"), { isDisabled: true }),
80
+ text("addressState", tr("Estado", "State", "Estado"), { isDisabled: true }),
81
+ text("addressCountry", tr("País", "Country", "País"), { isDisabled: true }),
82
+ ];
@@ -0,0 +1,107 @@
1
+ import { EDataType } from "../../enums/form.enum";
2
+ import type { IPublicContract } from "../../interfaces/form-contract.interface";
3
+ import type { IForm } from "../../interfaces/form.interface";
4
+ import type { IList } from "../../interfaces/list.interface";
5
+ import type { IModule } from "../../interfaces/project.interface";
6
+ import { tr } from "../store-settings/translations";
7
+ import { STORE_ORDER_STATUS_LABELS, addressElements, fulfillmentElements, orderElements } from "./store-order.elements";
8
+
9
+ export const STORE_ORDERS_ENDPOINT = "/store-orders";
10
+
11
+ export interface IStoreOrdersModuleOptions {
12
+ // Quem cria e lê os pedidos sem login. "trustedCallers" (padrão): só o
13
+ // backend da loja, com o token de serviço de IMarketplace.sellerServiceAuth.
14
+ publicAccess?: IPublicContract["access"];
15
+ allowedOrigins?: string[];
16
+ }
17
+
18
+ const ENTITY = "storeOrders";
19
+
20
+ export const getStoreOrderForm = (options: IStoreOrdersModuleOptions = {}): IForm => ({
21
+ componentType: "form",
22
+ id: "storeOrderForm",
23
+ title: tr("Pedido da loja", "Store order", "Pedido de la tienda"),
24
+ icon: "truck",
25
+ guards: "isAuthorized",
26
+ elements: [
27
+ {
28
+ type: "tab",
29
+ id: "storeOrderTabs",
30
+ tabs: [
31
+ { id: "fulfillment", title: tr("Entrega", "Fulfillment", "Entrega"), elements: fulfillmentElements },
32
+ { id: "order", title: tr("Pedido", "Order", "Pedido"), elements: orderElements },
33
+ { id: "address", title: tr("Endereço", "Address", "Dirección"), elements: addressElements },
34
+ ],
35
+ },
36
+ ],
37
+ contracts: [
38
+ {
39
+ id: ENTITY,
40
+ endpoint: STORE_ORDERS_ENDPOINT,
41
+ actions: ["get", "getById", "update"],
42
+ request: { entity: ENTITY, fields: [] },
43
+ },
44
+ ],
45
+ publicContracts: [
46
+ {
47
+ id: "storeOrdersFromStore",
48
+ endpoint: STORE_ORDERS_ENDPOINT,
49
+ actions: ["create", "get", "update"],
50
+ access: options.publicAccess ?? "trustedCallers",
51
+ ...(options.allowedOrigins ? { allowedOrigins: options.allowedOrigins } : {}),
52
+ request: {
53
+ entity: ENTITY,
54
+ fields: [],
55
+ uniqueConstraints: [{ identificator: "storeOrderIdPerWorkspace", fields: ["storeOrderId"] }],
56
+ },
57
+ },
58
+ ],
59
+ });
60
+
61
+ export const getStoreOrderList = (): IList => ({
62
+ componentType: "list",
63
+ id: "storeOrderList",
64
+ title: tr("Pedidos da loja", "Store orders", "Pedidos de la tienda"),
65
+ guards: ["isAuthorized"],
66
+ dataSource: { endpoint: STORE_ORDERS_ENDPOINT, paramType: "query", hasAuthentication: true },
67
+ listItems: [
68
+ { property: "storeOrderId", type: "title", label: tr("Pedido", "Order", "Pedido"), dataType: EDataType.TEXT },
69
+ { property: "customerName", type: "subtitle", label: tr("Cliente", "Customer", "Cliente"), dataType: EDataType.TEXT },
70
+ { property: "total", type: "description", label: tr("Total", "Total", "Total"), dataType: EDataType.CURRENCY },
71
+ { property: "status", type: "badge", label: tr("Andamento", "Status", "Estado"), dataType: EDataType.TEXT },
72
+ { property: "createdAt", label: tr("Recebido em", "Received at", "Recibido el"), dataType: EDataType.DATE, isTimestamp: true },
73
+ ],
74
+ listFilters: [
75
+ {
76
+ type: "select",
77
+ name: "status",
78
+ dataType: EDataType.TEXT,
79
+ label: tr("Andamento", "Status", "Estado"),
80
+ options: (Object.keys(STORE_ORDER_STATUS_LABELS) as (keyof typeof STORE_ORDER_STATUS_LABELS)[]).map((status) => ({
81
+ label: STORE_ORDER_STATUS_LABELS[status],
82
+ value: status,
83
+ })),
84
+ },
85
+ ],
86
+ contracts: [
87
+ {
88
+ id: ENTITY,
89
+ endpoint: STORE_ORDERS_ENDPOINT,
90
+ actions: ["get", "getById", "update"],
91
+ request: { entity: ENTITY, fields: [] },
92
+ },
93
+ ],
94
+ });
95
+
96
+ /**
97
+ * Módulo pronto "Pedidos da loja", para o Backoffice do vendedor. A loja cria
98
+ * aqui cada pedido aprovado (IStoreOrder) por IMarketplace.storeOrdersEndpoint
99
+ * (STORE_ORDERS_ENDPOINT) e lê o andamento da entrega; o vendedor atualiza
100
+ * status e rastreio.
101
+ */
102
+ export const getStoreOrdersModule = (options: IStoreOrdersModuleOptions = {}): IModule => ({
103
+ id: "storeOrdersModule",
104
+ title: tr("Pedidos da loja", "Store orders", "Pedidos de la tienda"),
105
+ icon: "truck",
106
+ components: [getStoreOrderList(), getStoreOrderForm(options)],
107
+ });
@@ -10,8 +10,38 @@ const FEATURE_LABELS: Record<TStoreFeature, ReturnType<typeof tr>> = {
10
10
  installments: tr("Anunciar parcelas sem juros", "Show interest-free installments", "Anunciar cuotas sin interés"),
11
11
  favorites: tr("Favoritos", "Favorites", "Favoritos"),
12
12
  blog: tr("Blog", "Blog", "Blog"),
13
+ shipping: tr("Cobrar frete por faixa de CEP", "Charge shipping by ZIP code range", "Cobrar envío por rango de código postal"),
13
14
  };
14
15
 
16
+ const shippingElements: IFormElement[] = [
17
+ {
18
+ type: "input",
19
+ name: "originZipCode",
20
+ dataType: EDataType.TEXT,
21
+ label: tr("CEP de origem", "Origin ZIP code", "Código postal de origen"),
22
+ tooltip: tr("Somente dígitos (ex.: 57035000)", "Digits only (e.g. 57035000)", "Solo dígitos (ej.: 57035000)"),
23
+ validators: ["onlyNumbers"],
24
+ },
25
+ {
26
+ type: "input",
27
+ name: "freeShippingAbove",
28
+ dataType: EDataType.CURRENCY,
29
+ label: tr("Frete grátis acima de", "Free shipping above", "Envío gratis a partir de"),
30
+ },
31
+ {
32
+ type: "array",
33
+ name: "shippingRanges",
34
+ label: tr("Faixas de CEP", "ZIP code ranges", "Rangos de código postal"),
35
+ elements: [
36
+ { type: "input", name: "label", dataType: EDataType.TEXT, label: tr("Nome da faixa", "Range name", "Nombre del rango") },
37
+ { type: "input", name: "zipCodeStart", dataType: EDataType.TEXT, label: tr("CEP inicial", "First ZIP code", "Código postal inicial"), isRequired: true, validators: ["onlyNumbers"] },
38
+ { type: "input", name: "zipCodeEnd", dataType: EDataType.TEXT, label: tr("CEP final", "Last ZIP code", "Código postal final"), isRequired: true, validators: ["onlyNumbers"] },
39
+ { type: "input", name: "price", dataType: EDataType.CURRENCY, label: tr("Valor do frete", "Shipping price", "Precio del envío"), isRequired: true },
40
+ { type: "input", name: "deliveryDays", dataType: EDataType.INTEGER, label: tr("Prazo (dias úteis)", "Delivery time (business days)", "Plazo (días hábiles)"), isRequired: true },
41
+ ],
42
+ },
43
+ ];
44
+
15
45
  const featureDetails = (feature: TStoreFeature): IFormElement[] => {
16
46
  if (feature === "cashDiscount") {
17
47
  return [
@@ -34,6 +64,7 @@ const featureDetails = (feature: TStoreFeature): IFormElement[] => {
34
64
  },
35
65
  ];
36
66
  }
67
+ if (feature === "shipping") return shippingElements;
37
68
  return [];
38
69
  };
39
70
 
@@ -44,6 +44,14 @@
44
44
  "type": "array",
45
45
  "items": { "$ref": "trusted-caller.ref.json" }
46
46
  },
47
+ "referralSources": {
48
+ "type": "array",
49
+ "items": { "$ref": "referral-source-integration.ref.json" }
50
+ },
51
+ "scheduledJobs": {
52
+ "type": "array",
53
+ "items": { "$ref": "scheduled-job.ref.json" }
54
+ },
47
55
  "storage": {
48
56
  "type": "object",
49
57
  "properties": {
@@ -121,6 +129,26 @@
121
129
  "stockOutDefaults": {
122
130
  "type": "object",
123
131
  "additionalProperties": { "type": ["string", "number", "boolean"] }
132
+ },
133
+ "stockInAggregateEndpoint": { "type": "string" },
134
+ "stockOutAggregateEndpoint": { "type": "string" },
135
+ "storeOrdersEndpoint": { "type": "string" },
136
+ "categoriesEndpoint": { "type": "string" },
137
+ "brandsEndpoint": { "type": "string" },
138
+ "productFieldMap": {
139
+ "type": "object",
140
+ "properties": {
141
+ "category": { "type": "string", "minLength": 1 },
142
+ "brand": { "type": "string", "minLength": 1 },
143
+ "tags": { "type": "string", "minLength": 1 },
144
+ "model": { "type": "string", "minLength": 1 },
145
+ "weight": { "type": "string", "minLength": 1 },
146
+ "height": { "type": "string", "minLength": 1 },
147
+ "width": { "type": "string", "minLength": 1 },
148
+ "length": { "type": "string", "minLength": 1 },
149
+ "properties": { "type": "string", "minLength": 1 }
150
+ },
151
+ "additionalProperties": false
124
152
  }
125
153
  },
126
154
  "required": ["paymentGateways", "productsAutocomplete", "stockInEndpoint", "stockOutEndpoint", "productBaseUrl"]
@@ -40,6 +40,37 @@
40
40
  },
41
41
  "description": "Browser origins allowed via CORS. Does not protect against server-to-server calls."
42
42
  },
43
+ "aggregations": {
44
+ "type": "array",
45
+ "description": "Grouped sums exposed at GET <endpoint>/aggregations/<id>, with the contract's access.",
46
+ "items": {
47
+ "type": "object",
48
+ "properties": {
49
+ "id": {
50
+ "type": "string",
51
+ "pattern": "^[a-zA-Z0-9-]+$"
52
+ },
53
+ "groupBy": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ },
57
+ "sum": {
58
+ "type": "array",
59
+ "minItems": 1,
60
+ "items": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ }
64
+ }
65
+ },
66
+ "required": [
67
+ "id",
68
+ "groupBy",
69
+ "sum"
70
+ ],
71
+ "additionalProperties": false
72
+ }
73
+ },
43
74
  "request": {
44
75
  "type": "object",
45
76
  "properties": {
@@ -7,7 +7,7 @@
7
7
  "type": "array",
8
8
  "items": {
9
9
  "type": "string",
10
- "enum": ["whatsappButton", "stockAvailability", "cashDiscount", "installments", "favorites", "blog"]
10
+ "enum": ["whatsappButton", "stockAvailability", "cashDiscount", "installments", "favorites", "blog", "shipping"]
11
11
  },
12
12
  "uniqueItems": true
13
13
  },
@@ -18,6 +18,7 @@
18
18
  "backoffice",
19
19
  "ecommerce",
20
20
  "marketplace",
21
+ "referralCommerce",
21
22
  "landingPage",
22
23
  "socialNetwork",
23
24
  "service",
@@ -202,7 +203,30 @@
202
203
  },
203
204
  "store": {
204
205
  "$ref": "project-store.ref.json"
206
+ },
207
+ "referralCuration": {
208
+ "$ref": "referral-curation.ref.json"
205
209
  }
206
210
  },
207
- "required": ["id", "title", "description", "skeleton"]
211
+ "required": ["id", "title", "description", "skeleton"],
212
+ "if": {
213
+ "properties": { "skeleton": { "const": "referralCommerce" } },
214
+ "required": ["skeleton"]
215
+ },
216
+ "then": {
217
+ "required": ["referralCuration", "backend"],
218
+ "properties": {
219
+ "backend": {
220
+ "type": "array",
221
+ "minItems": 1,
222
+ "items": {
223
+ "type": "object",
224
+ "required": ["referralSources"],
225
+ "properties": {
226
+ "referralSources": { "type": "array", "minItems": 1 }
227
+ }
228
+ }
229
+ }
230
+ }
231
+ }
208
232
  }
@@ -0,0 +1,257 @@
1
+ {
2
+ "$id": "referral-curation.ref.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "properties": {
6
+ "minRatingCount": {
7
+ "type": "integer",
8
+ "minimum": 0
9
+ },
10
+ "minNormalizedRating": {
11
+ "type": "number",
12
+ "minimum": 0,
13
+ "maximum": 1
14
+ },
15
+ "minDiscountFromBaseline": {
16
+ "type": "number",
17
+ "minimum": 0,
18
+ "maximum": 1
19
+ },
20
+ "priceBaseline": {
21
+ "type": "object",
22
+ "properties": {
23
+ "kind": {
24
+ "type": "string",
25
+ "enum": [
26
+ "sourceHistory"
27
+ ]
28
+ },
29
+ "windowDays": {
30
+ "type": "integer",
31
+ "minimum": 1
32
+ },
33
+ "minSnapshots": {
34
+ "type": "integer",
35
+ "minimum": 1
36
+ }
37
+ },
38
+ "required": [
39
+ "kind",
40
+ "windowDays"
41
+ ],
42
+ "additionalProperties": false
43
+ },
44
+ "freeShippingOnly": {
45
+ "type": "boolean"
46
+ },
47
+ "tieBreakers": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string",
51
+ "enum": [
52
+ "fastestDelivery",
53
+ "highestCommission",
54
+ "lowestPrice"
55
+ ]
56
+ },
57
+ "uniqueItems": true
58
+ },
59
+ "search": {
60
+ "type": "object",
61
+ "properties": {
62
+ "keywords": {
63
+ "type": "array",
64
+ "items": {
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "minItems": 1,
69
+ "uniqueItems": true
70
+ },
71
+ "categories": {
72
+ "type": "object",
73
+ "properties": {
74
+ "shopee": {
75
+ "type": "array",
76
+ "items": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ },
80
+ "minItems": 1,
81
+ "uniqueItems": true
82
+ },
83
+ "amazon": {
84
+ "type": "array",
85
+ "items": {
86
+ "type": "string",
87
+ "minLength": 1
88
+ },
89
+ "minItems": 1,
90
+ "uniqueItems": true
91
+ },
92
+ "mercadoLivre": {
93
+ "type": "array",
94
+ "items": {
95
+ "type": "string",
96
+ "minLength": 1
97
+ },
98
+ "minItems": 1,
99
+ "uniqueItems": true
100
+ }
101
+ },
102
+ "additionalProperties": false
103
+ },
104
+ "maxListingsPerQuery": {
105
+ "type": "integer",
106
+ "minimum": 1
107
+ }
108
+ },
109
+ "required": [
110
+ "keywords"
111
+ ],
112
+ "additionalProperties": false
113
+ },
114
+ "missingData": {
115
+ "type": "object",
116
+ "properties": {
117
+ "ratingCount": {
118
+ "type": "string",
119
+ "enum": [
120
+ "reject",
121
+ "skip"
122
+ ]
123
+ },
124
+ "rating": {
125
+ "type": "string",
126
+ "enum": [
127
+ "reject",
128
+ "skip"
129
+ ]
130
+ },
131
+ "freeShipping": {
132
+ "type": "string",
133
+ "enum": [
134
+ "reject",
135
+ "skip"
136
+ ]
137
+ }
138
+ },
139
+ "additionalProperties": false
140
+ },
141
+ "sourceOverrides": {
142
+ "type": "object",
143
+ "properties": {
144
+ "shopee": {
145
+ "type": "object",
146
+ "properties": {
147
+ "missingData": {
148
+ "type": "object",
149
+ "properties": {
150
+ "ratingCount": {
151
+ "type": "string",
152
+ "enum": [
153
+ "reject",
154
+ "skip"
155
+ ]
156
+ },
157
+ "rating": {
158
+ "type": "string",
159
+ "enum": [
160
+ "reject",
161
+ "skip"
162
+ ]
163
+ },
164
+ "freeShipping": {
165
+ "type": "string",
166
+ "enum": [
167
+ "reject",
168
+ "skip"
169
+ ]
170
+ }
171
+ },
172
+ "additionalProperties": false
173
+ }
174
+ },
175
+ "additionalProperties": false
176
+ },
177
+ "amazon": {
178
+ "type": "object",
179
+ "properties": {
180
+ "missingData": {
181
+ "type": "object",
182
+ "properties": {
183
+ "ratingCount": {
184
+ "type": "string",
185
+ "enum": [
186
+ "reject",
187
+ "skip"
188
+ ]
189
+ },
190
+ "rating": {
191
+ "type": "string",
192
+ "enum": [
193
+ "reject",
194
+ "skip"
195
+ ]
196
+ },
197
+ "freeShipping": {
198
+ "type": "string",
199
+ "enum": [
200
+ "reject",
201
+ "skip"
202
+ ]
203
+ }
204
+ },
205
+ "additionalProperties": false
206
+ }
207
+ },
208
+ "additionalProperties": false
209
+ },
210
+ "mercadoLivre": {
211
+ "type": "object",
212
+ "properties": {
213
+ "missingData": {
214
+ "type": "object",
215
+ "properties": {
216
+ "ratingCount": {
217
+ "type": "string",
218
+ "enum": [
219
+ "reject",
220
+ "skip"
221
+ ]
222
+ },
223
+ "rating": {
224
+ "type": "string",
225
+ "enum": [
226
+ "reject",
227
+ "skip"
228
+ ]
229
+ },
230
+ "freeShipping": {
231
+ "type": "string",
232
+ "enum": [
233
+ "reject",
234
+ "skip"
235
+ ]
236
+ }
237
+ },
238
+ "additionalProperties": false
239
+ }
240
+ },
241
+ "additionalProperties": false
242
+ }
243
+ },
244
+ "additionalProperties": false
245
+ }
246
+ },
247
+ "required": [
248
+ "minRatingCount",
249
+ "minNormalizedRating",
250
+ "minDiscountFromBaseline",
251
+ "priceBaseline",
252
+ "freeShippingOnly",
253
+ "tieBreakers",
254
+ "search"
255
+ ],
256
+ "additionalProperties": false
257
+ }
@@ -0,0 +1,143 @@
1
+ {
2
+ "$id": "referral-source-integration.ref.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "oneOf": [
5
+ {
6
+ "type": "object",
7
+ "properties": {
8
+ "source": {
9
+ "const": "shopee"
10
+ },
11
+ "credentials": {
12
+ "type": "object",
13
+ "properties": {
14
+ "appId": {
15
+ "type": "string"
16
+ },
17
+ "secret": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ "required": [
22
+ "appId",
23
+ "secret"
24
+ ],
25
+ "additionalProperties": false
26
+ },
27
+ "affiliateTag": {
28
+ "type": "string",
29
+ "minLength": 1
30
+ },
31
+ "defaultCommissionRate": {
32
+ "type": "number",
33
+ "minimum": 0,
34
+ "maximum": 1
35
+ },
36
+ "defaultDeliveryDays": {
37
+ "type": "integer",
38
+ "minimum": 0
39
+ }
40
+ },
41
+ "required": [
42
+ "source",
43
+ "credentials"
44
+ ],
45
+ "additionalProperties": false
46
+ },
47
+ {
48
+ "type": "object",
49
+ "properties": {
50
+ "source": {
51
+ "const": "amazon"
52
+ },
53
+ "credentials": {
54
+ "type": "object",
55
+ "properties": {
56
+ "credentialId": {
57
+ "type": "string"
58
+ },
59
+ "credentialSecret": {
60
+ "type": "string"
61
+ },
62
+ "version": {
63
+ "type": "string"
64
+ },
65
+ "marketplace": {
66
+ "type": "string"
67
+ }
68
+ },
69
+ "required": [
70
+ "credentialId",
71
+ "credentialSecret"
72
+ ],
73
+ "additionalProperties": false
74
+ },
75
+ "affiliateTag": {
76
+ "type": "string",
77
+ "minLength": 1
78
+ },
79
+ "defaultCommissionRate": {
80
+ "type": "number",
81
+ "minimum": 0,
82
+ "maximum": 1
83
+ },
84
+ "defaultDeliveryDays": {
85
+ "type": "integer",
86
+ "minimum": 0
87
+ }
88
+ },
89
+ "required": [
90
+ "source",
91
+ "credentials",
92
+ "affiliateTag"
93
+ ],
94
+ "additionalProperties": false
95
+ },
96
+ {
97
+ "type": "object",
98
+ "properties": {
99
+ "source": {
100
+ "const": "mercadoLivre"
101
+ },
102
+ "credentials": {
103
+ "type": "object",
104
+ "properties": {
105
+ "clientId": {
106
+ "type": "string"
107
+ },
108
+ "clientSecret": {
109
+ "type": "string"
110
+ },
111
+ "mattTool": {
112
+ "type": "string"
113
+ }
114
+ },
115
+ "required": [
116
+ "clientId",
117
+ "clientSecret"
118
+ ],
119
+ "additionalProperties": false
120
+ },
121
+ "affiliateTag": {
122
+ "type": "string",
123
+ "minLength": 1
124
+ },
125
+ "defaultCommissionRate": {
126
+ "type": "number",
127
+ "minimum": 0,
128
+ "maximum": 1
129
+ },
130
+ "defaultDeliveryDays": {
131
+ "type": "integer",
132
+ "minimum": 0
133
+ }
134
+ },
135
+ "required": [
136
+ "source",
137
+ "credentials",
138
+ "affiliateTag"
139
+ ],
140
+ "additionalProperties": false
141
+ }
142
+ ]
143
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$id": "scheduled-job.ref.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": { "type": "string", "enum": ["referralPriceSnapshot"] },
7
+ "cron": { "type": "string", "minLength": 1 },
8
+ "timezone": { "type": "string" }
9
+ },
10
+ "required": ["id", "cron"],
11
+ "additionalProperties": false
12
+ }
@@ -28,12 +28,30 @@
28
28
  "youtubeUrl": { "type": "string" },
29
29
  "cashDiscountPercent": { "type": "number", "minimum": 0, "maximum": 100 },
30
30
  "maxInstallments": { "type": "integer", "minimum": 0 },
31
+ "originZipCode": { "type": "string", "pattern": "^[0-9]{8}$" },
32
+ "freeShippingAbove": { "type": "number", "minimum": 0 },
33
+ "shippingRanges": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "properties": {
38
+ "label": { "type": "string" },
39
+ "zipCodeStart": { "type": "string", "pattern": "^[0-9]{8}$" },
40
+ "zipCodeEnd": { "type": "string", "pattern": "^[0-9]{8}$" },
41
+ "price": { "type": "number", "minimum": 0 },
42
+ "deliveryDays": { "type": "integer", "minimum": 0 }
43
+ },
44
+ "required": ["zipCodeStart", "zipCodeEnd", "price", "deliveryDays"],
45
+ "additionalProperties": false
46
+ }
47
+ },
31
48
  "whatsappButtonEnabled": { "type": "boolean" },
32
49
  "stockAvailabilityEnabled": { "type": "boolean" },
33
50
  "cashDiscountEnabled": { "type": "boolean" },
34
51
  "installmentsEnabled": { "type": "boolean" },
35
52
  "favoritesEnabled": { "type": "boolean" },
36
- "blogEnabled": { "type": "boolean" }
53
+ "blogEnabled": { "type": "boolean" },
54
+ "shippingEnabled": { "type": "boolean" }
37
55
  },
38
56
  "additionalProperties": false
39
57
  }