shutro-erp 0.2.1 → 0.3.1

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 (273) hide show
  1. package/README.md +74 -67
  2. package/dist/account_portal/.kosh/bindings.d.ts +22 -0
  3. package/dist/account_portal/.kosh/bindings.js +15 -0
  4. package/dist/account_portal/.kosh/schema.d.ts +1380 -0
  5. package/dist/account_portal/index.d.ts +3 -0
  6. package/dist/account_portal/index.js +73 -0
  7. package/dist/account_portal/module.d.ts +5983 -0
  8. package/dist/account_portal/module.js +18 -0
  9. package/dist/accounting/.kosh/bindings.js +1 -1
  10. package/dist/accounting/.kosh/schema.d.ts +172 -9
  11. package/dist/accounting/chart.d.ts +40 -8
  12. package/dist/accounting/chart.js +124 -30
  13. package/dist/accounting/closing.d.ts +6 -1
  14. package/dist/accounting/closing.js +5 -1
  15. package/dist/accounting/demo.js +6 -5
  16. package/dist/accounting/index.d.ts +3 -3
  17. package/dist/accounting/index.js +200 -23
  18. package/dist/accounting/module.d.ts +3326 -1086
  19. package/dist/accounting/module.js +408 -66
  20. package/dist/accounting/payments.d.ts +25 -0
  21. package/dist/accounting/payments.js +96 -4
  22. package/dist/accounting/web/RegisterPayment.d.ts +3 -2
  23. package/dist/accounting/web/RegisterPayment.js +39 -6
  24. package/dist/accounting/web/SettingsPage.js +5 -1
  25. package/dist/accounting/web/messages.js +10 -0
  26. package/dist/assistant/routes.js +1 -1
  27. package/dist/automation/engine.js +1 -1
  28. package/dist/automation/web/messages.js +2 -2
  29. package/dist/cli/apps.d.ts +1 -1
  30. package/dist/cli/apps.js +14 -14
  31. package/dist/cli/bin.js +3 -0
  32. package/dist/cli/index.js +11 -11
  33. package/dist/cli/init.d.ts +1 -1
  34. package/dist/cli/init.js +224 -78
  35. package/dist/cli/launch.d.ts +16 -0
  36. package/dist/cli/launch.js +138 -0
  37. package/dist/cli/project.d.ts +7 -7
  38. package/dist/cli/project.js +25 -25
  39. package/dist/cli/prompt.d.ts +35 -0
  40. package/dist/cli/prompt.js +48 -2
  41. package/dist/cli/templates.d.ts +14 -6
  42. package/dist/cli/templates.js +61 -34
  43. package/dist/cli/tui.d.ts +7 -0
  44. package/dist/cli/tui.js +254 -0
  45. package/dist/cli/ui.d.ts +21 -8
  46. package/dist/cli/ui.js +65 -19
  47. package/dist/contacts/.kosh/bindings.js +1 -1
  48. package/dist/contacts/.kosh/schema.d.ts +33 -1
  49. package/dist/contacts/index.js +24 -1
  50. package/dist/contacts/module.d.ts +42 -0
  51. package/dist/contacts/module.js +3 -1
  52. package/dist/import/convert.d.ts +55 -0
  53. package/dist/import/convert.js +224 -0
  54. package/dist/import/csv.d.ts +28 -0
  55. package/dist/import/csv.js +115 -0
  56. package/dist/import/index.d.ts +33 -0
  57. package/dist/import/index.js +60 -0
  58. package/dist/import/mapping.d.ts +15 -0
  59. package/dist/import/mapping.js +33 -0
  60. package/dist/import/match.d.ts +24 -0
  61. package/dist/import/match.js +60 -0
  62. package/dist/import/models.d.ts +2 -0
  63. package/dist/import/models.js +102 -0
  64. package/dist/import/routes.d.ts +13 -0
  65. package/dist/import/routes.js +392 -0
  66. package/dist/import/run.d.ts +131 -0
  67. package/dist/import/run.js +568 -0
  68. package/dist/import/service.d.ts +153 -0
  69. package/dist/import/service.js +367 -0
  70. package/dist/import/web/ImportButton.d.ts +7 -0
  71. package/dist/import/web/ImportButton.js +31 -0
  72. package/dist/import/web/ImportWizard.d.ts +75 -0
  73. package/dist/import/web/ImportWizard.js +217 -0
  74. package/dist/import/web/index.d.ts +13 -0
  75. package/dist/import/web/index.js +18 -0
  76. package/dist/import/web/messages.d.ts +2 -0
  77. package/dist/import/web/messages.js +139 -0
  78. package/dist/import/worker.d.ts +3 -0
  79. package/dist/import/worker.js +52 -0
  80. package/dist/import/xlsx.d.ts +20 -0
  81. package/dist/import/xlsx.js +192 -0
  82. package/dist/l10n_bd/.kosh/bindings.d.ts +22 -0
  83. package/dist/l10n_bd/.kosh/bindings.js +15 -0
  84. package/dist/l10n_bd/.kosh/schema.d.ts +1311 -0
  85. package/dist/l10n_bd/documents.d.ts +8 -0
  86. package/dist/l10n_bd/documents.js +183 -0
  87. package/dist/l10n_bd/index.d.ts +8 -0
  88. package/dist/l10n_bd/index.js +156 -0
  89. package/dist/l10n_bd/module.d.ts +5705 -0
  90. package/dist/l10n_bd/module.js +163 -0
  91. package/dist/l10n_bd/mushak.d.ts +67 -0
  92. package/dist/l10n_bd/mushak.js +139 -0
  93. package/dist/l10n_bd/routes.d.ts +3 -0
  94. package/dist/l10n_bd/routes.js +205 -0
  95. package/dist/l10n_bd/web/MushakPage.d.ts +7 -0
  96. package/dist/l10n_bd/web/MushakPage.js +53 -0
  97. package/dist/l10n_bd/web/index.d.ts +13 -0
  98. package/dist/l10n_bd/web/index.js +18 -0
  99. package/dist/l10n_bd/web/messages.d.ts +2 -0
  100. package/dist/l10n_bd/web/messages.js +101 -0
  101. package/dist/l10n_in/.kosh/bindings.d.ts +22 -0
  102. package/dist/l10n_in/.kosh/bindings.js +15 -0
  103. package/dist/l10n_in/.kosh/schema.d.ts +1373 -0
  104. package/dist/l10n_in/documents.d.ts +8 -0
  105. package/dist/l10n_in/documents.js +114 -0
  106. package/dist/l10n_in/einvoice.d.ts +253 -0
  107. package/dist/l10n_in/einvoice.js +485 -0
  108. package/dist/l10n_in/gstr.d.ts +109 -0
  109. package/dist/l10n_in/gstr.js +430 -0
  110. package/dist/l10n_in/index.d.ts +20 -0
  111. package/dist/l10n_in/index.js +232 -0
  112. package/dist/l10n_in/module.d.ts +7823 -0
  113. package/dist/l10n_in/module.js +427 -0
  114. package/dist/l10n_in/routes-einvoice.d.ts +15 -0
  115. package/dist/l10n_in/routes-einvoice.js +124 -0
  116. package/dist/l10n_in/routes.d.ts +17 -0
  117. package/dist/l10n_in/routes.js +282 -0
  118. package/dist/l10n_in/web/EInvoicePanel.d.ts +8 -0
  119. package/dist/l10n_in/web/EInvoicePanel.js +63 -0
  120. package/dist/l10n_in/web/GstPage.d.ts +7 -0
  121. package/dist/l10n_in/web/GstPage.js +57 -0
  122. package/dist/l10n_in/web/GstSettings.d.ts +10 -0
  123. package/dist/l10n_in/web/GstSettings.js +36 -0
  124. package/dist/l10n_in/web/index.d.ts +15 -0
  125. package/dist/l10n_in/web/index.js +22 -0
  126. package/dist/l10n_in/web/messages.d.ts +2 -0
  127. package/dist/l10n_in/web/messages.js +166 -0
  128. package/dist/mail/index.js +2 -2
  129. package/dist/modules-sdk/demo.d.ts +2 -0
  130. package/dist/modules-sdk/demo.js +7 -3
  131. package/dist/modules-sdk/index.d.ts +2 -2
  132. package/dist/modules-sdk/index.js +1 -1
  133. package/dist/modules-sdk/loader.js +2 -2
  134. package/dist/modules-sdk/manifest.d.ts +132 -0
  135. package/dist/modules-sdk/manifest.js +22 -0
  136. package/dist/notify/inbox.js +21 -0
  137. package/dist/notify/messages.js +7 -3
  138. package/dist/notify/models.d.ts +1 -1
  139. package/dist/notify/models.js +2 -0
  140. package/dist/notify/routes.js +1 -1
  141. package/dist/notify/web/messages.js +5 -1
  142. package/dist/portal/.kosh/bindings.d.ts +22 -0
  143. package/dist/portal/.kosh/bindings.js +15 -0
  144. package/dist/portal/.kosh/schema.d.ts +376 -0
  145. package/dist/portal/announce.d.ts +16 -0
  146. package/dist/portal/announce.js +117 -0
  147. package/dist/portal/documents.d.ts +17 -0
  148. package/dist/portal/documents.js +61 -0
  149. package/dist/portal/index.d.ts +20 -0
  150. package/dist/portal/index.js +65 -0
  151. package/dist/portal/module.d.ts +1405 -0
  152. package/dist/portal/module.js +84 -0
  153. package/dist/portal/routes-documents.d.ts +2 -0
  154. package/dist/portal/routes-documents.js +391 -0
  155. package/dist/portal/routes.d.ts +13 -0
  156. package/dist/portal/routes.js +313 -0
  157. package/dist/portal/rules.d.ts +11 -0
  158. package/dist/portal/rules.js +25 -0
  159. package/dist/portal/web/PortalAccess.d.ts +8 -0
  160. package/dist/portal/web/PortalAccess.js +66 -0
  161. package/dist/portal/web/index.d.ts +12 -0
  162. package/dist/portal/web/index.js +17 -0
  163. package/dist/portal/web/messages.d.ts +2 -0
  164. package/dist/portal/web/messages.js +33 -0
  165. package/dist/product/.kosh/bindings.js +1 -1
  166. package/dist/product/.kosh/schema.d.ts +42 -3
  167. package/dist/product/demo.js +6 -5
  168. package/dist/product/index.d.ts +1 -0
  169. package/dist/product/index.js +17 -4
  170. package/dist/product/module.d.ts +346 -14
  171. package/dist/product/module.js +48 -18
  172. package/dist/product/taxes.d.ts +59 -0
  173. package/dist/product/taxes.js +61 -0
  174. package/dist/project/.kosh/bindings.js +1 -1
  175. package/dist/project/.kosh/schema.d.ts +33 -1
  176. package/dist/project/module.d.ts +20 -0
  177. package/dist/project_portal/.kosh/bindings.d.ts +22 -0
  178. package/dist/project_portal/.kosh/bindings.js +15 -0
  179. package/dist/project_portal/.kosh/schema.d.ts +701 -0
  180. package/dist/project_portal/index.d.ts +9 -0
  181. package/dist/project_portal/index.js +42 -0
  182. package/dist/project_portal/module.d.ts +2142 -0
  183. package/dist/project_portal/module.js +22 -0
  184. package/dist/purchase/.kosh/bindings.js +1 -1
  185. package/dist/purchase/.kosh/schema.d.ts +45 -4
  186. package/dist/purchase/demo.js +3 -3
  187. package/dist/purchase/index.js +1 -1
  188. package/dist/purchase/module.d.ts +232 -8
  189. package/dist/purchase/module.js +51 -9
  190. package/dist/purchase_account/.kosh/bindings.js +1 -1
  191. package/dist/purchase_account/.kosh/schema.d.ts +174 -10
  192. package/dist/purchase_account/module.d.ts +2008 -641
  193. package/dist/purchase_account/module.js +2 -2
  194. package/dist/purchase_portal/.kosh/bindings.d.ts +22 -0
  195. package/dist/purchase_portal/.kosh/bindings.js +15 -0
  196. package/dist/purchase_portal/.kosh/schema.d.ts +852 -0
  197. package/dist/purchase_portal/index.d.ts +9 -0
  198. package/dist/purchase_portal/index.js +53 -0
  199. package/dist/purchase_portal/module.d.ts +2758 -0
  200. package/dist/purchase_portal/module.js +18 -0
  201. package/dist/reporting/documents.js +20 -3
  202. package/dist/reporting/index.d.ts +1 -0
  203. package/dist/reporting/index.js +1 -0
  204. package/dist/reporting/routes-documents.js +9 -2
  205. package/dist/reporting/words.d.ts +11 -0
  206. package/dist/reporting/words.js +229 -0
  207. package/dist/sale_account/.kosh/bindings.js +1 -1
  208. package/dist/sale_account/.kosh/schema.d.ts +174 -10
  209. package/dist/sale_account/module.d.ts +2008 -641
  210. package/dist/sale_account/module.js +3 -3
  211. package/dist/sale_portal/.kosh/bindings.d.ts +22 -0
  212. package/dist/sale_portal/.kosh/bindings.js +15 -0
  213. package/dist/sale_portal/.kosh/schema.d.ts +766 -0
  214. package/dist/sale_portal/index.d.ts +9 -0
  215. package/dist/sale_portal/index.js +71 -0
  216. package/dist/sale_portal/module.d.ts +2718 -0
  217. package/dist/sale_portal/module.js +19 -0
  218. package/dist/sale_project/.kosh/bindings.js +1 -1
  219. package/dist/sale_project/.kosh/schema.d.ts +45 -4
  220. package/dist/sale_project/module.d.ts +390 -10
  221. package/dist/sales/.kosh/bindings.js +1 -1
  222. package/dist/sales/.kosh/schema.d.ts +45 -4
  223. package/dist/sales/demo.js +3 -3
  224. package/dist/sales/index.js +67 -1
  225. package/dist/sales/module.d.ts +232 -8
  226. package/dist/sales/module.js +51 -12
  227. package/dist/server/api/client.js +1 -1
  228. package/dist/server/api/openapi.js +17 -1
  229. package/dist/server/apps.js +5 -5
  230. package/dist/server/auth/api-keys.d.ts +13 -0
  231. package/dist/server/auth/api-keys.js +65 -0
  232. package/dist/server/auth/base.js +26 -0
  233. package/dist/server/auth/crypto.js +1 -1
  234. package/dist/server/auth/scopes.d.ts +12 -0
  235. package/dist/server/auth/scopes.js +51 -0
  236. package/dist/server/auth/service.d.ts +59 -1
  237. package/dist/server/auth/service.js +236 -6
  238. package/dist/server/demo.d.ts +1 -1
  239. package/dist/server/demo.js +1 -1
  240. package/dist/server/env-names.d.ts +2 -0
  241. package/dist/server/env-names.js +16 -0
  242. package/dist/server/host.js +5 -1
  243. package/dist/server/identity.d.ts +7 -0
  244. package/dist/server/index.d.ts +2 -1
  245. package/dist/server/index.js +2 -1
  246. package/dist/server/registry.js +1 -1
  247. package/dist/server/server.d.ts +5 -0
  248. package/dist/server/server.js +71 -6
  249. package/dist/settings/routes.js +1 -1
  250. package/dist/settings/web/ApiKeysPage.d.ts +8 -0
  251. package/dist/settings/web/ApiKeysPage.js +70 -0
  252. package/dist/settings/web/index.d.ts +1 -0
  253. package/dist/settings/web/index.js +4 -0
  254. package/dist/settings/web/messages.js +62 -0
  255. package/dist/storage/routes.js +1 -1
  256. package/dist/studio/build.js +1 -1
  257. package/dist/studio/generate.js +4 -4
  258. package/dist/studio/module.js +5 -5
  259. package/dist/studio/web/messages.js +2 -2
  260. package/dist/ui/api.d.ts +2 -0
  261. package/dist/ui/app.js +27 -4
  262. package/dist/ui/context.d.ts +3 -1
  263. package/dist/ui/context.js +2 -2
  264. package/dist/ui/i18n/messages.js +2 -2
  265. package/dist/ui/index.d.ts +1 -1
  266. package/dist/ui/index.js +1 -1
  267. package/dist/ui/lib/format.d.ts +2 -0
  268. package/dist/ui/lib/format.js +3 -1
  269. package/dist/ui/pwa/worker.js +2 -2
  270. package/dist/ui/registry.d.ts +15 -0
  271. package/dist/ui/registry.js +20 -0
  272. package/dist/ui/views/FormView.js +19 -6
  273. package/package.json +52 -4
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The tax engine (RFC 0016 §5.1), shared by Sales, Purchase and Accounting: the taxes of a line, in order. A tax is
3
+ * a percentage of its base or a fixed amount per unit; a tax that `affectsBase` adds its amount to the base of the
4
+ * taxes after it (supplementary duty before VAT); taxes `priceIncluded` are inside the unit price, which is then
5
+ * gross. A reverse-charge tax is computed like the others but not added to the total: the buyer pays it to the state,
6
+ * not to the supplier. Exact decimals throughout; rounding is the caller's (per document at posting).
7
+ */
8
+ import { orm } from '../server/orm.js';
9
+ type Decimal = ReturnType<typeof orm.toDecimal>;
10
+ /** What the engine needs of a tax. */
11
+ export interface TaxRule {
12
+ readonly id: number;
13
+ readonly sequence: number;
14
+ readonly amountType: 'percent' | 'fixed';
15
+ /** 0.15 for 15 % (percent taxes). */
16
+ readonly rate: Decimal;
17
+ /** Per unit, in the document currency (fixed taxes). */
18
+ readonly fixedAmount: Decimal;
19
+ readonly affectsBase: boolean;
20
+ readonly priceIncluded: boolean;
21
+ /** Paid by the buyer to the state (reverse charge): not in the line's total. */
22
+ readonly reverseCharge: boolean;
23
+ }
24
+ export interface TaxLine {
25
+ readonly tax: number;
26
+ readonly reverseCharge: boolean;
27
+ /** What the tax was computed on (the untaxed amount, plus the taxes before it that affect the base). */
28
+ readonly base: Decimal;
29
+ readonly amount: Decimal;
30
+ }
31
+ export interface TaxResult {
32
+ /** The amount without taxes. */
33
+ readonly untaxed: Decimal;
34
+ /** Each tax, in order (reverse-charge ones too). */
35
+ readonly taxes: readonly TaxLine[];
36
+ /** The taxes the supplier charges (reverse-charge ones are not). */
37
+ readonly taxTotal: Decimal;
38
+ readonly total: Decimal;
39
+ }
40
+ /** The rules in the order they apply: by sequence, then as given. */
41
+ export declare function ordered(rules: readonly TaxRule[]): TaxRule[];
42
+ /**
43
+ * The taxes of a line whose price amounts to `amount` (quantity × unit price, after discount) for `quantity` units.
44
+ * With taxes included in the price, `amount` is gross: the untaxed amount is what, taxed by the included taxes,
45
+ * gives it back.
46
+ */
47
+ export declare function computeTaxes(amount: Decimal, quantity: Decimal, rules: readonly TaxRule[]): TaxResult;
48
+ /** A tax record (as loaded) as the engine's rule. */
49
+ export declare function taxRule(tax: {
50
+ readonly id: number;
51
+ readonly sequence?: number | null;
52
+ readonly amountType?: string | null;
53
+ readonly rate?: Decimal | null;
54
+ readonly fixedAmount?: Decimal | null;
55
+ readonly affectsBase?: boolean | null;
56
+ readonly priceIncluded?: boolean | null;
57
+ readonly reverseCharge?: boolean | null;
58
+ }): TaxRule;
59
+ export {};
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The tax engine (RFC 0016 §5.1), shared by Sales, Purchase and Accounting: the taxes of a line, in order. A tax is
3
+ * a percentage of its base or a fixed amount per unit; a tax that `affectsBase` adds its amount to the base of the
4
+ * taxes after it (supplementary duty before VAT); taxes `priceIncluded` are inside the unit price, which is then
5
+ * gross. A reverse-charge tax is computed like the others but not added to the total: the buyer pays it to the state,
6
+ * not to the supplier. Exact decimals throughout; rounding is the caller's (per document at posting).
7
+ */
8
+ import { orm } from '../server/orm.js';
9
+ const ZERO = orm.toDecimal(0);
10
+ /** The rules in the order they apply: by sequence, then as given. */
11
+ export function ordered(rules) {
12
+ return rules
13
+ .map((rule, index) => ({ rule, index }))
14
+ .sort((a, b) => a.rule.sequence - b.rule.sequence || a.index - b.index)
15
+ .map(({ rule }) => rule);
16
+ }
17
+ /** The taxes applied in order on `untaxed`. */
18
+ function apply(untaxed, quantity, rules) {
19
+ let base = untaxed;
20
+ const out = [];
21
+ for (const rule of rules) {
22
+ const amount = rule.amountType === 'fixed' ? quantity.times(rule.fixedAmount) : base.times(rule.rate);
23
+ out.push({ tax: rule.id, reverseCharge: rule.reverseCharge, base, amount });
24
+ if (rule.affectsBase)
25
+ base = base.plus(amount);
26
+ }
27
+ return out;
28
+ }
29
+ /**
30
+ * The taxes of a line whose price amounts to `amount` (quantity × unit price, after discount) for `quantity` units.
31
+ * With taxes included in the price, `amount` is gross: the untaxed amount is what, taxed by the included taxes,
32
+ * gives it back.
33
+ */
34
+ export function computeTaxes(amount, quantity, rules) {
35
+ const all = ordered(rules);
36
+ const included = all.filter((r) => r.priceIncluded);
37
+ let untaxed = amount;
38
+ if (included.length > 0) {
39
+ // The included taxes are linear in their base: total(b) = c + k·b. Solve total(b) = amount.
40
+ const total = (b) => apply(b, quantity, included).reduce((s, t) => s.plus(t.amount), b);
41
+ const c = total(ZERO);
42
+ const k = total(orm.toDecimal(1)).minus(c);
43
+ untaxed = k.isZero() ? amount : amount.minus(c).div(k);
44
+ }
45
+ const taxes = apply(untaxed, quantity, all);
46
+ const taxTotal = taxes.reduce((s, t) => (t.reverseCharge ? s : s.plus(t.amount)), ZERO);
47
+ return { untaxed, taxes, taxTotal, total: untaxed.plus(taxTotal) };
48
+ }
49
+ /** A tax record (as loaded) as the engine's rule. */
50
+ export function taxRule(tax) {
51
+ return {
52
+ id: tax.id,
53
+ sequence: tax.sequence ?? 10,
54
+ amountType: tax.amountType === 'fixed' ? 'fixed' : 'percent',
55
+ rate: tax.rate ?? ZERO,
56
+ fixedAmount: tax.fixedAmount ?? ZERO,
57
+ affectsBase: tax.affectsBase === true,
58
+ priceIncluded: tax.priceIncluded === true,
59
+ reverseCharge: tax.reverseCharge === true,
60
+ };
61
+ }
@@ -1,4 +1,4 @@
1
- // GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: 88400d6014f58a65
1
+ // GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: 8538c294f98318cd
2
2
  // Bindings of module `project`: import the definition API from here to get types scoped to what it can see.
3
3
  export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
4
4
  import { definitions } from '../../server/orm.js';
@@ -1,10 +1,11 @@
1
- // GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: 88400d6014f58a65
1
+ // GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: 8538c294f98318cd
2
2
  // Schema view of module `project` (RFC 0002 §7.7): the models it owns or depends on, with the extensions it can see.
3
3
  import type { F } from '../../server/orm.js';
4
4
 
5
5
  /** Model name → model type (RFC 0002 §7.7). */
6
6
  export interface SchemaView {
7
7
  readonly 'audit.event': AuditEvent;
8
+ readonly 'auth.api_key': AuthApiKey;
8
9
  readonly 'auth.credential': AuthCredential;
9
10
  readonly 'auth.session': AuthSession;
10
11
  readonly 'auth.user_grant': AuthUserGrant;
@@ -54,6 +55,34 @@ export interface AuditEvent {
54
55
  export interface AuditEventMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'audit.event'> {
55
56
  }
56
57
 
58
+ /** `auth.api_key` (owner: base). */
59
+ export interface AuthApiKey {
60
+ readonly name: 'auth.api_key';
61
+ readonly fields: {
62
+ readonly id: F.Id<'auth.api_key'>;
63
+ readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
64
+ readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
65
+ readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
66
+ readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
67
+ readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
68
+ readonly name: F.Char<{ readonly required: true }>;
69
+ readonly user: F.Many2one<'res.users', { readonly required: true }>;
70
+ readonly tokenHash: F.Char<{ readonly required: true }>;
71
+ readonly prefix: F.Char<{ readonly required: true }>;
72
+ readonly scopes: F.Text<{ readonly required: true }>;
73
+ readonly expiresAt: F.Datetime<{ readonly required: true }>;
74
+ readonly lastUsedAt: F.Datetime;
75
+ readonly lastUsedIp: F.Char;
76
+ readonly revoked: F.Bool<{ readonly required: true; readonly default: true }>;
77
+ readonly issuedBy: F.Many2one<'res.users'>;
78
+ };
79
+ readonly methods: AuthApiKeyMethods;
80
+ }
81
+
82
+ /** Methods of `auth.api_key`: declared ones and transitions. */
83
+ export interface AuthApiKeyMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'auth.api_key'> {
84
+ }
85
+
57
86
  /** `auth.credential` (owner: base). */
58
87
  export interface AuthCredential {
59
88
  readonly name: 'auth.credential';
@@ -473,6 +502,7 @@ export interface ResCompany {
473
502
  readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
474
503
  readonly name: F.Char<{ readonly required: true }>;
475
504
  readonly currency: F.Many2one<'res.currency', { readonly required: true }>;
505
+ readonly numberGrouping: F.Selection<'international' | 'lakh', { readonly required: true; readonly default: true }>;
476
506
  };
477
507
  readonly methods: ResCompanyMethods;
478
508
  }
@@ -526,6 +556,7 @@ export interface ResPartner {
526
556
  readonly city: F.Char;
527
557
  readonly zip: F.Char;
528
558
  readonly country: F.Char;
559
+ readonly state: F.Char;
529
560
  readonly taxId: F.Char;
530
561
  readonly isCustomer: F.Bool<{ readonly required: true; readonly default: true }>;
531
562
  readonly isVendor: F.Bool<{ readonly required: true; readonly default: true }>;
@@ -558,6 +589,7 @@ export interface ResUsers {
558
589
  readonly companies: F.Many2many<'res.company', { readonly required: true }>;
559
590
  readonly lang: F.Char<{ readonly default: true }>;
560
591
  readonly tz: F.Char<{ readonly default: true }>;
592
+ readonly isService: F.Bool<{ readonly required: true; readonly default: true }>;
561
593
  };
562
594
  readonly methods: ResUsersMethods;
563
595
  }
@@ -1845,6 +1845,16 @@ export declare const projectShutro: import("../server/orm.js").Module<readonly [
1845
1845
  readonly hasDefault: false;
1846
1846
  readonly readonly: false;
1847
1847
  }, string>;
1848
+ readonly state: import("../server/orm.js").CharField<{
1849
+ readonly required: false;
1850
+ readonly computed: false;
1851
+ readonly inverse: false;
1852
+ readonly sequence: false;
1853
+ readonly computeName: undefined;
1854
+ readonly store: true;
1855
+ readonly hasDefault: false;
1856
+ readonly readonly: false;
1857
+ }, string>;
1848
1858
  readonly taxId: import("../server/orm.js").CharField<{
1849
1859
  readonly required: false;
1850
1860
  readonly computed: false;
@@ -2016,6 +2026,16 @@ export declare const projectShutro: import("../server/orm.js").Module<readonly [
2016
2026
  readonly hasDefault: false;
2017
2027
  readonly readonly: false;
2018
2028
  }, string>;
2029
+ readonly state: import("../server/orm.js").CharField<{
2030
+ readonly required: false;
2031
+ readonly computed: false;
2032
+ readonly inverse: false;
2033
+ readonly sequence: false;
2034
+ readonly computeName: undefined;
2035
+ readonly store: true;
2036
+ readonly hasDefault: false;
2037
+ readonly readonly: false;
2038
+ }, string>;
2019
2039
  readonly taxId: import("../server/orm.js").CharField<{
2020
2040
  readonly required: false;
2021
2041
  readonly computed: false;
@@ -0,0 +1,22 @@
1
+ export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
2
+ import { type DefinitionHelpers } from '../../server/orm.js';
3
+ import type { DefaultLoaded, Env as CoreEnv, RecordSet as CoreRecordSet, Shutro as CoreShutro } from '../../server/orm.js';
4
+ import type { SchemaView } from './schema.js';
5
+ export type { SchemaView };
6
+ /** Every model visible in this view. */
7
+ export type ModelName = keyof SchemaView & string;
8
+ /** `Env` typed to this view. */
9
+ export type Env = CoreEnv<SchemaView>;
10
+ /** `Shutro` typed to this view. */
11
+ export type Shutro = CoreShutro<SchemaView>;
12
+ /** A recordset of `M`, with the default loaded shape unless `L` is given. */
13
+ export type Records<M extends ModelName, L = DefaultLoaded<SchemaView, M>> = CoreRecordSet<SchemaView, M, L>;
14
+ export declare const compute: DefinitionHelpers<SchemaView>['compute'];
15
+ export declare const check: DefinitionHelpers<SchemaView>['check'];
16
+ export declare const onchange: DefinitionHelpers<SchemaView>['onchange'];
17
+ export declare const records: DefinitionHelpers<SchemaView>['records'];
18
+ export declare const method: DefinitionHelpers<SchemaView>['method'];
19
+ /** Module data (RFC 0017): records, overrides of dependencies' records, and references, typed like creates. */
20
+ export declare const record: DefinitionHelpers<SchemaView>['record'];
21
+ export declare const override: DefinitionHelpers<SchemaView>['override'];
22
+ export declare const ref: DefinitionHelpers<SchemaView>['ref'];
@@ -0,0 +1,15 @@
1
+ // GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: 0440c5ae846a11ac
2
+ // Bindings of module `project_portal`: import the definition API from here to get types scoped to what it can see.
3
+ export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
4
+ import { definitions } from '../../server/orm.js';
5
+ /** Definition callbacks typed against this module's view: no casts in computes, checks, onchange, methods. */
6
+ const helpers = definitions();
7
+ export const compute = helpers.compute;
8
+ export const check = helpers.check;
9
+ export const onchange = helpers.onchange;
10
+ export const records = helpers.records;
11
+ export const method = helpers.method;
12
+ /** Module data (RFC 0017): records, overrides of dependencies' records, and references, typed like creates. */
13
+ export const record = helpers.record;
14
+ export const override = helpers.override;
15
+ export const ref = helpers.ref;