@nuxt-customer-portal/invoices 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @nuxt-customer-portal/invoices
2
2
 
3
+ ## 0.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [67b5b80]
8
+ - @nuxt-customer-portal/core@0.4.4
9
+ - @nuxt-customer-portal/clients@0.4.4
10
+ - @nuxt-customer-portal/organizations@0.4.4
11
+ - @nuxt-customer-portal/ui@0.4.4
12
+
13
+ ## 0.4.3
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [eb2a85c]
18
+ - @nuxt-customer-portal/core@0.4.3
19
+ - @nuxt-customer-portal/clients@0.4.3
20
+ - @nuxt-customer-portal/organizations@0.4.3
21
+ - @nuxt-customer-portal/ui@0.4.3
22
+
3
23
  ## 0.4.2
4
24
 
5
25
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt-customer-portal/invoices",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "license": "MIT",
5
5
  "homepage": "https://nuxt-customer-portal.com",
6
6
  "repository": {
@@ -44,10 +44,10 @@
44
44
  "pg": "^8.22.0",
45
45
  "resend": "^6.18.1",
46
46
  "zod": "^4.4.3",
47
- "@nuxt-customer-portal/core": "^0.4.2",
48
- "@nuxt-customer-portal/clients": "^0.4.2",
49
- "@nuxt-customer-portal/ui": "^0.4.2",
50
- "@nuxt-customer-portal/organizations": "^0.4.2"
47
+ "@nuxt-customer-portal/core": "^0.4.4",
48
+ "@nuxt-customer-portal/clients": "^0.4.4",
49
+ "@nuxt-customer-portal/organizations": "^0.4.4",
50
+ "@nuxt-customer-portal/ui": "^0.4.4"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "nuxt": "^4.5.1",
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  id: 'invoices',
3
- version: '0.4.2',
3
+ version: '0.4.4',
4
4
  source: '@nuxt-customer-portal/invoices',
5
5
  clientModuleId: 'invoices',
6
6
  dependsOn: ['core', 'ui', 'organizations', 'clients'],
@@ -18,22 +18,22 @@ export const invoiceLineSchema = z.object({
18
18
  unitPriceMinor: moneyMinor,
19
19
  vatRateBasisPoints: z.number().int().min(0).max(10_000).default(2100)
20
20
  })
21
- export const invoiceCreateSchema = z
22
- .object({
23
- clientOrganizationId: id,
24
- contactId: id.nullable().optional(),
25
- number: invoiceNumber,
26
- currency: z.string().length(3),
27
- issueDate: isoDate,
28
- dueDate: isoDate,
29
- subject: z.string().trim().max(500).nullable().optional(),
30
- notes: z.string().trim().max(5000).nullable().optional(),
31
- lines: z.array(invoiceLineSchema).min(1).max(500)
32
- })
33
- .refine((value) => value.dueDate >= value.issueDate, {
34
- path: ['dueDate'],
35
- message: 'Due date must not precede invoice date'
36
- })
21
+ export const invoiceCreateShape = {
22
+ clientOrganizationId: id,
23
+ contactId: id.nullable().optional(),
24
+ number: invoiceNumber,
25
+ currency: z.string().length(3),
26
+ issueDate: isoDate,
27
+ dueDate: isoDate,
28
+ subject: z.string().trim().max(500).nullable().optional(),
29
+ notes: z.string().trim().max(5000).nullable().optional(),
30
+ lines: z.array(invoiceLineSchema).min(1).max(500)
31
+ }
32
+ export const validateInvoiceDates = (value: { issueDate: string; dueDate: string }) => value.dueDate >= value.issueDate
33
+ export const invoiceCreateSchema = z.object(invoiceCreateShape).refine(validateInvoiceDates, {
34
+ path: ['dueDate'],
35
+ message: 'Due date must not precede invoice date'
36
+ })
37
37
  export type InvoiceCreateInput = z.infer<typeof invoiceCreateSchema>
38
38
  export const invoiceUpdateSchema = z
39
39
  .object({