@wildo-ai/saas-specifications 1.1.5 → 1.1.6

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.
Files changed (677) hide show
  1. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts +10 -8
  2. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts.map +1 -1
  3. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js +14 -13
  4. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js.map +1 -1
  5. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts +3 -2
  6. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts.map +1 -1
  7. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js +4 -3
  8. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js.map +1 -1
  9. package/dist/esm/_catalogs/schema-org/index.d.ts +31 -15
  10. package/dist/esm/_catalogs/schema-org/index.d.ts.map +1 -1
  11. package/dist/esm/_catalogs/schema-org/index.js +34 -13
  12. package/dist/esm/_catalogs/schema-org/index.js.map +1 -1
  13. package/dist/esm/_catalogs/schema-org/product.catalog-spec.d.ts +2 -2
  14. package/dist/esm/_catalogs/schema-org/product.catalog-spec.js +4 -4
  15. package/dist/esm/_catalogs/schema-org/product.catalog-spec.js.map +1 -1
  16. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts +45 -0
  17. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts.map +1 -0
  18. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js +58 -0
  19. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js.map +1 -0
  20. package/dist/esm/_core/application-specification-family-identity.schemas.d.ts +3 -2
  21. package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
  22. package/dist/esm/_core/application-specification-family-identity.schemas.js +3 -2
  23. package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
  24. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +18 -0
  25. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
  26. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +39 -13
  27. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
  28. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +43 -13
  29. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
  30. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +90 -2
  31. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
  32. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +70 -6
  33. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
  34. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
  35. package/dist/esm/_core/build-plan/build-plan.family-aspects.js +26 -4
  36. package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
  37. package/dist/esm/_core/business-semantics.specifications.schemas.d.ts +14 -0
  38. package/dist/esm/_core/business-semantics.specifications.schemas.d.ts.map +1 -1
  39. package/dist/esm/_core/business-semantics.specifications.schemas.js.map +1 -1
  40. package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts.map +1 -1
  41. package/dist/esm/_core/capability-composition/capability-composition-validation.js +1 -0
  42. package/dist/esm/_core/capability-composition/capability-composition-validation.js.map +1 -1
  43. package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +21 -2
  44. package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
  45. package/dist/esm/_core/capability-composition/capability-composition.schemas.js +20 -1
  46. package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
  47. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +11 -32
  48. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
  49. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +70 -3
  50. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
  51. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts +142 -17
  52. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
  53. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +285 -30
  54. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
  55. package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +183 -18
  56. package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
  57. package/dist/esm/_core/compliance-documents/processor-register.schemas.js +165 -18
  58. package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
  59. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts +139 -0
  60. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts.map +1 -0
  61. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js +172 -0
  62. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js.map +1 -0
  63. package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts +306 -0
  64. package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts.map +1 -0
  65. package/dist/esm/_core/compliance-documents/recipient-population.schemas.js +502 -0
  66. package/dist/esm/_core/compliance-documents/recipient-population.schemas.js.map +1 -0
  67. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts +107 -0
  68. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts.map +1 -0
  69. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js +118 -0
  70. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js.map +1 -0
  71. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts +56 -0
  72. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts.map +1 -0
  73. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js +100 -0
  74. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js.map +1 -0
  75. package/dist/esm/_core/composite-view-specification.schemas.js +8 -1
  76. package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
  77. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -2
  78. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -1
  79. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +3 -2
  80. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -1
  81. package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts +16 -3
  82. package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
  83. package/dist/esm/_core/experience-plan/experience-plan.schemas.js +70 -5
  84. package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
  85. package/dist/esm/_core/family-aspects.schemas.d.ts +10 -0
  86. package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -1
  87. package/dist/esm/_core/family-aspects.schemas.js.map +1 -1
  88. package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +2 -2
  89. package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts +1 -0
  90. package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts.map +1 -1
  91. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts +16 -0
  92. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts.map +1 -1
  93. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js +8 -0
  94. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js.map +1 -1
  95. package/dist/esm/_core/index.d.ts +3 -0
  96. package/dist/esm/_core/index.d.ts.map +1 -1
  97. package/dist/esm/_core/index.js +3 -0
  98. package/dist/esm/_core/index.js.map +1 -1
  99. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +5 -0
  100. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
  101. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +3 -1
  102. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
  103. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
  104. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +12 -2
  105. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
  106. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +30 -2
  107. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
  108. package/dist/esm/_core/integration-plan/integration-plan.schemas.js +32 -2
  109. package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
  110. package/dist/esm/_core/market/feature-benefit.schemas.js +2 -2
  111. package/dist/esm/_core/market/feature-benefit.schemas.js.map +1 -1
  112. package/dist/esm/_core/market/market-alternative.schemas.js +2 -2
  113. package/dist/esm/_core/market/market-alternative.schemas.js.map +1 -1
  114. package/dist/esm/_core/market/market-buying-journey.schemas.js +2 -2
  115. package/dist/esm/_core/market/market-buying-journey.schemas.js.map +1 -1
  116. package/dist/esm/_core/market/market-category.schemas.js +2 -2
  117. package/dist/esm/_core/market/market-category.schemas.js.map +1 -1
  118. package/dist/esm/_core/market/market-channel.schemas.js +2 -2
  119. package/dist/esm/_core/market/market-channel.schemas.js.map +1 -1
  120. package/dist/esm/_core/market/market-gain.schemas.js +2 -2
  121. package/dist/esm/_core/market/market-gain.schemas.js.map +1 -1
  122. package/dist/esm/_core/market/market-icp.schemas.d.ts.map +1 -1
  123. package/dist/esm/_core/market/market-icp.schemas.js +2 -2
  124. package/dist/esm/_core/market/market-icp.schemas.js.map +1 -1
  125. package/dist/esm/_core/market/market-job.schemas.js +2 -2
  126. package/dist/esm/_core/market/market-job.schemas.js.map +1 -1
  127. package/dist/esm/_core/market/market-message-template.schemas.js +2 -2
  128. package/dist/esm/_core/market/market-message-template.schemas.js.map +1 -1
  129. package/dist/esm/_core/market/market-objection.schemas.js +2 -2
  130. package/dist/esm/_core/market/market-objection.schemas.js.map +1 -1
  131. package/dist/esm/_core/market/market-pain.schemas.js +2 -2
  132. package/dist/esm/_core/market/market-pain.schemas.js.map +1 -1
  133. package/dist/esm/_core/market/market-persona.schemas.d.ts.map +1 -1
  134. package/dist/esm/_core/market/market-persona.schemas.js +2 -2
  135. package/dist/esm/_core/market/market-persona.schemas.js.map +1 -1
  136. package/dist/esm/_core/market/market-positioning.schemas.js +2 -2
  137. package/dist/esm/_core/market/market-positioning.schemas.js.map +1 -1
  138. package/dist/esm/_core/market/market-proof.schemas.js +2 -2
  139. package/dist/esm/_core/market/market-proof.schemas.js.map +1 -1
  140. package/dist/esm/_core/market/market-references.schemas.d.ts +6 -0
  141. package/dist/esm/_core/market/market-references.schemas.d.ts.map +1 -1
  142. package/dist/esm/_core/market/market-references.schemas.js +6 -0
  143. package/dist/esm/_core/market/market-references.schemas.js.map +1 -1
  144. package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +4 -4
  145. package/dist/esm/_core/market/market-tone-of-voice.schemas.js +2 -2
  146. package/dist/esm/_core/market/market-tone-of-voice.schemas.js.map +1 -1
  147. package/dist/esm/_core/market/market-trigger.schemas.js +2 -2
  148. package/dist/esm/_core/market/market-trigger.schemas.js.map +1 -1
  149. package/dist/esm/_core/market/market.family-aspects.js +1 -1
  150. package/dist/esm/_core/market/market.family-aspects.js.map +1 -1
  151. package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
  152. package/dist/esm/_core/placement-plan/placement-plan.schemas.js +6 -1
  153. package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
  154. package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts +1 -0
  155. package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts.map +1 -1
  156. package/dist/esm/_core/requirements/functional-requirement.schemas.js +8 -0
  157. package/dist/esm/_core/requirements/functional-requirement.schemas.js.map +1 -1
  158. package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts +1 -0
  159. package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts.map +1 -1
  160. package/dist/esm/_core/resource-specification.schemas.d.ts +86 -28
  161. package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
  162. package/dist/esm/_core/resource-specification.schemas.js +110 -24
  163. package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
  164. package/dist/esm/_core/utils/retention-clock-field-specs.d.ts +13 -0
  165. package/dist/esm/_core/utils/retention-clock-field-specs.d.ts.map +1 -0
  166. package/dist/esm/_core/utils/retention-clock-field-specs.js +26 -0
  167. package/dist/esm/_core/utils/retention-clock-field-specs.js.map +1 -0
  168. package/dist/esm/_core/website-plan/website-plan.schemas.d.ts +31 -6
  169. package/dist/esm/_core/website-plan/website-plan.schemas.d.ts.map +1 -1
  170. package/dist/esm/_core/website-plan/website-plan.schemas.js +35 -6
  171. package/dist/esm/_core/website-plan/website-plan.schemas.js.map +1 -1
  172. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +142 -3
  173. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts.map +1 -1
  174. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js +148 -14
  175. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js.map +1 -1
  176. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +70 -10
  177. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
  178. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +98 -11
  179. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
  180. package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts +215 -0
  181. package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -0
  182. package/dist/esm/application-creation/application-line.application-creation.schemas.js +253 -0
  183. package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -0
  184. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts +39 -0
  185. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts.map +1 -0
  186. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js +37 -0
  187. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js.map +1 -0
  188. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +5 -49
  189. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
  190. package/dist/esm/application-creation/journey.application-creation.schemas.js +25 -60
  191. package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
  192. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts +28 -0
  193. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts.map +1 -0
  194. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js +32 -0
  195. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js.map +1 -0
  196. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +26 -6
  197. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
  198. package/dist/esm/application-creation/playbooks.application-creation.schemas.js +28 -1
  199. package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
  200. package/dist/esm/application-creation.exports.d.ts +7 -0
  201. package/dist/esm/application-creation.exports.d.ts.map +1 -1
  202. package/dist/esm/application-creation.exports.js +7 -0
  203. package/dist/esm/application-creation.exports.js.map +1 -1
  204. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts +1 -1
  205. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js +1 -1
  206. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js.map +1 -1
  207. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +24 -1
  208. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
  209. package/dist/esm/assurance/assurance-authority-basis.definitions.js +75 -5
  210. package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
  211. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +6 -0
  212. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
  213. package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts +11 -0
  214. package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts.map +1 -1
  215. package/dist/esm/assurance/assurance-document-blueprint-selection.js +22 -3
  216. package/dist/esm/assurance/assurance-document-blueprint-selection.js.map +1 -1
  217. package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
  218. package/dist/esm/assurance/assurance-document-system.definitions.js +39 -6
  219. package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
  220. package/dist/esm/assurance/assurance-document-system.schemas.d.ts +11 -0
  221. package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
  222. package/dist/esm/assurance/assurance-document-system.schemas.js +19 -0
  223. package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
  224. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
  225. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +295 -31
  226. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
  227. package/dist/esm/assurance/assurance-foundation.schemas.d.ts +7 -0
  228. package/dist/esm/assurance/assurance-foundation.schemas.d.ts.map +1 -1
  229. package/dist/esm/assurance/assurance-foundation.schemas.js +7 -0
  230. package/dist/esm/assurance/assurance-foundation.schemas.js.map +1 -1
  231. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
  232. package/dist/esm/assurance/assurance-objective-catalog.definitions.js +17 -0
  233. package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
  234. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +5 -1
  235. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -1
  236. package/dist/esm/assurance/assurance-program-generation.schemas.js +6 -3
  237. package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -1
  238. package/dist/esm/assurance/assurance-program.family-aspects.js +1 -1
  239. package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -1
  240. package/dist/esm/assurance/assurance-program.schemas.d.ts +232 -3
  241. package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
  242. package/dist/esm/assurance/assurance-program.schemas.js +107 -14
  243. package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
  244. package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
  245. package/dist/esm/assurance/assurance-source-registry.definitions.js +77 -1
  246. package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
  247. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
  248. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +23 -1
  249. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
  250. package/dist/esm/assurance/governed-document-release.d.ts +7 -0
  251. package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
  252. package/dist/esm/assurance/governed-document-release.js +11 -2
  253. package/dist/esm/assurance/governed-document-release.js.map +1 -1
  254. package/dist/esm/companion-exports.d.ts +6 -5
  255. package/dist/esm/companion-exports.d.ts.map +1 -1
  256. package/dist/esm/companion-exports.js.map +1 -1
  257. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts +1 -0
  258. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
  259. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +35 -33
  260. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
  261. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
  262. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +6 -2
  263. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
  264. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
  265. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +13 -12
  266. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
  267. package/dist/esm/engine/applications/resources/application-versions.resource.specification.d.ts.map +1 -1
  268. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +26 -2
  269. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
  270. package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
  271. package/dist/esm/engine/applications/resources/applications.resource.specification.js +4 -4
  272. package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
  273. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
  274. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +11 -9
  275. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
  276. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +2 -2
  277. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
  278. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts +1 -0
  279. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
  280. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +45 -32
  281. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
  282. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts +1 -23
  283. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
  284. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +185 -31
  285. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
  286. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts +2 -1
  287. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts.map +1 -1
  288. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js +29 -7
  289. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js.map +1 -1
  290. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
  291. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +7 -1
  292. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
  293. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
  294. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +9 -6
  295. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
  296. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts +1 -0
  297. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
  298. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +11 -7
  299. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
  300. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
  301. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +18 -16
  302. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
  303. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
  304. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +9 -11
  305. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
  306. package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
  307. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +238 -219
  308. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
  309. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts +0 -24
  310. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
  311. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +76 -16
  312. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
  313. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts +2 -1
  314. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts.map +1 -1
  315. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js +28 -6
  316. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js.map +1 -1
  317. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
  318. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +29 -11
  319. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
  320. package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js +1 -1
  321. package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js.map +1 -1
  322. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +2 -0
  323. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
  324. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +13 -12
  325. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
  326. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +5 -5
  327. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
  328. package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
  329. package/dist/esm/engine/billing/resources/prices.resource.specification.js +12 -9
  330. package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
  331. package/dist/esm/engine/billing/resources/products.resource.specification.d.ts +7 -4
  332. package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
  333. package/dist/esm/engine/billing/resources/products.resource.specification.js +36 -16
  334. package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
  335. package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
  336. package/dist/esm/engine/billing/resources/promotions.resource.specification.js +13 -10
  337. package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
  338. package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts +13 -8
  339. package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
  340. package/dist/esm/engine/billing/resources/referrals.resource.specification.js +54 -20
  341. package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
  342. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +30 -4
  343. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
  344. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +85 -25
  345. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
  346. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -2
  347. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
  348. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts +15 -2
  349. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts.map +1 -1
  350. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js +45 -10
  351. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js.map +1 -1
  352. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts +15 -2
  353. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
  354. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +52 -12
  355. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
  356. package/dist/esm/engine/compliance/resources/index.d.ts +1 -0
  357. package/dist/esm/engine/compliance/resources/index.d.ts.map +1 -1
  358. package/dist/esm/engine/compliance/resources/index.js +1 -0
  359. package/dist/esm/engine/compliance/resources/index.js.map +1 -1
  360. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts +39 -0
  361. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts.map +1 -0
  362. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js +325 -0
  363. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js.map +1 -0
  364. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts +23 -0
  365. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts.map +1 -0
  366. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js +197 -0
  367. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js.map +1 -0
  368. package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
  369. package/dist/esm/engine/engine-resource-specifications.registry.js +59 -0
  370. package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
  371. package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
  372. package/dist/esm/engine/errors/error-messages.specification.js +69 -0
  373. package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
  374. package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts +5 -5
  375. package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
  376. package/dist/esm/engine/features/resources/application-features.resource.specification.js +9 -10
  377. package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
  378. package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts +5 -5
  379. package/dist/esm/engine/features/resources/organization-features.resource.specification.js +11 -11
  380. package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
  381. package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +5 -5
  382. package/dist/esm/engine/features/resources/user-features.resource.specification.js +3 -3
  383. package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
  384. package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
  385. package/dist/esm/engine/files/resources/files.resource.specification.js +7 -8
  386. package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
  387. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
  388. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +16 -4
  389. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
  390. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +1 -1
  391. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
  392. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts +11 -0
  393. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts.map +1 -0
  394. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js +382 -0
  395. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js.map +1 -0
  396. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +139 -1
  397. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
  398. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +150 -4
  399. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
  400. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
  401. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +9 -1
  402. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
  403. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts +3 -0
  404. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts.map +1 -0
  405. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js +162 -0
  406. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js.map +1 -0
  407. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts +3 -0
  408. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts.map +1 -0
  409. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js +158 -0
  410. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js.map +1 -0
  411. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts +2 -1
  412. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts.map +1 -1
  413. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js +16 -9
  414. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js.map +1 -1
  415. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js +1 -1
  416. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js.map +1 -1
  417. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js +1 -1
  418. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js.map +1 -1
  419. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts +5 -0
  420. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts.map +1 -0
  421. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js +79 -0
  422. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js.map +1 -0
  423. package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js +1 -1
  424. package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js.map +1 -1
  425. package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.d.ts.map +1 -1
  426. package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js +3 -1
  427. package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js.map +1 -1
  428. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts.map +1 -1
  429. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js +5 -4
  430. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js.map +1 -1
  431. package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js +1 -1
  432. package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js.map +1 -1
  433. package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js +1 -1
  434. package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js.map +1 -1
  435. package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js +2 -2
  436. package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js.map +1 -1
  437. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js +1 -1
  438. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js.map +1 -1
  439. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js +2 -2
  440. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js.map +1 -1
  441. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js +1 -1
  442. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js.map +1 -1
  443. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js +1 -1
  444. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js.map +1 -1
  445. package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.d.ts.map +1 -1
  446. package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js +1 -1
  447. package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js.map +1 -1
  448. package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js +2 -2
  449. package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js.map +1 -1
  450. package/dist/esm/engine/frontend-components/index.d.ts +1 -0
  451. package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
  452. package/dist/esm/engine/frontend-components/index.js +3 -0
  453. package/dist/esm/engine/frontend-components/index.js.map +1 -1
  454. package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js +1 -1
  455. package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js.map +1 -1
  456. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js +1 -1
  457. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js.map +1 -1
  458. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js +1 -1
  459. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js.map +1 -1
  460. package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.d.ts.map +1 -1
  461. package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js +9 -4
  462. package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js.map +1 -1
  463. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +4 -4
  464. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
  465. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
  466. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +34 -0
  467. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
  468. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
  469. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +26 -0
  470. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
  471. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -2
  472. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
  473. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts +9 -0
  474. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts.map +1 -0
  475. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js +122 -0
  476. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js.map +1 -0
  477. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts +9 -0
  478. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts.map +1 -0
  479. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js +152 -0
  480. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js.map +1 -0
  481. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts +10 -0
  482. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts.map +1 -0
  483. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js +94 -0
  484. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js.map +1 -0
  485. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts +10 -0
  486. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts.map +1 -0
  487. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js +64 -0
  488. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js.map +1 -0
  489. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts +4 -1
  490. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts.map +1 -1
  491. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js +20 -16
  492. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js.map +1 -1
  493. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts +9 -0
  494. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts.map +1 -0
  495. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js +200 -0
  496. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js.map +1 -0
  497. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
  498. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +19 -6
  499. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
  500. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts +9 -0
  501. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts.map +1 -0
  502. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js +97 -0
  503. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js.map +1 -0
  504. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +8 -0
  505. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
  506. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +2 -2
  507. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
  508. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts +8 -8
  509. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +1 -1
  510. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
  511. package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js +4 -4
  512. package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js.map +1 -1
  513. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts +9 -0
  514. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts.map +1 -0
  515. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js +153 -0
  516. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js.map +1 -0
  517. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts +81 -0
  518. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts.map +1 -0
  519. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js +437 -0
  520. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js.map +1 -0
  521. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts +112 -0
  522. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts.map +1 -0
  523. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js +287 -0
  524. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js.map +1 -0
  525. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts +131 -0
  526. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -0
  527. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +594 -0
  528. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -0
  529. package/dist/esm/engine/notifications/resources/index.d.ts +1 -0
  530. package/dist/esm/engine/notifications/resources/index.d.ts.map +1 -1
  531. package/dist/esm/engine/notifications/resources/index.js +1 -0
  532. package/dist/esm/engine/notifications/resources/index.js.map +1 -1
  533. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts +6 -3
  534. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
  535. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +20 -5
  536. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
  537. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
  538. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +12 -2
  539. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
  540. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts +6 -6
  541. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
  542. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +8 -11
  543. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
  544. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts +4 -0
  545. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts.map +1 -0
  546. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js +62 -0
  547. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js.map +1 -0
  548. package/dist/esm/engine/notifications/system-emails/index.d.ts +2 -1
  549. package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
  550. package/dist/esm/engine/notifications/system-emails/index.js +4 -2
  551. package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
  552. package/dist/esm/engine/organizations/resources/index.d.ts +2 -0
  553. package/dist/esm/engine/organizations/resources/index.d.ts.map +1 -1
  554. package/dist/esm/engine/organizations/resources/index.js +2 -0
  555. package/dist/esm/engine/organizations/resources/index.js.map +1 -1
  556. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +3 -0
  557. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
  558. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +40 -12
  559. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
  560. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -2
  561. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
  562. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -2
  563. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
  564. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts +0 -1
  565. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
  566. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +4 -6
  567. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
  568. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
  569. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +7 -3
  570. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
  571. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map +1 -1
  572. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +15 -8
  573. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
  574. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts +3 -1
  575. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
  576. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +36 -21
  577. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
  578. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts +38 -0
  579. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts.map +1 -0
  580. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js +152 -0
  581. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js.map +1 -0
  582. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts +106 -0
  583. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts.map +1 -0
  584. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js +417 -0
  585. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js.map +1 -0
  586. package/dist/esm/engine/providers/apple.provider.specification.js +1 -1
  587. package/dist/esm/engine/providers/apple.provider.specification.js.map +1 -1
  588. package/dist/esm/engine/providers/github.provider.specification.js +1 -1
  589. package/dist/esm/engine/providers/github.provider.specification.js.map +1 -1
  590. package/dist/esm/engine/providers/google-places.provider.specification.d.ts +6 -0
  591. package/dist/esm/engine/providers/google-places.provider.specification.d.ts.map +1 -0
  592. package/dist/esm/engine/providers/google-places.provider.specification.js +44 -0
  593. package/dist/esm/engine/providers/google-places.provider.specification.js.map +1 -0
  594. package/dist/esm/engine/providers/google.provider.specification.js +1 -1
  595. package/dist/esm/engine/providers/google.provider.specification.js.map +1 -1
  596. package/dist/esm/engine/providers/index.d.ts +2 -0
  597. package/dist/esm/engine/providers/index.d.ts.map +1 -1
  598. package/dist/esm/engine/providers/index.js +5 -1
  599. package/dist/esm/engine/providers/index.js.map +1 -1
  600. package/dist/esm/engine/providers/microsoft.provider.specification.d.ts.map +1 -1
  601. package/dist/esm/engine/providers/microsoft.provider.specification.js +10 -6
  602. package/dist/esm/engine/providers/microsoft.provider.specification.js.map +1 -1
  603. package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts +6 -0
  604. package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts.map +1 -0
  605. package/dist/esm/engine/providers/recaptcha.provider.specification.js +38 -0
  606. package/dist/esm/engine/providers/recaptcha.provider.specification.js.map +1 -0
  607. package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -1
  608. package/dist/esm/engine/providers/resend.provider.specification.js +3 -1
  609. package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -1
  610. package/dist/esm/engine/providers/stripe.provider.specification.d.ts.map +1 -1
  611. package/dist/esm/engine/providers/stripe.provider.specification.js +3 -2
  612. package/dist/esm/engine/providers/stripe.provider.specification.js.map +1 -1
  613. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts +2 -0
  614. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts.map +1 -0
  615. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js +21 -0
  616. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js.map +1 -0
  617. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts +2 -0
  618. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts.map +1 -0
  619. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js +21 -0
  620. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js.map +1 -0
  621. package/dist/esm/engine/roles/index.d.ts +13 -5
  622. package/dist/esm/engine/roles/index.d.ts.map +1 -1
  623. package/dist/esm/engine/roles/index.js +19 -6
  624. package/dist/esm/engine/roles/index.js.map +1 -1
  625. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts +2 -0
  626. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts.map +1 -0
  627. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js +21 -0
  628. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js.map +1 -0
  629. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts +7 -0
  630. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts.map +1 -0
  631. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js +72 -0
  632. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js.map +1 -0
  633. package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts +2 -0
  634. package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts.map +1 -0
  635. package/dist/esm/engine/roles/org-service-provider.role.specification.js +22 -0
  636. package/dist/esm/engine/roles/org-service-provider.role.specification.js.map +1 -0
  637. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -2
  638. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
  639. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +3 -3
  640. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
  641. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts +1 -1
  642. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts.map +1 -1
  643. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js +3 -6
  644. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js.map +1 -1
  645. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -2
  646. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
  647. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +2 -2
  648. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
  649. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +0 -4
  650. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
  651. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +0 -3
  652. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
  653. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +0 -3
  654. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
  655. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +7 -7
  656. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
  657. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +5 -5
  658. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
  659. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +0 -3
  660. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
  661. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +11 -18
  662. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
  663. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +6 -6
  664. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
  665. package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
  666. package/dist/esm/engine/users/resources/user-self.resource.specification.js +5 -1
  667. package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
  668. package/dist/esm/engine/users/resources/users.resource.specification.d.ts +8 -5
  669. package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
  670. package/dist/esm/engine/users/resources/users.resource.specification.js +49 -16
  671. package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
  672. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
  673. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +29 -10
  674. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
  675. package/dist/tsconfig.build.tsbuildinfo +1 -1
  676. package/package.json +8 -8
  677. package/dist/assurance/external-framework-mapping.json +0 -1228
@@ -1,7 +1,7 @@
1
1
  import { productsAdminResourceUIBehavior as productsAdminSource, productsMainResourceUIBehavior as productsMainSource, } from '@wildo-ai/presets-components';
2
2
  import { LabelAudience } from '@wildo-ai/presets-components-models';
3
3
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
4
- import { CoreResourceOperation as Op, ProductType, ProductSchema, ResourcePrimaryScope, TaxDisplayMode, productsResourceConfiguration_InitializationFactory as productsFactory, } from '@wildo-ai/saas-models';
4
+ import { CoreResourceOperation as Op, ProductType, ProductSchema, ResourcePrimaryScope, TaxDisplayMode, ProductPriceDisclosure, ProductAvailability, productsResourceConfiguration_InitializationFactory as productsFactory, } from '@wildo-ai/saas-models';
5
5
  import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
6
6
  import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
7
7
  const productsMainUI = productsMainSource;
@@ -45,10 +45,10 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
45
45
  },
46
46
  }),
47
47
  grantedFeatures: schemaShape.grantedFeatures.arraySpec({
48
- meaning: 'Feature keys this product enables when the subscription line is active — merged by billing feature sync with ADDON rules.',
48
+ meaning: 'Feature keys this product enables when the subscription line is active — merged by billing feature sync with ADDON rules. Each is shown as its word (`billing_features.<id>.label`), the identifier while the word is missing.',
49
49
  elementMeaning: 'One string feature id from the app feature catalog.',
50
50
  }),
51
- grantedLimits: schemaShape.grantedLimits.objectSpec({ meaning: 'Named limit grants (`LimitGrantSchema`) and aggregation mode for entitlements in runtime checks.' }),
51
+ grantedLimits: schemaShape.grantedLimits.objectSpec({ meaning: 'Named limit grants (`LimitGrantSchema`) and aggregation mode for entitlements in runtime checks. Each key is shown as its word (`billing_limits.<id>.label`), and `-1` (`FEATURES_UNLIMITED`) as unlimited.' }),
52
52
  planTier: schemaShape.planTier.stringSpec({ meaning: 'For PLAN: human tier label; used with `planTierOrder` for upgrade/downgrade heuristics.' }),
53
53
  planTierOrder: schemaShape.planTierOrder.numberSpec({ meaning: 'Numeric order for plan comparisons within the app.' }),
54
54
  requiredPlanTiers: schemaShape.requiredPlanTiers.arraySpec({ meaning: 'For ADDON: plan tier keys that must be active before this add-on is purchasable.', elementMeaning: 'One `planTier` string id.' }),
@@ -60,11 +60,29 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
60
60
  [TaxDisplayMode.INCLUSIVE]: { meaning: 'Amounts include tax in displayed totals.' },
61
61
  },
62
62
  }),
63
- purchaseConfig: schemaShape.purchaseConfig.objectSpec({ meaning: 'Per-purchase options for one-time and credit products (max quantity, credits per unit, target credit pool key).' }),
63
+ purchaseConfig: schemaShape.purchaseConfig.objectSpec({ meaning: 'Per-purchase options for one-time and credit products: the most units one checkout may buy (checkout refuses more), credits per unit, and the credit pool a purchase feeds. Ignored for subscription products.' }),
64
64
  behaviorPolicy: schemaShape.behaviorPolicy.objectSpec({ meaning: 'Nested policy for trial, proration, cancellation windows, and metering hooks. An immediate cancellation default requires immediate cancellation to be allowed; contradictory cancellation policies are rejected during validation.' }),
65
65
  providerProductId: schemaShape.providerProductId.stringSpec({ meaning: 'Provider-side id after first sync — backend-only in many API shapes.' }),
66
66
  isPublic: schemaShape.isPublic.booleanSpec({ meaning: 'Visibility for self-serve catalog vs org-admin-only offer matrix.' }),
67
- isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the product is offered to new checkouts; historical subs may still reference inactive records.' }),
67
+ isActive: schemaShape.isActive.booleanSpec({ meaning: 'Retirement: `false` once the product left the code catalogue — no longer sold or offered; historical subs may still reference inactive records. Not the same as `availability`, which announces a product not yet on sale.' }),
68
+ isRecommended: schemaShape.isRecommended.booleanSpec({ meaning: 'The plan the application recommends on its pricing surfaces (the in-app pricing table and the public website), emphasised there. A recommendation from the catalogue, never a measured popularity claim.' }),
69
+ priceDisclosure: schemaShape.priceDisclosure.enumSpec({
70
+ meaning: 'How much of the price a pricing surface may state. Display only: it never gates a purchase, so a salesperson-issued checkout link for an on-request plan still works.',
71
+ enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductPriceDisclosure', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },
72
+ values: {
73
+ [ProductPriceDisclosure.LISTED]: { meaning: 'The listed prices are the whole offer; surfaces state them and structured data may publish them.' },
74
+ [ProductPriceDisclosure.STARTING_AT]: { meaning: 'The listed price is a floor (part of the total is quoted); surfaces state it as a starting price and structured data does not publish it as the price.' },
75
+ [ProductPriceDisclosure.ON_REQUEST]: { meaning: 'No price is stated; the offer is quoted on request.' },
76
+ },
77
+ }),
78
+ availability: schemaShape.availability.enumSpec({
79
+ meaning: 'Whether the product can be bought today. An upcoming product is listed on pricing surfaces and refused at every acquisition door (checkout, plan change, add-on purchase).',
80
+ enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductAvailability', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },
81
+ values: {
82
+ [ProductAvailability.AVAILABLE]: { meaning: 'On sale.' },
83
+ [ProductAvailability.UPCOMING]: { meaning: 'Announced, not yet on sale; acquisition answers 409 `BILLING_PRODUCT_NOT_YET_AVAILABLE`.' },
84
+ },
85
+ }),
68
86
  sortOrder: schemaShape.sortOrder.numberSpec({ meaning: 'Display ordering in pickers and marketing surfaces.' }),
69
87
  metadata: schemaShape.metadata.objectSpec({ meaning: 'Opaque key/value for provider sync or A/B test tags — not PII by contract.' }),
70
88
  createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),
@@ -111,9 +129,9 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
111
129
  { code: HttpResponseStatusCode.CREATED_201, meaning: 'The product record was materialized from its `ProductDefinition` and is returned with its server-assigned id.' },
112
130
  ],
113
131
  errorScenarios: [
114
- { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The product payload fails schema validation (e.g. missing `key` or unknown `type`).', errorCode: 'VALIDATION_FAILED' },
132
+ { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The product payload fails schema validation (e.g. missing `key` or unknown `type`).' },
115
133
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not the platform/admin/repository path permitted to seed catalog rows.' },
116
- { code: HttpResponseStatusCode.CONFLICT_409, when: 'A product with the same globally-unique `key` already exists in this application database.', errorCode: 'PRODUCT_KEY_EXISTS' },
134
+ { code: HttpResponseStatusCode.CONFLICT_409, when: 'A product with the same globally-unique `key` already exists in this application database.' },
117
135
  ],
118
136
  idempotent: false,
119
137
  examples: [
@@ -147,7 +165,7 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
147
165
  { code: HttpResponseStatusCode.OK_200, meaning: 'The product record was patched and the updated catalog DTO is returned.' },
148
166
  ],
149
167
  errorScenarios: [
150
- { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },
168
+ { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },
151
169
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the product catalog.' },
152
170
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },
153
171
  ],
@@ -159,16 +177,18 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
159
177
  ],
160
178
  }), { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION });
161
179
  export const productsResourceSpecification = resourceSpecificationFromFrontendConfiguration(mergeResourceFrontendConfigurations(resourceFrontendConfiguration(productsMainUI), resourceFrontendConfiguration(productsAdminUI)), productsBase, () => ({
162
- label: { purpose: 'Preset `getFrontendResourceLabel` uses `key` for short catalog rows.' },
180
+ label: { purpose: 'Preset `getFrontendResourceLabel` names a product by the application\'s word for it (`billing_products.<key>.name`, planned from the product catalogue) as the page title and card title, and by its `key` only while that word is missing. The key stays on the page as a copyable row. `instanceLabelSections` declares the billing section so every surface that names a product loads the words (#1851).' },
163
181
  layout: {
164
- purpose: 'Five section refs: `overview` (key, type, plan tier, feature grants), `tax` (tax display mode), `purchase` (credit pack config), `behavior` (policy), `visibility` (public/active/metadata).',
165
- displayPurpose: 'Main preset has no addressable `views` — merged admin adds LIST+READ for catalog browse (all non-addressable in billing presets).',
182
+ purpose: 'Four section refs: `overview` (key, tier, ordering, scopes, feature and limit grants, tax display mode), `purchase` (one-time / credit-pack purchase config), `behavior` (policy), `visibility` (public, sort order, the pricing-surface facts — recommended, price disclosure, availability — and metadata; `isActive` on the form).',
183
+ headerPurpose: 'The READ identity line: the product\'s name as the title, then its `type` badge and its availability (Active / Inactive) as a word. None of the three repeats in the body.',
184
+ displayPurpose: 'Settings rows, no section descriptions. `overview` opens with the copyable `key` (the header shows the product\'s name) and holds the commercial terms; `purchase` and `behavior` render only when the product carries them; empty optional rows hide. The product\'s prices follow as the composed PRICES tab. Main preset has no addressable `views` — merged admin adds LIST+READ+UPDATE for the Plans & pricing destination.',
185
+ summaryPurpose: 'A catalogue card: the product\'s name as the title, its `key`, the type badge, the plan tier (labelled — a bare tier read as a second name), and the exceptions only when they apply: inactive, not public, upcoming (not yet on sale), or recommended. Recommendation and upcoming are summary fields for that reason — a card renders from the summary projection, so a fact it shows must be in it.',
186
+ editPurpose: 'Only what can change: the `isNotEditable` key, type and grants are read on the record, not shown as disabled inputs. The first term takes the focus; `purchase` keeps its description because it applies to some product types only.',
166
187
  sections: {
167
- overview: { purpose: 'Identity and tier information for a product in one card.', whenToUse: 'Admin or pricing tables.', textSlots: { title: { purpose: 'Product header.' }, description: { purpose: 'Feature/limit details follow `grantedFeatures` and `grantedLimits` in schema — not repeated field-by-field here.' } } },
168
- tax: { purpose: 'How tax is displayed on invoices for this product line.', whenToUse: 'When jurisdiction matters for checkout copy.', textSlots: { title: { purpose: 'Tax block.' }, description: { purpose: 'Does not set legal tax rates — that is the provider in production.' } } },
169
- purchase: { purpose: 'Per-unit, credit, and max-quantity options for one-time and credit products.', whenToUse: 'CREDIT_PACK and one-time flows.', textSlots: { title: { purpose: 'Purchase settings.' }, description: { purpose: 'Align with `ProductBehaviorPolicy` in implementation for when fields apply.' } } },
170
- behavior: { purpose: 'Policies for metering, trials, and add-on compatibility.', whenToUse: 'When tuning product-behavior for engineering.', textSlots: { title: { purpose: 'Behavior block.' }, description: { purpose: 'Backend enforcement lives in services — UI is a structured editor over the zod object.' } } },
171
- visibility: { purpose: 'Public, active, and free-form `metadata` for integrations.', whenToUse: 'Gating a product in marketing vs admin-only.', textSlots: { title: { purpose: 'Visibility block.' }, description: { purpose: 'Turning `isActive` off does not cancel existing subscriptions in typical billing semantics.' } } },
188
+ overview: { purpose: 'The commercial terms of a product: tier and tier order, required tiers, target scopes, what it grants, and how tax is displayed.', whenToUse: 'Every product.', textSlots: { title: { purpose: 'Product terms block.' } } },
189
+ purchase: { purpose: 'Per-purchase quantity cap and credit settings for one-time and credit-pack products.', whenToUse: 'CREDIT_PACK and one-time flows.', textSlots: { title: { purpose: 'Purchase settings.' }, description: { purpose: 'Edit prompt: these settings apply only to one-time and credit-pack products.' } } },
190
+ behavior: { purpose: 'Policies for metering, trials, and add-on compatibility.', whenToUse: 'When tuning product behaviour.', textSlots: { title: { purpose: 'Behavior block; on read it is the policy\'s only label.' } } },
191
+ visibility: { purpose: 'Whether the product is listed in self-serve catalogues, its sort order, how pricing surfaces present it (recommended, price disclosure, availability), free-form `metadata`; the form also carries `isActive`.', whenToUse: 'Gating a product in marketing vs admin-only.', textSlots: { title: { purpose: 'Visibility block.' } } },
172
192
  },
173
193
  },
174
194
  views: {
@@ -1 +1 @@
1
- {"version":3,"file":"products.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,IAAI,mBAAmB,EACtD,8BAA8B,IAAI,kBAAkB,GACrD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,mDAAmD,IAAI,eAAe,GACvE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,MAAM,cAAc,GAAG,kBAAqE,CAAC;AAC7F,MAAM,eAAe,GAAG,mBAAsE,CAAC;AAE/F,MAAM,YAAY,GAAG,qBAAqB,CACxC,eAAe,EACf,aAAa,EACb,CAAC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import {\n productsAdminResourceUIBehavior as productsAdminSource,\n productsMainResourceUIBehavior as productsMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ProductType,\n ProductSchema,\n ResourcePrimaryScope,\n TaxDisplayMode,\n productsResourceConfiguration_InitializationFactory as productsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof productsFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst productsMainUI = productsMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst productsAdminUI = productsAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst productsBase = resourceSpecification<undefined, Core, Main>(\n productsFactory,\n ProductSchema,\n ({ schemaShape }) => ({\n purpose: 'One product in the application\\'s catalog: the plan, add-on or credit pack an organization can subscribe to, with the features and limits it grants. The catalog is defined by the application, not edited per organization.',\n businessRole: 'Anchor for prices, promotions, and subscription line items; drives plan tiers, add-ons, and feature/limit grants.',\n lifecycleRole: 'Lazy DB row created from definitions; provider ids filled on first use; bulk sync in admin; edits are deployment-driven, not ad-hoc CRUD in end-user UI.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ProductSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'productsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRODUCTS' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'productsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'productsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Product document id in the app catalog collection.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n key: schemaShape.key.stringSpec({ meaning: 'Stable key that maps 1:1 to `ProductDefinition.key` in the code catalog — unique globally per app database.', importance: FieldSemanticImportance.PRIMARY }),\n type: schemaShape.type.enumSpec({\n meaning: 'Commercial shape of the product (PLAN, ADDON, METERED, etc.).',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ProductType.PLAN]: { meaning: 'Primary subscription entitlements and tiering.' },\n [ProductType.ADDON]: { meaning: 'Optional capacity or feature on top of a plan.' },\n [ProductType.METERED]: { meaning: 'Usage-billed add-on; ties to `UsageRecord` records.' },\n [ProductType.ONE_TIME]: { meaning: 'One-shot purchase, not a recurring subscription state machine.' },\n [ProductType.CREDIT_PACK]: { meaning: 'Prepaid credits to a `CreditPool` balance.' },\n [ProductType.ITEM]: { meaning: 'Generic one-off line item in catalog semantics.' },\n },\n }),\n targetScopes: schemaShape.targetScopes.arraySpec({\n meaning: 'Which `ResourcePrimaryScope` values may attach subscriptions to this product (org vs user vs app).',\n elementMeaning: 'One primary scope discriminator the product is sold into.',\n elementType: {\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ResourcePrimaryScope', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n }),\n grantedFeatures: schemaShape.grantedFeatures.arraySpec({\n meaning: 'Feature keys this product enables when the subscription line is active — merged by billing feature sync with ADDON rules.',\n elementMeaning: 'One string feature id from the app feature catalog.',\n }),\n grantedLimits: schemaShape.grantedLimits.objectSpec({ meaning: 'Named limit grants (`LimitGrantSchema`) and aggregation mode for entitlements in runtime checks.' }),\n planTier: schemaShape.planTier.stringSpec({ meaning: 'For PLAN: human tier label; used with `planTierOrder` for upgrade/downgrade heuristics.' }),\n planTierOrder: schemaShape.planTierOrder.numberSpec({ meaning: 'Numeric order for plan comparisons within the app.' }),\n requiredPlanTiers: schemaShape.requiredPlanTiers.arraySpec({ meaning: 'For ADDON: plan tier keys that must be active before this add-on is purchasable.', elementMeaning: 'One `planTier` string id.' }),\n taxDisplayMode: schemaShape.taxDisplayMode.enumSpec({\n meaning: 'Whether displayed prices for this product are tax-exclusive or tax-inclusive, overriding the global default when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'Amounts shown before tax; tax added at checkout.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'Amounts include tax in displayed totals.' },\n },\n }),\n purchaseConfig: schemaShape.purchaseConfig.objectSpec({ meaning: 'Per-purchase options for one-time and credit products (max quantity, credits per unit, target credit pool key).' }),\n behaviorPolicy: schemaShape.behaviorPolicy.objectSpec({ meaning: 'Nested policy for trial, proration, cancellation windows, and metering hooks. An immediate cancellation default requires immediate cancellation to be allowed; contradictory cancellation policies are rejected during validation.' }),\n providerProductId: schemaShape.providerProductId.stringSpec({ meaning: 'Provider-side id after first sync — backend-only in many API shapes.' }),\n isPublic: schemaShape.isPublic.booleanSpec({ meaning: 'Visibility for self-serve catalog vs org-admin-only offer matrix.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the product is offered to new checkouts; historical subs may still reference inactive records.' }),\n sortOrder: schemaShape.sortOrder.numberSpec({ meaning: 'Display ordering in pickers and marketing surfaces.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Opaque key/value for provider sync or A/B test tags — not PII by contract.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Record update time for syncs.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one catalog row (features, keys, and limits) for admin and in-app gating code.',\n outcome: 'Full product + behavior policy in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product catalog record was found and its full DTO (features, limits, behavior policy) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse the catalog in admin and tooling.',\n outcome: 'Paginated products for the application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of catalog products for the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `key` / `type` per factory searchable fields in repository variant.',\n outcome: 'Filtered list for typeahead in admin UIs.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of products matching the `key` / `type` search query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to search the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Internal service-pipeline lazy insert (not HTTP-exposed) of the first DB row for a `ProductDefinition` on demand.',\n outcome: 'Seeded `key` and immutable bits from the definition in services.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The product record was materialized from its `ProductDefinition` and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The product payload fails schema validation (e.g. missing `key` or unknown `type`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not the platform/admin/repository path permitted to seed catalog rows.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A product with the same globally-unique `key` already exists in this application database.', errorCode: 'PRODUCT_KEY_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Materialize a plan product from its definition',\n request: {\n key: 'plan_pro',\n type: ProductType.PLAN,\n targetScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n grantedFeatures: ['advanced_reporting'],\n planTier: 'pro',\n planTierOrder: 20,\n isPublic: true,\n isActive: true,\n },\n response: {\n _id: 'prod_01HX2…',\n key: 'plan_pro',\n type: ProductType.PLAN,\n planTier: 'pro',\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Sync metadata, activation flags, or provider ids; not end-user ad-hoc edits in production discipline.',\n outcome: 'Patched product row per admin workflow.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product record was patched and the updated catalog DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the product catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Code definitions remain the conceptual source of truth — treat DB as materialized state for the billing engine, not a CMS.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const productsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(productsMainUI), resourceFrontendConfiguration(productsAdminUI)),\n productsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses `key` for short catalog rows.' },\n layout: {\n purpose: 'Five section refs: `overview` (key, type, plan tier, feature grants), `tax` (tax display mode), `purchase` (credit pack config), `behavior` (policy), `visibility` (public/active/metadata).',\n displayPurpose: 'Main preset has no addressable `views` — merged admin adds LIST+READ for catalog browse (all non-addressable in billing presets).',\n sections: {\n overview: { purpose: 'Identity and tier information for a product in one card.', whenToUse: 'Admin or pricing tables.', textSlots: { title: { purpose: 'Product header.' }, description: { purpose: 'Feature/limit details follow `grantedFeatures` and `grantedLimits` in schema — not repeated field-by-field here.' } } },\n tax: { purpose: 'How tax is displayed on invoices for this product line.', whenToUse: 'When jurisdiction matters for checkout copy.', textSlots: { title: { purpose: 'Tax block.' }, description: { purpose: 'Does not set legal tax rates — that is the provider in production.' } } },\n purchase: { purpose: 'Per-unit, credit, and max-quantity options for one-time and credit products.', whenToUse: 'CREDIT_PACK and one-time flows.', textSlots: { title: { purpose: 'Purchase settings.' }, description: { purpose: 'Align with `ProductBehaviorPolicy` in implementation for when fields apply.' } } },\n behavior: { purpose: 'Policies for metering, trials, and add-on compatibility.', whenToUse: 'When tuning product-behavior for engineering.', textSlots: { title: { purpose: 'Behavior block.' }, description: { purpose: 'Backend enforcement lives in services — UI is a structured editor over the zod object.' } } },\n visibility: { purpose: 'Public, active, and free-form `metadata` for integrations.', whenToUse: 'Gating a product in marketing vs admin-only.', textSlots: { title: { purpose: 'Visibility block.' }, description: { purpose: 'Turning `isActive` off does not cancel existing subscriptions in typical billing semantics.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin exposes LIST in `views` as non-addressable; included for overlay truthfulness.', whenToUse: 'App operator catalog screens when wired.' },\n [Op.READ]: { purpose: 'Merged admin exposes READ in `views` as non-addressable.', whenToUse: 'Drill into one product in admin UIs when wired.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"products.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,IAAI,mBAAmB,EACtD,8BAA8B,IAAI,kBAAkB,GACrD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,mDAAmD,IAAI,eAAe,GACvE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,MAAM,cAAc,GAAG,kBAAqE,CAAC;AAC7F,MAAM,eAAe,GAAG,mBAAsE,CAAC;AAE/F,MAAM,YAAY,GAAG,qBAAqB,CACxC,eAAe,EACf,aAAa,EACb,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,8NAA8N;IACvO,YAAY,EAAE,mHAAmH;IACjI,aAAa,EAAE,0JAA0J;IACzK,QAAQ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AE,0DAA0D,EAAE,SAAS,EAAE,gCAAgC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,yDAAyD,EAAE,EAAE,EAAE;YAC5N,UAAU,EAAE,EAAE,OAAO,EAAE,gNAAgN,EAAE,SAAS,EAAE,8CAA8C,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,EAAE;SAC7V;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,6FAA6F,EAAE,SAAS,EAAE,0CAA0C,EAAE;QAC5K,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,iDAAiD,EAAE;KACjJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n productsAdminResourceUIBehavior as productsAdminSource,\n productsMainResourceUIBehavior as productsMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ProductType,\n ProductSchema,\n ResourcePrimaryScope,\n TaxDisplayMode,\n ProductPriceDisclosure,\n ProductAvailability,\n productsResourceConfiguration_InitializationFactory as productsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof productsFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst productsMainUI = productsMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst productsAdminUI = productsAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst productsBase = resourceSpecification<undefined, Core, Main>(\n productsFactory,\n ProductSchema,\n ({ schemaShape }) => ({\n purpose: 'One product in the application\\'s catalog: the plan, add-on or credit pack an organization can subscribe to, with the features and limits it grants. The catalog is defined by the application, not edited per organization.',\n businessRole: 'Anchor for prices, promotions, and subscription line items; drives plan tiers, add-ons, and feature/limit grants.',\n lifecycleRole: 'Lazy DB row created from definitions; provider ids filled on first use; bulk sync in admin; edits are deployment-driven, not ad-hoc CRUD in end-user UI.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ProductSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'productsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRODUCTS' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'productsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'productsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Product document id in the app catalog collection.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n key: schemaShape.key.stringSpec({ meaning: 'Stable key that maps 1:1 to `ProductDefinition.key` in the code catalog — unique globally per app database.', importance: FieldSemanticImportance.PRIMARY }),\n type: schemaShape.type.enumSpec({\n meaning: 'Commercial shape of the product (PLAN, ADDON, METERED, etc.).',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ProductType.PLAN]: { meaning: 'Primary subscription entitlements and tiering.' },\n [ProductType.ADDON]: { meaning: 'Optional capacity or feature on top of a plan.' },\n [ProductType.METERED]: { meaning: 'Usage-billed add-on; ties to `UsageRecord` records.' },\n [ProductType.ONE_TIME]: { meaning: 'One-shot purchase, not a recurring subscription state machine.' },\n [ProductType.CREDIT_PACK]: { meaning: 'Prepaid credits to a `CreditPool` balance.' },\n [ProductType.ITEM]: { meaning: 'Generic one-off line item in catalog semantics.' },\n },\n }),\n targetScopes: schemaShape.targetScopes.arraySpec({\n meaning: 'Which `ResourcePrimaryScope` values may attach subscriptions to this product (org vs user vs app).',\n elementMeaning: 'One primary scope discriminator the product is sold into.',\n elementType: {\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ResourcePrimaryScope', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n }),\n grantedFeatures: schemaShape.grantedFeatures.arraySpec({\n meaning: 'Feature keys this product enables when the subscription line is active — merged by billing feature sync with ADDON rules. Each is shown as its word (`billing_features.<id>.label`), the identifier while the word is missing.',\n elementMeaning: 'One string feature id from the app feature catalog.',\n }),\n grantedLimits: schemaShape.grantedLimits.objectSpec({ meaning: 'Named limit grants (`LimitGrantSchema`) and aggregation mode for entitlements in runtime checks. Each key is shown as its word (`billing_limits.<id>.label`), and `-1` (`FEATURES_UNLIMITED`) as unlimited.' }),\n planTier: schemaShape.planTier.stringSpec({ meaning: 'For PLAN: human tier label; used with `planTierOrder` for upgrade/downgrade heuristics.' }),\n planTierOrder: schemaShape.planTierOrder.numberSpec({ meaning: 'Numeric order for plan comparisons within the app.' }),\n requiredPlanTiers: schemaShape.requiredPlanTiers.arraySpec({ meaning: 'For ADDON: plan tier keys that must be active before this add-on is purchasable.', elementMeaning: 'One `planTier` string id.' }),\n taxDisplayMode: schemaShape.taxDisplayMode.enumSpec({\n meaning: 'Whether displayed prices for this product are tax-exclusive or tax-inclusive, overriding the global default when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'Amounts shown before tax; tax added at checkout.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'Amounts include tax in displayed totals.' },\n },\n }),\n purchaseConfig: schemaShape.purchaseConfig.objectSpec({ meaning: 'Per-purchase options for one-time and credit products: the most units one checkout may buy (checkout refuses more), credits per unit, and the credit pool a purchase feeds. Ignored for subscription products.' }),\n behaviorPolicy: schemaShape.behaviorPolicy.objectSpec({ meaning: 'Nested policy for trial, proration, cancellation windows, and metering hooks. An immediate cancellation default requires immediate cancellation to be allowed; contradictory cancellation policies are rejected during validation.' }),\n providerProductId: schemaShape.providerProductId.stringSpec({ meaning: 'Provider-side id after first sync — backend-only in many API shapes.' }),\n isPublic: schemaShape.isPublic.booleanSpec({ meaning: 'Visibility for self-serve catalog vs org-admin-only offer matrix.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Retirement: `false` once the product left the code catalogue — no longer sold or offered; historical subs may still reference inactive records. Not the same as `availability`, which announces a product not yet on sale.' }),\n isRecommended: schemaShape.isRecommended.booleanSpec({ meaning: 'The plan the application recommends on its pricing surfaces (the in-app pricing table and the public website), emphasised there. A recommendation from the catalogue, never a measured popularity claim.' }),\n priceDisclosure: schemaShape.priceDisclosure.enumSpec({\n meaning: 'How much of the price a pricing surface may state. Display only: it never gates a purchase, so a salesperson-issued checkout link for an on-request plan still works.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductPriceDisclosure', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ProductPriceDisclosure.LISTED]: { meaning: 'The listed prices are the whole offer; surfaces state them and structured data may publish them.' },\n [ProductPriceDisclosure.STARTING_AT]: { meaning: 'The listed price is a floor (part of the total is quoted); surfaces state it as a starting price and structured data does not publish it as the price.' },\n [ProductPriceDisclosure.ON_REQUEST]: { meaning: 'No price is stated; the offer is quoted on request.' },\n },\n }),\n availability: schemaShape.availability.enumSpec({\n meaning: 'Whether the product can be bought today. An upcoming product is listed on pricing surfaces and refused at every acquisition door (checkout, plan change, add-on purchase).',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductAvailability', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ProductAvailability.AVAILABLE]: { meaning: 'On sale.' },\n [ProductAvailability.UPCOMING]: { meaning: 'Announced, not yet on sale; acquisition answers 409 `BILLING_PRODUCT_NOT_YET_AVAILABLE`.' },\n },\n }),\n sortOrder: schemaShape.sortOrder.numberSpec({ meaning: 'Display ordering in pickers and marketing surfaces.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Opaque key/value for provider sync or A/B test tags — not PII by contract.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Record update time for syncs.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one catalog row (features, keys, and limits) for admin and in-app gating code.',\n outcome: 'Full product + behavior policy in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product catalog record was found and its full DTO (features, limits, behavior policy) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse the catalog in admin and tooling.',\n outcome: 'Paginated products for the application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of catalog products for the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `key` / `type` per factory searchable fields in repository variant.',\n outcome: 'Filtered list for typeahead in admin UIs.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of products matching the `key` / `type` search query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to search the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Internal service-pipeline lazy insert (not HTTP-exposed) of the first DB row for a `ProductDefinition` on demand.',\n outcome: 'Seeded `key` and immutable bits from the definition in services.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The product record was materialized from its `ProductDefinition` and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The product payload fails schema validation (e.g. missing `key` or unknown `type`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not the platform/admin/repository path permitted to seed catalog rows.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A product with the same globally-unique `key` already exists in this application database.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Materialize a plan product from its definition',\n request: {\n key: 'plan_pro',\n type: ProductType.PLAN,\n targetScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n grantedFeatures: ['advanced_reporting'],\n planTier: 'pro',\n planTierOrder: 20,\n isPublic: true,\n isActive: true,\n },\n response: {\n _id: 'prod_01HX2…',\n key: 'plan_pro',\n type: ProductType.PLAN,\n planTier: 'pro',\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Sync metadata, activation flags, or provider ids; not end-user ad-hoc edits in production discipline.',\n outcome: 'Patched product row per admin workflow.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product record was patched and the updated catalog DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the product catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Code definitions remain the conceptual source of truth — treat DB as materialized state for the billing engine, not a CMS.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const productsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(productsMainUI), resourceFrontendConfiguration(productsAdminUI)),\n productsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` names a product by the application\\'s word for it (`billing_products.<key>.name`, planned from the product catalogue) as the page title and card title, and by its `key` only while that word is missing. The key stays on the page as a copyable row. `instanceLabelSections` declares the billing section so every surface that names a product loads the words (#1851).' },\n layout: {\n purpose: 'Four section refs: `overview` (key, tier, ordering, scopes, feature and limit grants, tax display mode), `purchase` (one-time / credit-pack purchase config), `behavior` (policy), `visibility` (public, sort order, the pricing-surface facts — recommended, price disclosure, availability — and metadata; `isActive` on the form).',\n headerPurpose: 'The READ identity line: the product\\'s name as the title, then its `type` badge and its availability (Active / Inactive) as a word. None of the three repeats in the body.',\n displayPurpose: 'Settings rows, no section descriptions. `overview` opens with the copyable `key` (the header shows the product\\'s name) and holds the commercial terms; `purchase` and `behavior` render only when the product carries them; empty optional rows hide. The product\\'s prices follow as the composed PRICES tab. Main preset has no addressable `views` — merged admin adds LIST+READ+UPDATE for the Plans & pricing destination.',\n summaryPurpose: 'A catalogue card: the product\\'s name as the title, its `key`, the type badge, the plan tier (labelled — a bare tier read as a second name), and the exceptions only when they apply: inactive, not public, upcoming (not yet on sale), or recommended. Recommendation and upcoming are summary fields for that reason — a card renders from the summary projection, so a fact it shows must be in it.',\n editPurpose: 'Only what can change: the `isNotEditable` key, type and grants are read on the record, not shown as disabled inputs. The first term takes the focus; `purchase` keeps its description because it applies to some product types only.',\n sections: {\n overview: { purpose: 'The commercial terms of a product: tier and tier order, required tiers, target scopes, what it grants, and how tax is displayed.', whenToUse: 'Every product.', textSlots: { title: { purpose: 'Product terms block.' } } },\n purchase: { purpose: 'Per-purchase quantity cap and credit settings for one-time and credit-pack products.', whenToUse: 'CREDIT_PACK and one-time flows.', textSlots: { title: { purpose: 'Purchase settings.' }, description: { purpose: 'Edit prompt: these settings apply only to one-time and credit-pack products.' } } },\n behavior: { purpose: 'Policies for metering, trials, and add-on compatibility.', whenToUse: 'When tuning product behaviour.', textSlots: { title: { purpose: 'Behavior block; on read it is the policy\\'s only label.' } } },\n visibility: { purpose: 'Whether the product is listed in self-serve catalogues, its sort order, how pricing surfaces present it (recommended, price disclosure, availability), free-form `metadata`; the form also carries `isActive`.', whenToUse: 'Gating a product in marketing vs admin-only.', textSlots: { title: { purpose: 'Visibility block.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin exposes LIST in `views` as non-addressable; included for overlay truthfulness.', whenToUse: 'App operator catalog screens when wired.' },\n [Op.READ]: { purpose: 'Merged admin exposes READ in `views` as non-addressable.', whenToUse: 'Drill into one product in admin UIs when wired.' },\n },\n }),\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,YAAY,EACZ,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EAGrB,MAAM,uBAAuB,CAAC;AAoN/B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;iCAuB3C,CAAC"}
1
+ {"version":3,"file":"promotions.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,YAAY,EACZ,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EAGrB,MAAM,uBAAuB,CAAC;AAoN/B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;iCA0B3C,CAAC"}
@@ -110,7 +110,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
110
110
  { code: HttpResponseStatusCode.CREATED_201, meaning: 'A promotion record was created and is returned with its server-assigned id.' },
111
111
  ],
112
112
  errorScenarios: [
113
- { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The discount mechanics are inconsistent (e.g. percentage value with `discountType` fixed, or `REPEATING` duration without `durationInMonths`) or the payload otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },
113
+ { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The discount mechanics are inconsistent (e.g. percentage value with `discountType` fixed, or `REPEATING` duration without `durationInMonths`) or the payload otherwise fails schema validation.' },
114
114
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to author promotions.' },
115
115
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'A promotion with the same `code` already exists (codes are the customer-facing checkout key and must be unique).' },
116
116
  ],
@@ -147,7 +147,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
147
147
  { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s limits / validity window / active bit were patched and the updated record is returned.' },
148
148
  ],
149
149
  errorScenarios: [
150
- { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited discount or duration fields are inconsistent, or the patch otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },
150
+ { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited discount or duration fields are inconsistent, or the patch otherwise fails schema validation.' },
151
151
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to edit promotions.' },
152
152
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },
153
153
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'A `code` change collides with another promotion’s existing code.' },
@@ -162,7 +162,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
162
162
  { code: HttpResponseStatusCode.OK_200, meaning: 'The supplied `code` was valid and applicable; the resolved discount object is returned. `timesRedeemed` is NOT advanced — a redemption is counted when the purchase completes.' },
163
163
  ],
164
164
  errorScenarios: [
165
- { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `code` is missing/empty or fails request-DTO validation.', errorCode: 'VALIDATION_FAILED' },
165
+ { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `code` is missing/empty or fails request-DTO validation.' },
166
166
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an org owner nor an org member, so cannot apply promotions in this scope.' },
167
167
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion matches the supplied `code`.' },
168
168
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'The matched promotion is inactive, outside its `validFrom`/`validUntil` window, exhausted (`maxRedemptions` reached), or not applicable to the targeted products.' },
@@ -196,16 +196,19 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
196
196
  ],
197
197
  }), { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION });
198
198
  export const promotionsResourceSpecification = resourceSpecificationFromFrontendConfiguration(mergeResourceFrontendConfigurations(resourceFrontendConfiguration(promotionsMainUI), resourceFrontendConfiguration(promotionsAdminUI)), promotionsBase, () => ({
199
- label: { purpose: 'Preset `getFrontendResourceLabel` uses the promotion `name` for list rows.' },
199
+ label: { purpose: 'Preset `getFrontendResourceLabel` uses the promotion `name` as the page title and card title.' },
200
200
  layout: {
201
201
  purpose: 'Section refs `overview`, `discount`, `duration`, `applicability`, `validity` in billing presets — form and display walk the same order.',
202
- displayPurpose: 'Main bundle exposes `APPLY` and `DEACTIVATE` custom views; merged admin adds LIST+READ for catalog browse (non-addressable).',
202
+ headerPurpose: 'The READ identity line: the promotion `name` as the title, its `type` badge, and whether it still accepts redemptions (Active / Inactive) as a word. None repeats in the body.',
203
+ displayPurpose: 'Settings rows, no section descriptions. `overview` is an unheaded card holding the description and the code; the amount that does not apply to the discount type hides, as does the month count of a non-repeating promotion. The redemption cap, product list and validity bounds keep their empty rows because empty MEANS unlimited / every product / unbounded. Main bundle exposes `APPLY` and `DEACTIVATE`; merged admin adds LIST+READ (non-addressable).',
204
+ summaryPurpose: 'A card: the name, then the promotion type and discount type badges.',
205
+ editPurpose: 'Stacked, authored content: the name is focused, the description is a textarea, and the system-advanced `timesRedeemed` counter is not on the form. `discount` and `duration` keep their descriptions.',
203
206
  sections: {
204
- overview: { purpose: 'Name, description, type, and public `code`.', whenToUse: 'Campaign identification in admin.', textSlots: { title: { purpose: 'Promotion title block.' }, description: { purpose: 'Type drives which provider API is used when syncing.' } } },
205
- discount: { purpose: 'Percent vs fixed amount semantics with the two discount fields.', whenToUse: 'Setting the commercial terms of the deal.', textSlots: { title: { purpose: 'Discount block.' }, description: { purpose: 'Only one of percentage/fixed is meaningful per `discountType` — UI enforces in product.' } } },
206
- duration: { purpose: '`duration` + `durationInMonths` for repeating windows.', whenToUse: 'When promos apply across multiple renewal cycles.', textSlots: { title: { purpose: 'Duration block.' }, description: { purpose: '“Forever” maps to provider “forever coupon” semantics where available.' } } },
207
- applicability: { purpose: 'Which products can consume the promo and redemption caps.', whenToUse: 'Limiting an offer to specific SKUs.', textSlots: { title: { purpose: 'Applicability block.' }, description: { purpose: '`maxRedemptions` is global — not per-user unless extended in policy layers.' } } },
208
- validity: { purpose: '`validFrom`, `validUntil`, `isActive`, and `metadata` for ops and analytics.', whenToUse: 'Sunsetting and seasonal windows.', textSlots: { title: { purpose: 'Validity block.' }, description: { purpose: 'Past `validUntil` should reject `APPLY` at API even if `isActive` is true until a job flips it.' } } },
207
+ overview: { purpose: 'Name, description, type, and public `code` on the form; on read the description and code, unheaded, under a header that carries the rest.', whenToUse: 'Campaign identification in admin.', textSlots: { title: { purpose: 'Promotion details block (edit form).' } } },
208
+ discount: { purpose: 'Percent vs fixed amount semantics with the two discount fields.', whenToUse: 'Setting the commercial terms of the deal.', textSlots: { title: { purpose: 'Discount block.' }, description: { purpose: 'Edit prompt: fill the amount that matches the discount type — a percentage or a fixed amount.' } } },
209
+ duration: { purpose: '`duration` + `durationInMonths` for repeating windows.', whenToUse: 'When promos apply across multiple renewal cycles.', textSlots: { title: { purpose: 'Duration block.' }, description: { purpose: 'Edit prompt: a repeating promotion needs the number of months it repeats for.' } } },
210
+ applicability: { purpose: 'Which products can consume the promo, the redemption cap, and (on read) how many times it was redeemed.', whenToUse: 'Limiting an offer to specific SKUs.', textSlots: { title: { purpose: 'Applicability block.' } } },
211
+ validity: { purpose: '`validFrom`, `validUntil` and `metadata`; `isActive` on the form (on read it is in the header).', whenToUse: 'Sunsetting and seasonal windows.', textSlots: { title: { purpose: 'Validity block.' } } },
209
212
  },
210
213
  },
211
214
  views: {
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,IAAI,qBAAqB,EAC1D,gCAAgC,IAAI,oBAAoB,GACzD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB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aAAa,EAAE,EAAE,OAAO,EAAE,2DAA2D,EAAE,SAAS,EAAE,qCAAqC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,6EAA6E,EAAE,EAAE,EAAE;YAC7S,QAAQ,EAAE,EAAE,OAAO,EAAE,8EAA8E,EAAE,SAAS,EAAE,kCAAkC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,iGAAiG,EAAE,EAAE,EAAE;SACxU;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qEAAqE,EAAE,SAAS,EAAE,qDAAqD,EAAE;QAC/J,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,+DAA+D,EAAE,SAAS,EAAE,kCAAkC,EAAE;QACtI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,sMAAsM,EAAE,SAAS,EAAE,oCAAoC,EAAE;QAClS,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,qGAAqG,EAAE,SAAS,EAAE,gDAAgD,EAAE;KACnN;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n promotionsAdminResourceUIBehavior as promotionsAdminSource,\n promotionsMainResourceUIBehavior as promotionsMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n DiscountType,\n PromotionType,\n PromotionDuration,\n PromotionSchema,\n Promotion_Operations,\n ResourcePrimaryScope,\n promotionsResourceConfiguration_InitializationFactory as promotionsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof promotionsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst promotionsMainUI = promotionsMainSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\nconst promotionsAdminUI = promotionsAdminSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst promotionsBase = resourceSpecification<Custom, Core, Main>(\n promotionsFactory,\n PromotionSchema,\n ({ schemaShape }) => ({\n purpose: 'Promotional instrument (coupon, promotion code, referral program, deal) with discount mechanics, validity window, and redemption counters — synced to the provider where applicable.',\n businessRole: 'Feeds checkout `promotionCode` validation and subscription discount objects; distinct from `REFERRALS` relationship rows.',\n lifecycleRole: 'Authored by operators; `APPLY` validates at purchase; `DEACTIVATE` ends new redemptions while historical subs may retain benefits per policy.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'promotionsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PROMOTIONS' },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'Promotion_Operations', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Promotion document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n name: schemaShape.name.stringSpec({ meaning: 'Human label in admin and support tools.', importance: FieldSemanticImportance.PRIMARY }),\n description: schemaShape.description.stringSpec({ meaning: 'Longer explanation of the offer and legal/restriction copy when needed.' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Kind of promotion surface in catalog and checkout.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionType.COUPON]: { meaning: 'Checkout coupon code style.' },\n [PromotionType.PROMOTION_CODE]: { meaning: 'Provider-style promotion code.' },\n [PromotionType.REFERRAL]: { meaning: 'Referral-driven automatic benefit (cross-link to referral program when present).' },\n [PromotionType.DEAL]: { meaning: 'Negotiated or campaign deal object with custom rules.' },\n },\n }),\n code: schemaShape.code.stringSpec({ meaning: 'The string customers or APIs pass at checkout when applicable.' }),\n discountType: schemaShape.discountType.enumSpec({\n meaning: 'Whether the benefit is percentage, fixed money, or free trial extension per schema rules.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'DiscountType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [DiscountType.PERCENTAGE]: { meaning: 'Percent off list or subtotal.' },\n [DiscountType.FIXED_AMOUNT]: { meaning: 'Flat money off (currency in provider sync).' },\n },\n }),\n discountPercentage: schemaShape.discountPercentage.numberSpec({ meaning: 'Percent off when `discountType` is percentage.' }),\n discountFixedAmount: schemaShape.discountFixedAmount.numberSpec({ meaning: 'Money off when `discountType` is fixed amount in provider currency.' }),\n duration: schemaShape.duration.enumSpec({\n meaning: 'How long the discount applies to a subscription once redeemed.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionDuration', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionDuration.ONCE]: { meaning: 'First invoice only.' },\n [PromotionDuration.REPEATING]: { meaning: 'Repeats for N months when `durationInMonths` is set.' },\n [PromotionDuration.FOREVER]: { meaning: 'Applies for the life of the subscription while active.' },\n },\n }),\n durationInMonths: schemaShape.durationInMonths.numberSpec({ meaning: 'Repeat window for `REPEATING` duration mode.' }),\n applicableProducts: schemaShape.applicableProducts.arraySpec({ meaning: 'Product keys this promo can apply to — empty may mean all catalog per policy.', elementMeaning: 'One product `key` string.' }),\n maxRedemptions: schemaShape.maxRedemptions.numberSpec({ meaning: 'Cap on redemptions across all customers; null may mean unlimited per implementation.' }),\n timesRedeemed: schemaShape.timesRedeemed.numberSpec({ meaning: 'Counter mirrored for admin read of campaign health.' }),\n validFrom: schemaShape.validFrom.dateSpec({ meaning: 'Earliest datetime the code is valid.', temporalRole: 'scheduled' }),\n validUntil: schemaShape.validUntil.dateSpec({ meaning: 'Hard stop for new redemptions.', temporalRole: 'deadline' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Soft switch to stop new uses without deleting the record.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Extra campaign tags for analytics — not user PII.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect one promotion’s terms and counters in admin.',\n outcome: 'Full discount and validity block for editing support.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion was found and its full discount mechanics + validity block + redemption counters are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to read the admin-managed promotion catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse campaigns in admin (merged admin adds non-addressable LIST view).',\n outcome: 'Paginated promotions in application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotion records in the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to browse the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `name` / `code` per factory search config.',\n outcome: 'Filtered list for operators.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotions matching the `name` / `code` query (case-insensitive, max 50 per page).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to search the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Author a new promotion row for an upcoming campaign.',\n outcome: 'New id and code when unique constraints pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A promotion record was created and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The discount mechanics are inconsistent (e.g. percentage value with `discountType` fixed, or `REPEATING` duration without `durationInMonths`) or the payload otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to author promotions.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A promotion with the same `code` already exists (codes are the customer-facing checkout key and must be unique).' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a percentage coupon',\n request: {\n name: 'Summer launch 20%',\n type: PromotionType.COUPON,\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n duration: PromotionDuration.ONCE,\n maxRedemptions: 500,\n },\n response: {\n _id: 'promo_01HX2…',\n name: 'Summer launch 20%',\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n isActive: true,\n timesRedeemed: 0,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Adjust limits, validity, or active bit before or during a campaign.',\n outcome: 'Patched row with provider sync where required.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s limits / validity window / active bit were patched and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited discount or duration fields are inconsistent, or the patch otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to edit promotions.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A `code` change collides with another promotion’s existing code.' },\n ],\n idempotent: true,\n },\n [Promotion_Operations.APPLY]: {\n operationId: Promotion_Operations.APPLY,\n purpose: 'Validate a promotion code a user supplied, and return the discount it resolves to. Records no redemption.',\n outcome: 'Discount object or error for the checkout session.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The supplied `code` was valid and applicable; the resolved discount object is returned. `timesRedeemed` is NOT advanced — a redemption is counted when the purchase completes.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `code` is missing/empty or fails request-DTO validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an org owner nor an org member, so cannot apply promotions in this scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion matches the supplied `code`.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The matched promotion is inactive, outside its `validFrom`/`validUntil` window, exhausted (`maxRedemptions` reached), or not applicable to the targeted products.' },\n ],\n // Side-effect-free: this verb validates and reports, and advances no counter. It used to\n // increment `timesRedeemed`, which counted a redemption when a customer TYPED a code —\n // so a limited campaign was exhausted by window-shoppers, and a customer who then bought\n // was counted twice once completion started counting. The redemption is now counted only\n // by `checkout.session.completed`.\n idempotent: true,\n rateLimitNote: 'Code-application is abuse-sensitive (coupon brute-forcing) — the platform may throttle repeated APPLY attempts per caller/account.',\n },\n [Promotion_Operations.DEACTIVATE]: {\n operationId: Promotion_Operations.DEACTIVATE,\n purpose: 'Disable new redemptions while preserving history for audits.',\n outcome: 'Sets `isActive` false in implementation; still listed in merged `views` for action wiring.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s `isActive` flag is now false; the campaign accepts no new redemptions while history is preserved.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to deactivate a promotion.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n // Convergent state-set: deactivating drives `isActive` to a fixed value, so\n // repeating the request lands the campaign in the same disabled state.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Provider is the settlement system of record — Wildo rows follow provider capabilities for multi-currency and duration semantics.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const promotionsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(promotionsMainUI), resourceFrontendConfiguration(promotionsAdminUI)),\n promotionsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses the promotion `name` for list rows.' },\n layout: {\n purpose: 'Section refs `overview`, `discount`, `duration`, `applicability`, `validity` in billing presets — form and display walk the same order.',\n displayPurpose: 'Main bundle exposes `APPLY` and `DEACTIVATE` custom views; merged admin adds LIST+READ for catalog browse (non-addressable).',\n sections: {\n overview: { purpose: 'Name, description, type, and public `code`.', whenToUse: 'Campaign identification in admin.', textSlots: { title: { purpose: 'Promotion title block.' }, description: { purpose: 'Type drives which provider API is used when syncing.' } } },\n discount: { purpose: 'Percent vs fixed amount semantics with the two discount fields.', whenToUse: 'Setting the commercial terms of the deal.', textSlots: { title: { purpose: 'Discount block.' }, description: { purpose: 'Only one of percentage/fixed is meaningful per `discountType` — UI enforces in product.' } } },\n duration: { purpose: '`duration` + `durationInMonths` for repeating windows.', whenToUse: 'When promos apply across multiple renewal cycles.', textSlots: { title: { purpose: 'Duration block.' }, description: { purpose: '“Forever” maps to provider “forever coupon” semantics where available.' } } },\n applicability: { purpose: 'Which products can consume the promo and redemption caps.', whenToUse: 'Limiting an offer to specific SKUs.', textSlots: { title: { purpose: 'Applicability block.' }, description: { purpose: '`maxRedemptions` is global — not per-user unless extended in policy layers.' } } },\n validity: { purpose: '`validFrom`, `validUntil`, `isActive`, and `metadata` for ops and analytics.', whenToUse: 'Sunsetting and seasonal windows.', textSlots: { title: { purpose: 'Validity block.' }, description: { purpose: 'Past `validUntil` should reject `APPLY` at API even if `isActive` is true until a job flips it.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST (non-addressable) for operator catalog alignment.', whenToUse: 'Super-admin promotion management when routes exist.' },\n [Op.READ]: { purpose: 'Merged admin READ (non-addressable) for drill-down alignment.', whenToUse: 'Inspect one campaign when wired.' },\n [Promotion_Operations.APPLY]: { purpose: 'Code-validation path for checkout integration; non-addressable in merged `views` array but op is present for action buttons. Reports the discount; the redemption is counted at purchase completion.', whenToUse: 'User enters code in purchase flow.' },\n [Promotion_Operations.DEACTIVATE]: { purpose: 'Deactivate path for admin shutoff; present in both main and merged `views` maps as non-addressable.', whenToUse: 'End a campaign early without deleting history.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"promotions.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,IAAI,qBAAqB,EAC1D,gCAAgC,IAAI,oBAAoB,GACzD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,qDAAqD,IAAI,iBAAiB,GAC3E,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAM3E,MAAM,gBAAgB,GAAG,oBAAoE,CAAC;AAC9F,MAAM,iBAAiB,GAAG,qBAAqE,CAAC;AAEhG,MAAM,cAAc,GAAG,qBAAqB,CAC1C,iBAAiB,EACjB,eAAe,EACf,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,sLAAsL;IAC/L,YAAY,EAAE,2HAA2H;IACzI,aAAa,EAAE,+IAA+I;IAC9J,QAAQ,EAAE,aAAa,CAAC,KAAK;IAC7B,SAAS,EAAE,uBAAuB,CAAC,OAAO;IAC1C,YAAY,EAAE;QACZ,UAAU,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,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EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,+FAA+F,EAAE,EAAE,EAAE;YACjU,QAAQ,EAAE,EAAE,OAAO,EAAE,wDAAwD,EAAE,SAAS,EAAE,mDAAmD,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,+EAA+E,EAAE,EAAE,EAAE;YAChT,aAAa,EAAE,EAAE,OAAO,EAAE,yGAAyG,EAAE,SAAS,EAAE,qCAAqC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE;YAClP,QAAQ,EAAE,EAAE,OAAO,EAAE,iGAAiG,EAAE,SAAS,EAAE,kCAAkC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,EAAE;SAC9N;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qEAAqE,EAAE,SAAS,EAAE,qDAAqD,EAAE;QAC/J,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,+DAA+D,EAAE,SAAS,EAAE,kCAAkC,EAAE;QACtI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,sMAAsM,EAAE,SAAS,EAAE,oCAAoC,EAAE;QAClS,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,qGAAqG,EAAE,SAAS,EAAE,gDAAgD,EAAE;KACnN;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n promotionsAdminResourceUIBehavior as promotionsAdminSource,\n promotionsMainResourceUIBehavior as promotionsMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n DiscountType,\n PromotionType,\n PromotionDuration,\n PromotionSchema,\n Promotion_Operations,\n ResourcePrimaryScope,\n promotionsResourceConfiguration_InitializationFactory as promotionsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof promotionsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst promotionsMainUI = promotionsMainSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\nconst promotionsAdminUI = promotionsAdminSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst promotionsBase = resourceSpecification<Custom, Core, Main>(\n promotionsFactory,\n PromotionSchema,\n ({ schemaShape }) => ({\n purpose: 'Promotional instrument (coupon, promotion code, referral program, deal) with discount mechanics, validity window, and redemption counters — synced to the provider where applicable.',\n businessRole: 'Feeds checkout `promotionCode` validation and subscription discount objects; distinct from `REFERRALS` relationship rows.',\n lifecycleRole: 'Authored by operators; `APPLY` validates at purchase; `DEACTIVATE` ends new redemptions while historical subs may retain benefits per policy.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'promotionsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PROMOTIONS' },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'Promotion_Operations', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Promotion document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n name: schemaShape.name.stringSpec({ meaning: 'Human label in admin and support tools.', importance: FieldSemanticImportance.PRIMARY }),\n description: schemaShape.description.stringSpec({ meaning: 'Longer explanation of the offer and legal/restriction copy when needed.' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Kind of promotion surface in catalog and checkout.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionType.COUPON]: { meaning: 'Checkout coupon code style.' },\n [PromotionType.PROMOTION_CODE]: { meaning: 'Provider-style promotion code.' },\n [PromotionType.REFERRAL]: { meaning: 'Referral-driven automatic benefit (cross-link to referral program when present).' },\n [PromotionType.DEAL]: { meaning: 'Negotiated or campaign deal object with custom rules.' },\n },\n }),\n code: schemaShape.code.stringSpec({ meaning: 'The string customers or APIs pass at checkout when applicable.' }),\n discountType: schemaShape.discountType.enumSpec({\n meaning: 'Whether the benefit is percentage, fixed money, or free trial extension per schema rules.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'DiscountType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [DiscountType.PERCENTAGE]: { meaning: 'Percent off list or subtotal.' },\n [DiscountType.FIXED_AMOUNT]: { meaning: 'Flat money off (currency in provider sync).' },\n },\n }),\n discountPercentage: schemaShape.discountPercentage.numberSpec({ meaning: 'Percent off when `discountType` is percentage.' }),\n discountFixedAmount: schemaShape.discountFixedAmount.numberSpec({ meaning: 'Money off when `discountType` is fixed amount in provider currency.' }),\n duration: schemaShape.duration.enumSpec({\n meaning: 'How long the discount applies to a subscription once redeemed.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionDuration', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionDuration.ONCE]: { meaning: 'First invoice only.' },\n [PromotionDuration.REPEATING]: { meaning: 'Repeats for N months when `durationInMonths` is set.' },\n [PromotionDuration.FOREVER]: { meaning: 'Applies for the life of the subscription while active.' },\n },\n }),\n durationInMonths: schemaShape.durationInMonths.numberSpec({ meaning: 'Repeat window for `REPEATING` duration mode.' }),\n applicableProducts: schemaShape.applicableProducts.arraySpec({ meaning: 'Product keys this promo can apply to — empty may mean all catalog per policy.', elementMeaning: 'One product `key` string.' }),\n maxRedemptions: schemaShape.maxRedemptions.numberSpec({ meaning: 'Cap on redemptions across all customers; null may mean unlimited per implementation.' }),\n timesRedeemed: schemaShape.timesRedeemed.numberSpec({ meaning: 'Counter mirrored for admin read of campaign health.' }),\n validFrom: schemaShape.validFrom.dateSpec({ meaning: 'Earliest datetime the code is valid.', temporalRole: 'scheduled' }),\n validUntil: schemaShape.validUntil.dateSpec({ meaning: 'Hard stop for new redemptions.', temporalRole: 'deadline' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Soft switch to stop new uses without deleting the record.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Extra campaign tags for analytics — not user PII.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect one promotion’s terms and counters in admin.',\n outcome: 'Full discount and validity block for editing support.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion was found and its full discount mechanics + validity block + redemption counters are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to read the admin-managed promotion catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse campaigns in admin (merged admin adds non-addressable LIST view).',\n outcome: 'Paginated promotions in application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotion records in the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to browse the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `name` / `code` per factory search config.',\n outcome: 'Filtered list for operators.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotions matching the `name` / `code` query (case-insensitive, max 50 per page).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to search the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Author a new promotion row for an upcoming campaign.',\n outcome: 'New id and code when unique constraints pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A promotion record was created and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The discount mechanics are inconsistent (e.g. percentage value with `discountType` fixed, or `REPEATING` duration without `durationInMonths`) or the payload otherwise fails schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to author promotions.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A promotion with the same `code` already exists (codes are the customer-facing checkout key and must be unique).' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a percentage coupon',\n request: {\n name: 'Summer launch 20%',\n type: PromotionType.COUPON,\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n duration: PromotionDuration.ONCE,\n maxRedemptions: 500,\n },\n response: {\n _id: 'promo_01HX2…',\n name: 'Summer launch 20%',\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n isActive: true,\n timesRedeemed: 0,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Adjust limits, validity, or active bit before or during a campaign.',\n outcome: 'Patched row with provider sync where required.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s limits / validity window / active bit were patched and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited discount or duration fields are inconsistent, or the patch otherwise fails schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to edit promotions.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A `code` change collides with another promotion’s existing code.' },\n ],\n idempotent: true,\n },\n [Promotion_Operations.APPLY]: {\n operationId: Promotion_Operations.APPLY,\n purpose: 'Validate a promotion code a user supplied, and return the discount it resolves to. Records no redemption.',\n outcome: 'Discount object or error for the checkout session.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The supplied `code` was valid and applicable; the resolved discount object is returned. `timesRedeemed` is NOT advanced — a redemption is counted when the purchase completes.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `code` is missing/empty or fails request-DTO validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an org owner nor an org member, so cannot apply promotions in this scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion matches the supplied `code`.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The matched promotion is inactive, outside its `validFrom`/`validUntil` window, exhausted (`maxRedemptions` reached), or not applicable to the targeted products.' },\n ],\n // Side-effect-free: this verb validates and reports, and advances no counter. It used to\n // increment `timesRedeemed`, which counted a redemption when a customer TYPED a code —\n // so a limited campaign was exhausted by window-shoppers, and a customer who then bought\n // was counted twice once completion started counting. The redemption is now counted only\n // by `checkout.session.completed`.\n idempotent: true,\n rateLimitNote: 'Code-application is abuse-sensitive (coupon brute-forcing) — the platform may throttle repeated APPLY attempts per caller/account.',\n },\n [Promotion_Operations.DEACTIVATE]: {\n operationId: Promotion_Operations.DEACTIVATE,\n purpose: 'Disable new redemptions while preserving history for audits.',\n outcome: 'Sets `isActive` false in implementation; still listed in merged `views` for action wiring.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s `isActive` flag is now false; the campaign accepts no new redemptions while history is preserved.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to deactivate a promotion.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n // Convergent state-set: deactivating drives `isActive` to a fixed value, so\n // repeating the request lands the campaign in the same disabled state.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Provider is the settlement system of record — Wildo rows follow provider capabilities for multi-currency and duration semantics.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const promotionsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(promotionsMainUI), resourceFrontendConfiguration(promotionsAdminUI)),\n promotionsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses the promotion `name` as the page title and card title.' },\n layout: {\n purpose: 'Section refs `overview`, `discount`, `duration`, `applicability`, `validity` in billing presets — form and display walk the same order.',\n headerPurpose: 'The READ identity line: the promotion `name` as the title, its `type` badge, and whether it still accepts redemptions (Active / Inactive) as a word. None repeats in the body.',\n displayPurpose: 'Settings rows, no section descriptions. `overview` is an unheaded card holding the description and the code; the amount that does not apply to the discount type hides, as does the month count of a non-repeating promotion. The redemption cap, product list and validity bounds keep their empty rows because empty MEANS unlimited / every product / unbounded. Main bundle exposes `APPLY` and `DEACTIVATE`; merged admin adds LIST+READ (non-addressable).',\n summaryPurpose: 'A card: the name, then the promotion type and discount type badges.',\n editPurpose: 'Stacked, authored content: the name is focused, the description is a textarea, and the system-advanced `timesRedeemed` counter is not on the form. `discount` and `duration` keep their descriptions.',\n sections: {\n overview: { purpose: 'Name, description, type, and public `code` on the form; on read the description and code, unheaded, under a header that carries the rest.', whenToUse: 'Campaign identification in admin.', textSlots: { title: { purpose: 'Promotion details block (edit form).' } } },\n discount: { purpose: 'Percent vs fixed amount semantics with the two discount fields.', whenToUse: 'Setting the commercial terms of the deal.', textSlots: { title: { purpose: 'Discount block.' }, description: { purpose: 'Edit prompt: fill the amount that matches the discount type — a percentage or a fixed amount.' } } },\n duration: { purpose: '`duration` + `durationInMonths` for repeating windows.', whenToUse: 'When promos apply across multiple renewal cycles.', textSlots: { title: { purpose: 'Duration block.' }, description: { purpose: 'Edit prompt: a repeating promotion needs the number of months it repeats for.' } } },\n applicability: { purpose: 'Which products can consume the promo, the redemption cap, and (on read) how many times it was redeemed.', whenToUse: 'Limiting an offer to specific SKUs.', textSlots: { title: { purpose: 'Applicability block.' } } },\n validity: { purpose: '`validFrom`, `validUntil` and `metadata`; `isActive` on the form (on read it is in the header).', whenToUse: 'Sunsetting and seasonal windows.', textSlots: { title: { purpose: 'Validity block.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST (non-addressable) for operator catalog alignment.', whenToUse: 'Super-admin promotion management when routes exist.' },\n [Op.READ]: { purpose: 'Merged admin READ (non-addressable) for drill-down alignment.', whenToUse: 'Inspect one campaign when wired.' },\n [Promotion_Operations.APPLY]: { purpose: 'Code-validation path for checkout integration; non-addressable in merged `views` array but op is present for action buttons. Reports the discount; the redemption is counted at purchase completion.', whenToUse: 'User enters code in purchase flow.' },\n [Promotion_Operations.DEACTIVATE]: { purpose: 'Deactivate path for admin shutoff; present in both main and merged `views` maps as non-addressable.', whenToUse: 'End a campaign early without deleting history.' },\n },\n }),\n);\n"]}
@@ -1,5 +1,5 @@
1
- import { BillingScopeType, CoreResourceOperation as Op, ReferralStatus } from '@wildo-ai/saas-models';
2
- export declare const referralsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
1
+ import { BillingScopeType, CoreResourceOperation as Op, ReferralStatus, Referral_Operations } from '@wildo-ai/saas-models';
2
+ export declare const referralsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof Referral_Operations, Op.READ | Op.UPDATE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
3
3
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
4
4
  referrerBillingAccountId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>;
5
5
  referrerScopeType: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEnum<typeof BillingScopeType>>;
@@ -8,20 +8,25 @@ export declare const referralsResourceSpecification: import("../../../_core").Re
8
8
  referralCode: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>>;
9
9
  status: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEnum<typeof ReferralStatus>>>>;
10
10
  referrerReward: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodObject<{
11
- type: import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").ReferrerRewardType>;
12
- value: import("zod").ZodNumber;
11
+ credits: import("zod").ZodOptional<import("zod").ZodNumber>;
13
12
  creditPoolKey: import("zod").ZodOptional<import("zod").ZodString>;
14
13
  featureKey: import("zod").ZodOptional<import("zod").ZodString>;
15
14
  durationDays: import("zod").ZodOptional<import("zod").ZodNumber>;
16
- commissionPercentage: import("zod").ZodOptional<import("zod").ZodNumber>;
15
+ percentOff: import("zod").ZodOptional<import("zod").ZodNumber>;
16
+ discountDuration: import("zod").ZodOptional<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").PromotionDuration>>;
17
+ discountDurationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
18
+ type: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").ReferrerRewardType>>;
17
19
  }, import("zod/v4/core").$strip>>>;
18
20
  referredReward: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodObject<{
19
- type: import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").ReferredRewardType>;
20
- value: import("zod").ZodNumber;
21
+ trialExtensionDays: import("zod").ZodOptional<import("zod").ZodNumber>;
22
+ credits: import("zod").ZodOptional<import("zod").ZodNumber>;
21
23
  creditPoolKey: import("zod").ZodOptional<import("zod").ZodString>;
22
24
  featureKey: import("zod").ZodOptional<import("zod").ZodString>;
23
25
  durationDays: import("zod").ZodOptional<import("zod").ZodNumber>;
24
- trialExtensionDays: import("zod").ZodOptional<import("zod").ZodNumber>;
26
+ percentOff: import("zod").ZodOptional<import("zod").ZodNumber>;
27
+ discountDuration: import("zod").ZodOptional<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").PromotionDuration>>;
28
+ discountDurationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
29
+ type: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").ReferredRewardType>>;
25
30
  }, import("zod/v4/core").$strip>>>;
26
31
  referrerRewardApplied: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>;
27
32
  referredRewardApplied: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>;
@@ -1 +1 @@
1
- {"version":3,"file":"referrals.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/referrals.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,IAAI,EAAE,EAE3B,cAAc,EAGf,MAAM,uBAAuB,CAAC;AA0J/B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAc1C,CAAC"}
1
+ {"version":3,"file":"referrals.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/referrals.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,IAAI,EAAE,EAG3B,cAAc,EACd,mBAAmB,EAGpB,MAAM,uBAAuB,CAAC;AAyL/B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAkB1C,CAAC"}