@agendar/shared 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/illustrations/expense-categories-empty-state.svg +20 -0
- package/assets/illustrations/expenses-empty-state.svg +29 -0
- package/assets/illustrations/expenses-overdue-empty-state.svg +24 -0
- package/assets/illustrations/expenses-search-empty-state.svg +24 -0
- package/dist/{chunk-O5UXD5C2.js → chunk-3MIR7JR3.js} +142 -3
- package/dist/chunk-3MIR7JR3.js.map +1 -0
- package/dist/{chunk-KJ2DYUCT.js → chunk-4LJHXDBD.js} +142 -3
- package/dist/chunk-4LJHXDBD.js.map +1 -0
- package/dist/{chunk-EPUN6UMG.js → chunk-EAGC2SHC.js} +142 -3
- package/dist/chunk-EAGC2SHC.js.map +1 -0
- package/dist/i18n/en.cjs +140 -1
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +140 -1
- package/dist/i18n/en.d.ts +140 -1
- package/dist/i18n/en.js +1 -1
- package/dist/i18n/es.cjs +140 -1
- package/dist/i18n/es.cjs.map +1 -1
- package/dist/i18n/es.d.cts +140 -1
- package/dist/i18n/es.d.ts +140 -1
- package/dist/i18n/es.js +1 -1
- package/dist/i18n/index.cjs +420 -3
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +3 -3
- package/dist/i18n/pt.cjs +140 -1
- package/dist/i18n/pt.cjs.map +1 -1
- package/dist/i18n/pt.d.cts +140 -1
- package/dist/i18n/pt.d.ts +140 -1
- package/dist/i18n/pt.js +1 -1
- package/dist/schemas/create-appointment.cjs +2 -1
- package/dist/schemas/create-appointment.cjs.map +1 -1
- package/dist/schemas/create-appointment.d.cts +2 -2
- package/dist/schemas/create-appointment.d.ts +2 -2
- package/dist/schemas/create-appointment.js +2 -1
- package/dist/schemas/create-appointment.js.map +1 -1
- package/dist/schemas/create-client.cjs +2 -1
- package/dist/schemas/create-client.cjs.map +1 -1
- package/dist/schemas/create-client.d.cts +2 -2
- package/dist/schemas/create-client.d.ts +2 -2
- package/dist/schemas/create-client.js +2 -1
- package/dist/schemas/create-client.js.map +1 -1
- package/dist/schemas/expense-form.cjs +2 -2
- package/dist/schemas/expense-form.cjs.map +1 -1
- package/dist/schemas/expense-form.d.cts +0 -1
- package/dist/schemas/expense-form.d.ts +0 -1
- package/dist/schemas/expense-form.js +2 -2
- package/dist/schemas/expense-form.js.map +1 -1
- package/dist/utils/appointments.cjs +1 -1
- package/dist/utils/appointments.cjs.map +1 -1
- package/dist/utils/appointments.d.cts +2 -1
- package/dist/utils/appointments.d.ts +2 -1
- package/dist/utils/appointments.js +1 -1
- package/dist/utils/appointments.js.map +1 -1
- package/package.json +3 -2
- package/dist/chunk-EPUN6UMG.js.map +0 -1
- package/dist/chunk-KJ2DYUCT.js.map +0 -1
- package/dist/chunk-O5UXD5C2.js.map +0 -1
package/dist/i18n/pt.d.cts
CHANGED
|
@@ -300,6 +300,8 @@ declare const appPT: {
|
|
|
300
300
|
"settings.logout": string;
|
|
301
301
|
"settings.logoutConfirmation": string;
|
|
302
302
|
"settings.version": string;
|
|
303
|
+
"settings.otaVersion": string;
|
|
304
|
+
"settings.otaEmbedded": string;
|
|
303
305
|
"settings.dev.title": string;
|
|
304
306
|
"settings.dev.clearStorage": string;
|
|
305
307
|
"settings.description": string;
|
|
@@ -2504,7 +2506,6 @@ declare const appPT: {
|
|
|
2504
2506
|
"expenses.categories.deleteDialog.descriptionWithName": string;
|
|
2505
2507
|
"expenses.categories.deleteDialog.description": string;
|
|
2506
2508
|
"expenses.validation.description.required": string;
|
|
2507
|
-
"expenses.validation.category.required": string;
|
|
2508
2509
|
"expenses.validation.amount.required": string;
|
|
2509
2510
|
"expenses.validation.amount.invalid": string;
|
|
2510
2511
|
"expenses.validation.paymentDate.required": string;
|
|
@@ -2783,6 +2784,7 @@ declare const appPT: {
|
|
|
2783
2784
|
"appointment.form.clearClientHint": string;
|
|
2784
2785
|
"appointment.form.clearProfessional": string;
|
|
2785
2786
|
"appointment.form.clearProfessionalHint": string;
|
|
2787
|
+
"appointment.form.noClient": string;
|
|
2786
2788
|
"appointment.form.client": string;
|
|
2787
2789
|
"appointment.form.services": string;
|
|
2788
2790
|
"appointment.form.professional": string;
|
|
@@ -3018,6 +3020,122 @@ declare const appPT: {
|
|
|
3018
3020
|
"products.categoryForm.activeHint": string;
|
|
3019
3021
|
"products.categoryForm.toast.name": string;
|
|
3020
3022
|
"products.categoryForm.toast.active": string;
|
|
3023
|
+
"expenses.categoriesPage.subtitle_one": string;
|
|
3024
|
+
"expenses.categoriesPage.subtitle_other": string;
|
|
3025
|
+
"expenses.categoriesPage.search": string;
|
|
3026
|
+
"expenses.categoriesPage.active": string;
|
|
3027
|
+
"expenses.categoriesPage.inactive": string;
|
|
3028
|
+
"expenses.categoriesPage.new": string;
|
|
3029
|
+
"expenses.categoriesPage.rowHint": string;
|
|
3030
|
+
"expenses.categoriesPage.count_zero": string;
|
|
3031
|
+
"expenses.categoriesPage.count_one": string;
|
|
3032
|
+
"expenses.categoriesPage.count_other": string;
|
|
3033
|
+
"expenses.categoriesPage.default": string;
|
|
3034
|
+
"expenses.categoriesPage.empty.title": string;
|
|
3035
|
+
"expenses.categoriesPage.empty.subtitle": string;
|
|
3036
|
+
"expenses.categoriesPage.noResults": string;
|
|
3037
|
+
"expenses.categoriesPage.noInactive": string;
|
|
3038
|
+
"expenses.categoryForm.subtitle": string;
|
|
3039
|
+
"expenses.categoryForm.defaultSubtitle": string;
|
|
3040
|
+
"expenses.categoryForm.goBackHint": string;
|
|
3041
|
+
"expenses.categoryForm.createTitle": string;
|
|
3042
|
+
"expenses.categoryForm.submit": string;
|
|
3043
|
+
"expenses.categoryForm.closeHint": string;
|
|
3044
|
+
"expenses.categoryForm.created": string;
|
|
3045
|
+
"expenses.categoryForm.sections.category": string;
|
|
3046
|
+
"expenses.categoryForm.sections.status": string;
|
|
3047
|
+
"expenses.categoryForm.fields.name": string;
|
|
3048
|
+
"expenses.categoryForm.fields.expenses": string;
|
|
3049
|
+
"expenses.categoryForm.fields.active": string;
|
|
3050
|
+
"expenses.categoryForm.activeOn": string;
|
|
3051
|
+
"expenses.categoryForm.activeOff": string;
|
|
3052
|
+
"expenses.categoryForm.activeHint": string;
|
|
3053
|
+
"expenses.categoryForm.defaultNote": string;
|
|
3054
|
+
"expenses.categoryForm.toast.name": string;
|
|
3055
|
+
"expenses.categoryForm.toast.active": string;
|
|
3056
|
+
"expenses.categorySheet.subtitle": string;
|
|
3057
|
+
"expenses.categorySheet.search": string;
|
|
3058
|
+
"expenses.categorySheet.create": string;
|
|
3059
|
+
"expenses.categorySheet.createNote": string;
|
|
3060
|
+
"expenses.categorySheet.none": string;
|
|
3061
|
+
"expenses.categorySheet.selectHint": string;
|
|
3062
|
+
"expenses.categorySheet.empty": string;
|
|
3063
|
+
"expenses.create.title": string;
|
|
3064
|
+
"expenses.create.submit": string;
|
|
3065
|
+
"expenses.create.closeHint": string;
|
|
3066
|
+
"expenses.create.created": string;
|
|
3067
|
+
"expenses.create.missingFields.description": string;
|
|
3068
|
+
"expenses.create.missingFields.amount": string;
|
|
3069
|
+
"expenses.editForm.sections.expense": string;
|
|
3070
|
+
"expenses.editForm.sections.payment": string;
|
|
3071
|
+
"expenses.editForm.sections.notes": string;
|
|
3072
|
+
"expenses.editForm.fields.description": string;
|
|
3073
|
+
"expenses.editForm.fields.category": string;
|
|
3074
|
+
"expenses.editForm.fields.amount": string;
|
|
3075
|
+
"expenses.editForm.fields.date": string;
|
|
3076
|
+
"expenses.editForm.fields.recurring": string;
|
|
3077
|
+
"expenses.editForm.fields.paid": string;
|
|
3078
|
+
"expenses.editForm.fields.notes": string;
|
|
3079
|
+
"expenses.editForm.recurringOn": string;
|
|
3080
|
+
"expenses.editForm.recurringOff": string;
|
|
3081
|
+
"expenses.editForm.recurringHint": string;
|
|
3082
|
+
"expenses.editForm.paidOn": string;
|
|
3083
|
+
"expenses.editForm.paidOff": string;
|
|
3084
|
+
"expenses.editForm.paidHint": string;
|
|
3085
|
+
"expenses.editForm.dateHint": string;
|
|
3086
|
+
"expenses.editForm.subtitle": string;
|
|
3087
|
+
"expenses.editForm.goBackHint": string;
|
|
3088
|
+
"expenses.editForm.delete": string;
|
|
3089
|
+
"expenses.editForm.deleteHint": string;
|
|
3090
|
+
"expenses.editForm.toast.description": string;
|
|
3091
|
+
"expenses.editForm.toast.category": string;
|
|
3092
|
+
"expenses.editForm.toast.place": string;
|
|
3093
|
+
"expenses.editForm.toast.amount": string;
|
|
3094
|
+
"expenses.editForm.toast.date": string;
|
|
3095
|
+
"expenses.editForm.toast.recurring": string;
|
|
3096
|
+
"expenses.editForm.toast.paid": string;
|
|
3097
|
+
"expenses.editForm.toast.notes": string;
|
|
3098
|
+
"expenses.list.overview": string;
|
|
3099
|
+
"expenses.list.search": string;
|
|
3100
|
+
"expenses.list.categories": string;
|
|
3101
|
+
"expenses.list.categoriesHint": string;
|
|
3102
|
+
"expenses.list.noResults": string;
|
|
3103
|
+
"expenses.list.noFiltered": string;
|
|
3104
|
+
"expenses.list.noOverdue.title": string;
|
|
3105
|
+
"expenses.list.noOverdue.subtitle": string;
|
|
3106
|
+
"expenses.list.empty.title": string;
|
|
3107
|
+
"expenses.list.empty.subtitle": string;
|
|
3108
|
+
"expenses.kpi.total": string;
|
|
3109
|
+
"expenses.kpi.paid": string;
|
|
3110
|
+
"expenses.kpi.pending": string;
|
|
3111
|
+
"expenses.kpi.hint.total": string;
|
|
3112
|
+
"expenses.kpi.hint.paid": string;
|
|
3113
|
+
"expenses.kpi.hint.pending": string;
|
|
3114
|
+
"expenses.card.state.paid": string;
|
|
3115
|
+
"expenses.card.state.pending": string;
|
|
3116
|
+
"expenses.card.state.overdue": string;
|
|
3117
|
+
"expenses.card.hint": string;
|
|
3118
|
+
"expenses.filters.title": string;
|
|
3119
|
+
"expenses.filters.open": string;
|
|
3120
|
+
"expenses.filters.openHint": string;
|
|
3121
|
+
"expenses.filters.activeCount_one": string;
|
|
3122
|
+
"expenses.filters.activeCount_other": string;
|
|
3123
|
+
"expenses.filters.clear": string;
|
|
3124
|
+
"expenses.filters.clearHint": string;
|
|
3125
|
+
"expenses.filters.status": string;
|
|
3126
|
+
"expenses.filters.statusAll": string;
|
|
3127
|
+
"expenses.filters.statusPending": string;
|
|
3128
|
+
"expenses.filters.statusPaid": string;
|
|
3129
|
+
"expenses.filters.category": string;
|
|
3130
|
+
"expenses.filters.apply": string;
|
|
3131
|
+
"expenses.filters.applyHint": string;
|
|
3132
|
+
"expenses.filters.statusOverdue": string;
|
|
3133
|
+
"expenses.kpi.overdue": string;
|
|
3134
|
+
"expenses.kpi.hint.overdue": string;
|
|
3135
|
+
"expenses.card.markPaid": string;
|
|
3136
|
+
"expenses.card.markPaidHint": string;
|
|
3137
|
+
"expenses.card.markedPaid": string;
|
|
3138
|
+
"expenses.editForm.recurringNext": string;
|
|
3021
3139
|
"products.list.activeCount_one": string;
|
|
3022
3140
|
"products.list.activeCount_other": string;
|
|
3023
3141
|
"products.list.categoryCount_one": string;
|
|
@@ -3335,6 +3453,27 @@ declare const appPT: {
|
|
|
3335
3453
|
"businessForm.addPlace": string;
|
|
3336
3454
|
"businessForm.addPlaceHint": string;
|
|
3337
3455
|
"businessForm.placeHint": string;
|
|
3456
|
+
"businessForm.sections.payment": string;
|
|
3457
|
+
"businessForm.fields.paymentMethods": string;
|
|
3458
|
+
"businessForm.paymentMethodsEmpty": string;
|
|
3459
|
+
"businessForm.paymentMethodsHint": string;
|
|
3460
|
+
"paymentMethods.title": string;
|
|
3461
|
+
"paymentMethods.goBackHint": string;
|
|
3462
|
+
"paymentMethods.sections.accepted": string;
|
|
3463
|
+
"paymentMethods.sections.other": string;
|
|
3464
|
+
"paymentMethods.accepted": string;
|
|
3465
|
+
"paymentMethods.notAccepted": string;
|
|
3466
|
+
"paymentMethods.toggleHint": string;
|
|
3467
|
+
"paymentMethods.cashNote": string;
|
|
3468
|
+
"paymentMethods.add": string;
|
|
3469
|
+
"paymentMethods.addPlaceholder": string;
|
|
3470
|
+
"paymentMethods.duplicate": string;
|
|
3471
|
+
"paymentMethods.keepOne": string;
|
|
3472
|
+
"paymentMethods.hint": string;
|
|
3473
|
+
"paymentMethods.missing.title": string;
|
|
3474
|
+
"paymentMethods.missing.owner": string;
|
|
3475
|
+
"paymentMethods.missing.member": string;
|
|
3476
|
+
"paymentMethods.missing.action": string;
|
|
3338
3477
|
"businessForm.sections.segments": string;
|
|
3339
3478
|
"businessForm.archived": string;
|
|
3340
3479
|
"businessForm.segment": string;
|
package/dist/i18n/pt.d.ts
CHANGED
|
@@ -300,6 +300,8 @@ declare const appPT: {
|
|
|
300
300
|
"settings.logout": string;
|
|
301
301
|
"settings.logoutConfirmation": string;
|
|
302
302
|
"settings.version": string;
|
|
303
|
+
"settings.otaVersion": string;
|
|
304
|
+
"settings.otaEmbedded": string;
|
|
303
305
|
"settings.dev.title": string;
|
|
304
306
|
"settings.dev.clearStorage": string;
|
|
305
307
|
"settings.description": string;
|
|
@@ -2504,7 +2506,6 @@ declare const appPT: {
|
|
|
2504
2506
|
"expenses.categories.deleteDialog.descriptionWithName": string;
|
|
2505
2507
|
"expenses.categories.deleteDialog.description": string;
|
|
2506
2508
|
"expenses.validation.description.required": string;
|
|
2507
|
-
"expenses.validation.category.required": string;
|
|
2508
2509
|
"expenses.validation.amount.required": string;
|
|
2509
2510
|
"expenses.validation.amount.invalid": string;
|
|
2510
2511
|
"expenses.validation.paymentDate.required": string;
|
|
@@ -2783,6 +2784,7 @@ declare const appPT: {
|
|
|
2783
2784
|
"appointment.form.clearClientHint": string;
|
|
2784
2785
|
"appointment.form.clearProfessional": string;
|
|
2785
2786
|
"appointment.form.clearProfessionalHint": string;
|
|
2787
|
+
"appointment.form.noClient": string;
|
|
2786
2788
|
"appointment.form.client": string;
|
|
2787
2789
|
"appointment.form.services": string;
|
|
2788
2790
|
"appointment.form.professional": string;
|
|
@@ -3018,6 +3020,122 @@ declare const appPT: {
|
|
|
3018
3020
|
"products.categoryForm.activeHint": string;
|
|
3019
3021
|
"products.categoryForm.toast.name": string;
|
|
3020
3022
|
"products.categoryForm.toast.active": string;
|
|
3023
|
+
"expenses.categoriesPage.subtitle_one": string;
|
|
3024
|
+
"expenses.categoriesPage.subtitle_other": string;
|
|
3025
|
+
"expenses.categoriesPage.search": string;
|
|
3026
|
+
"expenses.categoriesPage.active": string;
|
|
3027
|
+
"expenses.categoriesPage.inactive": string;
|
|
3028
|
+
"expenses.categoriesPage.new": string;
|
|
3029
|
+
"expenses.categoriesPage.rowHint": string;
|
|
3030
|
+
"expenses.categoriesPage.count_zero": string;
|
|
3031
|
+
"expenses.categoriesPage.count_one": string;
|
|
3032
|
+
"expenses.categoriesPage.count_other": string;
|
|
3033
|
+
"expenses.categoriesPage.default": string;
|
|
3034
|
+
"expenses.categoriesPage.empty.title": string;
|
|
3035
|
+
"expenses.categoriesPage.empty.subtitle": string;
|
|
3036
|
+
"expenses.categoriesPage.noResults": string;
|
|
3037
|
+
"expenses.categoriesPage.noInactive": string;
|
|
3038
|
+
"expenses.categoryForm.subtitle": string;
|
|
3039
|
+
"expenses.categoryForm.defaultSubtitle": string;
|
|
3040
|
+
"expenses.categoryForm.goBackHint": string;
|
|
3041
|
+
"expenses.categoryForm.createTitle": string;
|
|
3042
|
+
"expenses.categoryForm.submit": string;
|
|
3043
|
+
"expenses.categoryForm.closeHint": string;
|
|
3044
|
+
"expenses.categoryForm.created": string;
|
|
3045
|
+
"expenses.categoryForm.sections.category": string;
|
|
3046
|
+
"expenses.categoryForm.sections.status": string;
|
|
3047
|
+
"expenses.categoryForm.fields.name": string;
|
|
3048
|
+
"expenses.categoryForm.fields.expenses": string;
|
|
3049
|
+
"expenses.categoryForm.fields.active": string;
|
|
3050
|
+
"expenses.categoryForm.activeOn": string;
|
|
3051
|
+
"expenses.categoryForm.activeOff": string;
|
|
3052
|
+
"expenses.categoryForm.activeHint": string;
|
|
3053
|
+
"expenses.categoryForm.defaultNote": string;
|
|
3054
|
+
"expenses.categoryForm.toast.name": string;
|
|
3055
|
+
"expenses.categoryForm.toast.active": string;
|
|
3056
|
+
"expenses.categorySheet.subtitle": string;
|
|
3057
|
+
"expenses.categorySheet.search": string;
|
|
3058
|
+
"expenses.categorySheet.create": string;
|
|
3059
|
+
"expenses.categorySheet.createNote": string;
|
|
3060
|
+
"expenses.categorySheet.none": string;
|
|
3061
|
+
"expenses.categorySheet.selectHint": string;
|
|
3062
|
+
"expenses.categorySheet.empty": string;
|
|
3063
|
+
"expenses.create.title": string;
|
|
3064
|
+
"expenses.create.submit": string;
|
|
3065
|
+
"expenses.create.closeHint": string;
|
|
3066
|
+
"expenses.create.created": string;
|
|
3067
|
+
"expenses.create.missingFields.description": string;
|
|
3068
|
+
"expenses.create.missingFields.amount": string;
|
|
3069
|
+
"expenses.editForm.sections.expense": string;
|
|
3070
|
+
"expenses.editForm.sections.payment": string;
|
|
3071
|
+
"expenses.editForm.sections.notes": string;
|
|
3072
|
+
"expenses.editForm.fields.description": string;
|
|
3073
|
+
"expenses.editForm.fields.category": string;
|
|
3074
|
+
"expenses.editForm.fields.amount": string;
|
|
3075
|
+
"expenses.editForm.fields.date": string;
|
|
3076
|
+
"expenses.editForm.fields.recurring": string;
|
|
3077
|
+
"expenses.editForm.fields.paid": string;
|
|
3078
|
+
"expenses.editForm.fields.notes": string;
|
|
3079
|
+
"expenses.editForm.recurringOn": string;
|
|
3080
|
+
"expenses.editForm.recurringOff": string;
|
|
3081
|
+
"expenses.editForm.recurringHint": string;
|
|
3082
|
+
"expenses.editForm.paidOn": string;
|
|
3083
|
+
"expenses.editForm.paidOff": string;
|
|
3084
|
+
"expenses.editForm.paidHint": string;
|
|
3085
|
+
"expenses.editForm.dateHint": string;
|
|
3086
|
+
"expenses.editForm.subtitle": string;
|
|
3087
|
+
"expenses.editForm.goBackHint": string;
|
|
3088
|
+
"expenses.editForm.delete": string;
|
|
3089
|
+
"expenses.editForm.deleteHint": string;
|
|
3090
|
+
"expenses.editForm.toast.description": string;
|
|
3091
|
+
"expenses.editForm.toast.category": string;
|
|
3092
|
+
"expenses.editForm.toast.place": string;
|
|
3093
|
+
"expenses.editForm.toast.amount": string;
|
|
3094
|
+
"expenses.editForm.toast.date": string;
|
|
3095
|
+
"expenses.editForm.toast.recurring": string;
|
|
3096
|
+
"expenses.editForm.toast.paid": string;
|
|
3097
|
+
"expenses.editForm.toast.notes": string;
|
|
3098
|
+
"expenses.list.overview": string;
|
|
3099
|
+
"expenses.list.search": string;
|
|
3100
|
+
"expenses.list.categories": string;
|
|
3101
|
+
"expenses.list.categoriesHint": string;
|
|
3102
|
+
"expenses.list.noResults": string;
|
|
3103
|
+
"expenses.list.noFiltered": string;
|
|
3104
|
+
"expenses.list.noOverdue.title": string;
|
|
3105
|
+
"expenses.list.noOverdue.subtitle": string;
|
|
3106
|
+
"expenses.list.empty.title": string;
|
|
3107
|
+
"expenses.list.empty.subtitle": string;
|
|
3108
|
+
"expenses.kpi.total": string;
|
|
3109
|
+
"expenses.kpi.paid": string;
|
|
3110
|
+
"expenses.kpi.pending": string;
|
|
3111
|
+
"expenses.kpi.hint.total": string;
|
|
3112
|
+
"expenses.kpi.hint.paid": string;
|
|
3113
|
+
"expenses.kpi.hint.pending": string;
|
|
3114
|
+
"expenses.card.state.paid": string;
|
|
3115
|
+
"expenses.card.state.pending": string;
|
|
3116
|
+
"expenses.card.state.overdue": string;
|
|
3117
|
+
"expenses.card.hint": string;
|
|
3118
|
+
"expenses.filters.title": string;
|
|
3119
|
+
"expenses.filters.open": string;
|
|
3120
|
+
"expenses.filters.openHint": string;
|
|
3121
|
+
"expenses.filters.activeCount_one": string;
|
|
3122
|
+
"expenses.filters.activeCount_other": string;
|
|
3123
|
+
"expenses.filters.clear": string;
|
|
3124
|
+
"expenses.filters.clearHint": string;
|
|
3125
|
+
"expenses.filters.status": string;
|
|
3126
|
+
"expenses.filters.statusAll": string;
|
|
3127
|
+
"expenses.filters.statusPending": string;
|
|
3128
|
+
"expenses.filters.statusPaid": string;
|
|
3129
|
+
"expenses.filters.category": string;
|
|
3130
|
+
"expenses.filters.apply": string;
|
|
3131
|
+
"expenses.filters.applyHint": string;
|
|
3132
|
+
"expenses.filters.statusOverdue": string;
|
|
3133
|
+
"expenses.kpi.overdue": string;
|
|
3134
|
+
"expenses.kpi.hint.overdue": string;
|
|
3135
|
+
"expenses.card.markPaid": string;
|
|
3136
|
+
"expenses.card.markPaidHint": string;
|
|
3137
|
+
"expenses.card.markedPaid": string;
|
|
3138
|
+
"expenses.editForm.recurringNext": string;
|
|
3021
3139
|
"products.list.activeCount_one": string;
|
|
3022
3140
|
"products.list.activeCount_other": string;
|
|
3023
3141
|
"products.list.categoryCount_one": string;
|
|
@@ -3335,6 +3453,27 @@ declare const appPT: {
|
|
|
3335
3453
|
"businessForm.addPlace": string;
|
|
3336
3454
|
"businessForm.addPlaceHint": string;
|
|
3337
3455
|
"businessForm.placeHint": string;
|
|
3456
|
+
"businessForm.sections.payment": string;
|
|
3457
|
+
"businessForm.fields.paymentMethods": string;
|
|
3458
|
+
"businessForm.paymentMethodsEmpty": string;
|
|
3459
|
+
"businessForm.paymentMethodsHint": string;
|
|
3460
|
+
"paymentMethods.title": string;
|
|
3461
|
+
"paymentMethods.goBackHint": string;
|
|
3462
|
+
"paymentMethods.sections.accepted": string;
|
|
3463
|
+
"paymentMethods.sections.other": string;
|
|
3464
|
+
"paymentMethods.accepted": string;
|
|
3465
|
+
"paymentMethods.notAccepted": string;
|
|
3466
|
+
"paymentMethods.toggleHint": string;
|
|
3467
|
+
"paymentMethods.cashNote": string;
|
|
3468
|
+
"paymentMethods.add": string;
|
|
3469
|
+
"paymentMethods.addPlaceholder": string;
|
|
3470
|
+
"paymentMethods.duplicate": string;
|
|
3471
|
+
"paymentMethods.keepOne": string;
|
|
3472
|
+
"paymentMethods.hint": string;
|
|
3473
|
+
"paymentMethods.missing.title": string;
|
|
3474
|
+
"paymentMethods.missing.owner": string;
|
|
3475
|
+
"paymentMethods.missing.member": string;
|
|
3476
|
+
"paymentMethods.missing.action": string;
|
|
3338
3477
|
"businessForm.sections.segments": string;
|
|
3339
3478
|
"businessForm.archived": string;
|
|
3340
3479
|
"businessForm.segment": string;
|
package/dist/i18n/pt.js
CHANGED
|
@@ -24,7 +24,8 @@ var buildCreateAppointmentSchema = (messages = {}) => {
|
|
|
24
24
|
};
|
|
25
25
|
return zod.z.object({
|
|
26
26
|
client_id: zod.z.number().int().positive().optional(),
|
|
27
|
-
|
|
27
|
+
// Optional (may be ""): a client can be booked without a number.
|
|
28
|
+
phone_number: zod.z.string().min(10, resolved.invalidPhone).max(20).regex(phoneRegex, resolved.invalidPhone).optional().or(zod.z.literal("")),
|
|
28
29
|
appointment_date: zod.z.string().regex(/^\d{2}\/\d{2}\/\d{4}$/, resolved.invalidDate),
|
|
29
30
|
appointment_time: zod.z.string().regex(/^\d{2}:\d{2}$/, resolved.invalidTime),
|
|
30
31
|
professional_id: zod.z.number().int().positive().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/constants/regex.ts","../../src/core/schemas/create-appointment.ts"],"names":["z"],"mappings":";;;;;;;AAMO,IAAM,UAAA,GACX,4DAAA;AAKK,IAAM,YAAA,GAAe,SAAA;AACrB,IAAM,kBAAA,GAAqB,+BAAA;AAE3B,IAAM,QAAA,GAAW,CAAC,KAAA,KACvB,YAAA,CAAa,KAAK,KAAK,CAAA,IAAK,kBAAA,CAAmB,IAAA,CAAK,KAAK,CAAA;;;ACL3D,IAAM,0CAAA,GACJ;AAAA,EACE,YAAA,EAAc,0BAAA;AAAA,EACd,WAAA,EAAa,oCAAA;AAAA,EACb,WAAA,EAAa,oCAAA;AAAA,EACb,MAAA,EAAQ;AACV,CAAA;AAEK,IAAM,4BAAA,GAA+B,CAC1C,QAAA,GAAqD,EAAC,KACnD;AACH,EAAA,MAAM,QAAA,GAAW;AAAA,IACf,GAAG,0CAAA;AAAA,IACH,GAAG;AAAA,GACL;AAEA,EAAA,OAAOA,MA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AAS,WAAW,CAAA;AAAA,IACxE,eAAA,EAAiBA,MAAE,MAAA,EAAO,CAAE,KAAI,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,IACtD,UAAA,EAAYA,MAAE,MAAA,EAAO,CAAE,KAAI,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,IACjD,KAAA,EAAOA,KAAA,CACJ,MAAA,EAAO,CACP,OAAO,CAAC,KAAA,KAAU,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG,QAAA,CAAS,MAAM,EACnD,QAAA;AAAS,GACb,CAAA;AACH;AAEO,IAAM,0BAA0B,4BAAA","file":"create-appointment.cjs","sourcesContent":["/**\n * SOURCE OF TRUTH: Do not duplicate these patterns across apps.\n */\nexport const passwordRegex =\n /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!/@$%^&*-]).{6,}$/;\n\nexport const phoneRegex =\n /^(\\+?\\d{1,3}[\\s-]?)?(\\(?\\d{1,4}\\)?[\\s-]?)?[\\d\\s-]{5,15}\\d$/;\n\n/** Full date of birth, e.g. \"1990-08-15\". */\nexport const birthdayRegex = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nexport const htmlTagRegex = /<[^>]*>/;\nexport const scriptPatternRegex = /javascript:|data:|vbscript:/gi;\n\nexport const isUnsafe = (value: string): boolean =>\n htmlTagRegex.test(value) || scriptPatternRegex.test(value);\n","import { z } from \"zod\";\n\nimport { isUnsafe, phoneRegex } from \"../constants/regex\";\n\nexport interface CreateAppointmentSchemaMessages {\n invalidPhone: string;\n invalidDate: string;\n invalidTime: string;\n unsafe: string;\n}\n\nconst DEFAULT_CREATE_APPOINTMENT_SCHEMA_MESSAGES: CreateAppointmentSchemaMessages =\n {\n invalidPhone: \"validation.phone.invalid\",\n invalidDate: \"appointment.new.errors.invalidDate\",\n invalidTime: \"appointment.new.errors.invalidTime\",\n unsafe: \"validation.unsafe\",\n };\n\nexport const buildCreateAppointmentSchema = (\n messages: Partial<CreateAppointmentSchemaMessages> = {}\n) => {\n const resolved = {\n ...DEFAULT_CREATE_APPOINTMENT_SCHEMA_MESSAGES,\n ...messages,\n };\n\n return z.object({\n client_id: z.number().int().positive().optional(),\n // Optional (may be \"\"): a client can be booked without a number.\n phone_number: z\n .string()\n .min(10, resolved.invalidPhone)\n .max(20)\n .regex(phoneRegex, resolved.invalidPhone)\n .optional()\n .or(z.literal(\"\")),\n appointment_date: z\n .string()\n .regex(/^\\d{2}\\/\\d{2}\\/\\d{4}$/, resolved.invalidDate),\n appointment_time: z.string().regex(/^\\d{2}:\\d{2}$/, resolved.invalidTime),\n professional_id: z.number().int().positive().optional(),\n service_id: z.number().int().positive().optional(),\n notes: z\n .string()\n .refine((value) => !isUnsafe(value), resolved.unsafe)\n .optional(),\n });\n};\n\nexport const createAppointmentSchema = buildCreateAppointmentSchema();\n\nexport type CreateAppointmentFormValues = z.infer<\n typeof createAppointmentSchema\n>;\n"]}
|
|
@@ -8,7 +8,7 @@ interface CreateAppointmentSchemaMessages {
|
|
|
8
8
|
}
|
|
9
9
|
declare const buildCreateAppointmentSchema: (messages?: Partial<CreateAppointmentSchemaMessages>) => z.ZodObject<{
|
|
10
10
|
client_id: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
phone_number: z.ZodString
|
|
11
|
+
phone_number: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
12
12
|
appointment_date: z.ZodString;
|
|
13
13
|
appointment_time: z.ZodString;
|
|
14
14
|
professional_id: z.ZodOptional<z.ZodNumber>;
|
|
@@ -17,7 +17,7 @@ declare const buildCreateAppointmentSchema: (messages?: Partial<CreateAppointmen
|
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
declare const createAppointmentSchema: z.ZodObject<{
|
|
19
19
|
client_id: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
phone_number: z.ZodString
|
|
20
|
+
phone_number: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
21
21
|
appointment_date: z.ZodString;
|
|
22
22
|
appointment_time: z.ZodString;
|
|
23
23
|
professional_id: z.ZodOptional<z.ZodNumber>;
|
|
@@ -8,7 +8,7 @@ interface CreateAppointmentSchemaMessages {
|
|
|
8
8
|
}
|
|
9
9
|
declare const buildCreateAppointmentSchema: (messages?: Partial<CreateAppointmentSchemaMessages>) => z.ZodObject<{
|
|
10
10
|
client_id: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
phone_number: z.ZodString
|
|
11
|
+
phone_number: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
12
12
|
appointment_date: z.ZodString;
|
|
13
13
|
appointment_time: z.ZodString;
|
|
14
14
|
professional_id: z.ZodOptional<z.ZodNumber>;
|
|
@@ -17,7 +17,7 @@ declare const buildCreateAppointmentSchema: (messages?: Partial<CreateAppointmen
|
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
declare const createAppointmentSchema: z.ZodObject<{
|
|
19
19
|
client_id: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
phone_number: z.ZodString
|
|
20
|
+
phone_number: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
21
21
|
appointment_date: z.ZodString;
|
|
22
22
|
appointment_time: z.ZodString;
|
|
23
23
|
professional_id: z.ZodOptional<z.ZodNumber>;
|
|
@@ -14,7 +14,8 @@ var buildCreateAppointmentSchema = (messages = {}) => {
|
|
|
14
14
|
};
|
|
15
15
|
return z.object({
|
|
16
16
|
client_id: z.number().int().positive().optional(),
|
|
17
|
-
|
|
17
|
+
// Optional (may be ""): a client can be booked without a number.
|
|
18
|
+
phone_number: z.string().min(10, resolved.invalidPhone).max(20).regex(phoneRegex, resolved.invalidPhone).optional().or(z.literal("")),
|
|
18
19
|
appointment_date: z.string().regex(/^\d{2}\/\d{2}\/\d{4}$/, resolved.invalidDate),
|
|
19
20
|
appointment_time: z.string().regex(/^\d{2}:\d{2}$/, resolved.invalidTime),
|
|
20
21
|
professional_id: z.number().int().positive().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/schemas/create-appointment.ts"],"names":[],"mappings":";;;AAWA,IAAM,0CAAA,GACJ;AAAA,EACE,YAAA,EAAc,0BAAA;AAAA,EACd,WAAA,EAAa,oCAAA;AAAA,EACb,WAAA,EAAa,oCAAA;AAAA,EACb,MAAA,EAAQ;AACV,CAAA;AAEK,IAAM,4BAAA,GAA+B,CAC1C,QAAA,GAAqD,EAAC,KACnD;AACH,EAAA,MAAM,QAAA,GAAW;AAAA,IACf,GAAG,0CAAA;AAAA,IACH,GAAG;AAAA,GACL;AAEA,EAAA,OAAO,EAAE,MAAA,CAAO;AAAA,IACd,SAAA,EAAW,EAAE,MAAA,EAAO,CAAE,KAAI,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/core/schemas/create-appointment.ts"],"names":[],"mappings":";;;AAWA,IAAM,0CAAA,GACJ;AAAA,EACE,YAAA,EAAc,0BAAA;AAAA,EACd,WAAA,EAAa,oCAAA;AAAA,EACb,WAAA,EAAa,oCAAA;AAAA,EACb,MAAA,EAAQ;AACV,CAAA;AAEK,IAAM,4BAAA,GAA+B,CAC1C,QAAA,GAAqD,EAAC,KACnD;AACH,EAAA,MAAM,QAAA,GAAW;AAAA,IACf,GAAG,0CAAA;AAAA,IACH,GAAG;AAAA,GACL;AAEA,EAAA,OAAO,EAAE,MAAA,CAAO;AAAA,IACd,SAAA,EAAW,EAAE,MAAA,EAAO,CAAE,KAAI,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA;AAAA,IAEhD,YAAA,EAAc,EACX,MAAA,EAAO,CACP,IAAI,EAAA,EAAI,QAAA,CAAS,YAAY,CAAA,CAC7B,GAAA,CAAI,EAAE,EACN,KAAA,CAAM,UAAA,EAAY,QAAA,CAAS,YAAY,CAAA,CACvC,QAAA,GACA,EAAA,CAAG,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAC,CAAA;AAAA,IACnB,kBAAkB,CAAA,CACf,MAAA,GACA,KAAA,CAAM,uBAAA,EAAyB,SAAS,WAAW,CAAA;AAAA,IACtD,kBAAkB,CAAA,CAAE,MAAA,GAAS,KAAA,CAAM,eAAA,EAAiB,SAAS,WAAW,CAAA;AAAA,IACxE,eAAA,EAAiB,EAAE,MAAA,EAAO,CAAE,KAAI,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,IACtD,UAAA,EAAY,EAAE,MAAA,EAAO,CAAE,KAAI,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,IACjD,KAAA,EAAO,CAAA,CACJ,MAAA,EAAO,CACP,OAAO,CAAC,KAAA,KAAU,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG,QAAA,CAAS,MAAM,EACnD,QAAA;AAAS,GACb,CAAA;AACH;AAEO,IAAM,0BAA0B,4BAAA","file":"create-appointment.js","sourcesContent":["import { z } from \"zod\";\n\nimport { isUnsafe, phoneRegex } from \"../constants/regex\";\n\nexport interface CreateAppointmentSchemaMessages {\n invalidPhone: string;\n invalidDate: string;\n invalidTime: string;\n unsafe: string;\n}\n\nconst DEFAULT_CREATE_APPOINTMENT_SCHEMA_MESSAGES: CreateAppointmentSchemaMessages =\n {\n invalidPhone: \"validation.phone.invalid\",\n invalidDate: \"appointment.new.errors.invalidDate\",\n invalidTime: \"appointment.new.errors.invalidTime\",\n unsafe: \"validation.unsafe\",\n };\n\nexport const buildCreateAppointmentSchema = (\n messages: Partial<CreateAppointmentSchemaMessages> = {}\n) => {\n const resolved = {\n ...DEFAULT_CREATE_APPOINTMENT_SCHEMA_MESSAGES,\n ...messages,\n };\n\n return z.object({\n client_id: z.number().int().positive().optional(),\n // Optional (may be \"\"): a client can be booked without a number.\n phone_number: z\n .string()\n .min(10, resolved.invalidPhone)\n .max(20)\n .regex(phoneRegex, resolved.invalidPhone)\n .optional()\n .or(z.literal(\"\")),\n appointment_date: z\n .string()\n .regex(/^\\d{2}\\/\\d{2}\\/\\d{4}$/, resolved.invalidDate),\n appointment_time: z.string().regex(/^\\d{2}:\\d{2}$/, resolved.invalidTime),\n professional_id: z.number().int().positive().optional(),\n service_id: z.number().int().positive().optional(),\n notes: z\n .string()\n .refine((value) => !isUnsafe(value), resolved.unsafe)\n .optional(),\n });\n};\n\nexport const createAppointmentSchema = buildCreateAppointmentSchema();\n\nexport type CreateAppointmentFormValues = z.infer<\n typeof createAppointmentSchema\n>;\n"]}
|
|
@@ -55,7 +55,8 @@ var buildCreateClientSchema = (messages = {}) => {
|
|
|
55
55
|
// Optional (may be ""): many clients, e.g. imported phone contacts, only
|
|
56
56
|
// have a first name.
|
|
57
57
|
lastname: zod.z.string().max(255),
|
|
58
|
-
|
|
58
|
+
// Optional (may be ""): not every client gives a number.
|
|
59
|
+
phone: zod.z.string().min(10, resolved.invalidPhone).max(20).regex(phoneRegex, resolved.invalidPhone).optional().or(zod.z.literal("")),
|
|
59
60
|
email: zod.z.email(resolved.invalidEmail).max(255).optional().or(zod.z.literal("")),
|
|
60
61
|
notes: zod.z.string().refine((value) => !isUnsafe(value), resolved.unsafe).optional(),
|
|
61
62
|
/** Full date of birth, e.g. "1990-08-15". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/constants/age.ts","../../src/core/constants/regex.ts","../../src/core/utils/date.ts","../../src/core/schemas/create-client.ts"],"names":["dayjs","localizedFormat","localeData","z"],"mappings":";;;;;;;;;;;;;;;;AAIO,IAAM,OAAA,GAAU,EAAA;;;ACEhB,IAAM,UAAA,GACX,4DAAA;AAGK,IAAM,aAAA,GAAgB,qBAAA;AAEtB,IAAM,YAAA,GAAe,SAAA;AACrB,IAAM,kBAAA,GAAqB,+BAAA;AAE3B,IAAM,QAAA,GAAW,CAAC,KAAA,KACvB,YAAA,CAAa,KAAK,KAAK,CAAA,IAAK,kBAAA,CAAmB,IAAA,CAAK,KAAK,CAAA;ACZ3DA,sBAAA,CAAM,OAAOC,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AAWA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAG,QAAA,CAAS,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA;AAAA;AAAA;AAAA,IAGvD,QAAA,EAAUA,KAAA,CAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/core/constants/age.ts","../../src/core/constants/regex.ts","../../src/core/utils/date.ts","../../src/core/schemas/create-client.ts"],"names":["dayjs","localizedFormat","localeData","z"],"mappings":";;;;;;;;;;;;;;;;AAIO,IAAM,OAAA,GAAU,EAAA;;;ACEhB,IAAM,UAAA,GACX,4DAAA;AAGK,IAAM,aAAA,GAAgB,qBAAA;AAEtB,IAAM,YAAA,GAAe,SAAA;AACrB,IAAM,kBAAA,GAAqB,+BAAA;AAE3B,IAAM,QAAA,GAAW,CAAC,KAAA,KACvB,YAAA,CAAa,KAAK,KAAK,CAAA,IAAK,kBAAA,CAAmB,IAAA,CAAK,KAAK,CAAA;ACZ3DA,sBAAA,CAAM,OAAOC,gCAAe,CAAA;AAC5BD,sBAAA,CAAM,OAAOE,2BAAU,CAAA;AAOhB,SAAS,aAAa,QAAA,EAA0B;AACrD,EAAA,OAAOF,wBAAM,CAAE,IAAA,CAAKA,sBAAA,CAAM,QAAQ,GAAG,MAAM,CAAA;AAC7C;AAMO,SAAS,oBAAoB,KAAA,EAAwB;AAC1D,EAAA,MAAM,KAAA,GAAQ,2BAAA,CAA4B,IAAA,CAAK,KAAK,CAAA;AACpD,EAAA,IAAI,CAAC,OAAO,OAAO,KAAA;AAEnB,EAAA,MAAM,GAAG,OAAA,EAAS,QAAA,EAAU,MAAM,CAAA,GAAI,KAAA;AACtC,EAAA,MAAM,IAAA,GAAO,OAAO,OAAO,CAAA;AAC3B,EAAA,MAAM,KAAA,GAAQ,OAAO,QAAQ,CAAA;AAC7B,EAAA,MAAM,GAAA,GAAM,OAAO,MAAM,CAAA;AAEzB,EAAA,MAAM,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AAA,CAAGA,KAAA,CAAE,OAAA,CAAQ,EAAE,CAAC,CAAA;AAAA,IAC1E,KAAA,EAAOA,KAAA,CACJ,MAAA,EAAO,CACP,OAAO,CAAC,KAAA,KAAU,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG,QAAA,CAAS,MAAM,EACnD,QAAA,EAAS;AAAA;AAAA,IAEZ,QAAA,EAAUA,MACP,MAAA,EAAO,CACP,MAAM,aAAA,EAAe,QAAA,CAAS,eAAe,CAAA,CAC7C,MAAA,CAAO,mBAAA,EAAqB,EAAE,OAAA,EAAS,QAAA,CAAS,eAAA,EAAiB,CAAA,CACjE,MAAA,CAAO,CAAC,KAAA,KAAU,YAAA,CAAa,KAAK,CAAA,IAAK,OAAA,EAAS;AAAA,MACjD,SAAS,QAAA,CAAS;AAAA,KACnB,EACA,QAAA,EAAS,CACT,GAAGA,KAAA,CAAE,OAAA,CAAQ,EAAE,CAAC;AAAA,GACpB,CAAA;AACH;AAEO,IAAM,qBAAqB,uBAAA","file":"create-client.cjs","sourcesContent":["/**\n * SOURCE OF TRUTH: Do not duplicate this value across apps.\n * Minimum age (in years) required by forms that collect a person's date of birth.\n */\nexport const MIN_AGE = 18;\n","/**\n * SOURCE OF TRUTH: Do not duplicate these patterns across apps.\n */\nexport const passwordRegex =\n /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!/@$%^&*-]).{6,}$/;\n\nexport const phoneRegex =\n /^(\\+?\\d{1,3}[\\s-]?)?(\\(?\\d{1,4}\\)?[\\s-]?)?[\\d\\s-]{5,15}\\d$/;\n\n/** Full date of birth, e.g. \"1990-08-15\". */\nexport const birthdayRegex = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nexport const htmlTagRegex = /<[^>]*>/;\nexport const scriptPatternRegex = /javascript:|data:|vbscript:/gi;\n\nexport const isUnsafe = (value: string): boolean =>\n htmlTagRegex.test(value) || scriptPatternRegex.test(value);\n","import dayjs from \"dayjs\";\nimport localeData from \"dayjs/plugin/localeData.js\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat.js\";\n\ndayjs.extend(localizedFormat);\ndayjs.extend(localeData);\n\nexport function addDays(date: Date, days: number): Date {\n return dayjs(date).add(days, \"day\").toDate();\n}\n\n/** Full years elapsed since a \"YYYY-MM-DD\" birthday, as of today. */\nexport function calculateAge(birthday: string): number {\n return dayjs().diff(dayjs(birthday), \"year\");\n}\n\n/**\n * Whether a \"YYYY-MM-DD\" string is a real calendar date (rejects e.g. \"2024-02-30\"\n * or \"2024-13-01\", which a shape-only regex like `birthdayRegex` would let through).\n */\nexport function isValidCalendarDate(value: string): boolean {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value);\n if (!match) return false;\n\n const [, yearStr, monthStr, dayStr] = match;\n const year = Number(yearStr);\n const month = Number(monthStr);\n const day = Number(dayStr);\n\n const date = new Date(year, month - 1, day);\n return (\n date.getFullYear() === year &&\n date.getMonth() === month - 1 &&\n date.getDate() === day\n );\n}\n\n/** Converts a \"YYYY-MM-DD\" value to \"DD/MM/YYYY\" for masked-input display. Empty in, empty out. */\nexport function isoToDisplayDate(iso: string): string {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(iso);\n if (!match) return \"\";\n\n const [, year, month, day] = match;\n return `${day}/${month}/${year}`;\n}\n\n/**\n * Converts the raw digits typed into a DD/MM/YYYY mask (e.g. \"15081990\") into\n * \"YYYY-MM-DD\". Returns \"\" until all 8 digits have been entered.\n */\nexport function maskedDigitsToIsoDate(digits: string): string {\n if (digits.length !== 8) return \"\";\n\n const day = digits.slice(0, 2);\n const month = digits.slice(2, 4);\n const year = digits.slice(4, 8);\n return `${year}-${month}-${day}`;\n}\n\nexport function toDateString(date: Date): string {\n return dayjs(date).format(\"YYYY-MM-DD\");\n}\n\nexport function parseDateParts(dateString: string): {\n month: string;\n day: string;\n} {\n const date = dayjs(dateString);\n return {\n month: date.format(\"MMM\").toUpperCase(),\n day: date.format(\"D\"),\n };\n}\n\nexport function formatMonthDay(dateString: string): string {\n return dayjs(dateString).format(\"MMM D\");\n}\n\nexport function formatTime12h(time: string): string {\n return dayjs(`1970-01-01 ${time}`).format(\"h:mm a\");\n}\n\nexport function addMinutesToTime(time: string, minutes: number): string {\n return dayjs(`1970-01-01 ${time}`).add(minutes, \"minute\").format(\"HH:mm\");\n}\n\n/** Formats a date using the active dayjs locale (e.g. DD/MM/YYYY for pt-br, MM/DD/YYYY for en). */\nexport function formatLocalizedDate(\n date: Date | string | null | undefined,\n): string {\n if (!date) return \"—\";\n return dayjs(date).format(\"L\");\n}\n\n/** Formats a date and time using the active dayjs locale. */\nexport function formatLocalizedDateTime(\n date: Date | string | null | undefined,\n): string {\n if (!date) return \"—\";\n return dayjs(date).format(\"L LT\");\n}\n\n/** Day/month order for the active dayjs locale, derived from its full date pattern (e.g. \"DD/MM\" for pt-br, \"MM/DD\" for en). */\nfunction localizedShortDatePattern(): string {\n const longFormat = dayjs.localeData().longDateFormat(\"L\");\n return longFormat\n .replace(/^[,./\\-\\s]*Y+[,./\\-\\s]*/, \"\")\n .replace(/[,./\\-\\s]*Y+[,./\\-\\s]*$/, \"\");\n}\n\n/** Formats a date as day/month (no year), in the order the active dayjs locale uses. */\nexport function formatLocalizedShortDate(\n date: Date | string | null | undefined,\n): string {\n if (!date) return \"—\";\n return dayjs(date).format(localizedShortDatePattern());\n}\n","import { z } from \"zod\";\n\nimport { MIN_AGE } from \"../constants/age\";\nimport { birthdayRegex, isUnsafe, phoneRegex } from \"../constants/regex\";\nimport { calculateAge, isValidCalendarDate } from \"../utils/date\";\n\n/** Minimum age for a client record (business/legal-contract capacity). */\nexport const MIN_CLIENT_AGE = MIN_AGE;\n\nexport interface CreateClientSchemaMessages {\n required: string;\n invalidPhone: string;\n invalidEmail: string;\n unsafe: string;\n invalidBirthday: string;\n underage: string;\n}\n\nconst DEFAULT_CREATE_CLIENT_SCHEMA_MESSAGES: CreateClientSchemaMessages = {\n required: \"validation.required\",\n invalidPhone: \"validation.phone.invalid\",\n invalidEmail: \"validation.email.invalid\",\n unsafe: \"validation.unsafe\",\n invalidBirthday: \"validation.birthday.invalid\",\n underage: \"validation.birthday.underage\",\n};\n\nexport const buildCreateClientSchema = (\n messages: Partial<CreateClientSchemaMessages> = {}\n) => {\n const resolved = { ...DEFAULT_CREATE_CLIENT_SCHEMA_MESSAGES, ...messages };\n\n return z.object({\n firstname: z.string().min(1, resolved.required).max(255),\n // Optional (may be \"\"): many clients, e.g. imported phone contacts, only\n // have a first name.\n lastname: z.string().max(255),\n // Optional (may be \"\"): not every client gives a number.\n phone: z\n .string()\n .min(10, resolved.invalidPhone)\n .max(20)\n .regex(phoneRegex, resolved.invalidPhone)\n .optional()\n .or(z.literal(\"\")),\n email: z.email(resolved.invalidEmail).max(255).optional().or(z.literal(\"\")),\n notes: z\n .string()\n .refine((value) => !isUnsafe(value), resolved.unsafe)\n .optional(),\n /** Full date of birth, e.g. \"1990-08-15\". */\n birthday: z\n .string()\n .regex(birthdayRegex, resolved.invalidBirthday)\n .refine(isValidCalendarDate, { message: resolved.invalidBirthday })\n .refine((value) => calculateAge(value) >= MIN_AGE, {\n message: resolved.underage,\n })\n .optional()\n .or(z.literal(\"\")),\n });\n};\n\nexport const createClientSchema = buildCreateClientSchema();\n\nexport type CreateClientFormValues = z.infer<typeof createClientSchema>;\n"]}
|
|
@@ -13,7 +13,7 @@ interface CreateClientSchemaMessages {
|
|
|
13
13
|
declare const buildCreateClientSchema: (messages?: Partial<CreateClientSchemaMessages>) => z.ZodObject<{
|
|
14
14
|
firstname: z.ZodString;
|
|
15
15
|
lastname: z.ZodString;
|
|
16
|
-
phone: z.ZodString
|
|
16
|
+
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
17
17
|
email: z.ZodUnion<[z.ZodOptional<z.ZodEmail>, z.ZodLiteral<"">]>;
|
|
18
18
|
notes: z.ZodOptional<z.ZodString>;
|
|
19
19
|
birthday: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -21,7 +21,7 @@ declare const buildCreateClientSchema: (messages?: Partial<CreateClientSchemaMes
|
|
|
21
21
|
declare const createClientSchema: z.ZodObject<{
|
|
22
22
|
firstname: z.ZodString;
|
|
23
23
|
lastname: z.ZodString;
|
|
24
|
-
phone: z.ZodString
|
|
24
|
+
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
25
25
|
email: z.ZodUnion<[z.ZodOptional<z.ZodEmail>, z.ZodLiteral<"">]>;
|
|
26
26
|
notes: z.ZodOptional<z.ZodString>;
|
|
27
27
|
birthday: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -13,7 +13,7 @@ interface CreateClientSchemaMessages {
|
|
|
13
13
|
declare const buildCreateClientSchema: (messages?: Partial<CreateClientSchemaMessages>) => z.ZodObject<{
|
|
14
14
|
firstname: z.ZodString;
|
|
15
15
|
lastname: z.ZodString;
|
|
16
|
-
phone: z.ZodString
|
|
16
|
+
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
17
17
|
email: z.ZodUnion<[z.ZodOptional<z.ZodEmail>, z.ZodLiteral<"">]>;
|
|
18
18
|
notes: z.ZodOptional<z.ZodString>;
|
|
19
19
|
birthday: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -21,7 +21,7 @@ declare const buildCreateClientSchema: (messages?: Partial<CreateClientSchemaMes
|
|
|
21
21
|
declare const createClientSchema: z.ZodObject<{
|
|
22
22
|
firstname: z.ZodString;
|
|
23
23
|
lastname: z.ZodString;
|
|
24
|
-
phone: z.ZodString
|
|
24
|
+
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
25
25
|
email: z.ZodUnion<[z.ZodOptional<z.ZodEmail>, z.ZodLiteral<"">]>;
|
|
26
26
|
notes: z.ZodOptional<z.ZodString>;
|
|
27
27
|
birthday: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -19,7 +19,8 @@ var buildCreateClientSchema = (messages = {}) => {
|
|
|
19
19
|
// Optional (may be ""): many clients, e.g. imported phone contacts, only
|
|
20
20
|
// have a first name.
|
|
21
21
|
lastname: z.string().max(255),
|
|
22
|
-
|
|
22
|
+
// Optional (may be ""): not every client gives a number.
|
|
23
|
+
phone: z.string().min(10, resolved.invalidPhone).max(20).regex(phoneRegex, resolved.invalidPhone).optional().or(z.literal("")),
|
|
23
24
|
email: z.email(resolved.invalidEmail).max(255).optional().or(z.literal("")),
|
|
24
25
|
notes: z.string().refine((value) => !isUnsafe(value), resolved.unsafe).optional(),
|
|
25
26
|
/** Full date of birth, e.g. "1990-08-15". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/schemas/create-client.ts"],"names":[],"mappings":";;;;;AAOO,IAAM,cAAA,GAAiB;AAW9B,IAAM,qCAAA,GAAoE;AAAA,EACxE,QAAA,EAAU,qBAAA;AAAA,EACV,YAAA,EAAc,0BAAA;AAAA,EACd,YAAA,EAAc,0BAAA;AAAA,EACd,MAAA,EAAQ,mBAAA;AAAA,EACR,eAAA,EAAiB,6BAAA;AAAA,EACjB,QAAA,EAAU;AACZ,CAAA;AAEO,IAAM,uBAAA,GAA0B,CACrC,QAAA,GAAgD,EAAC,KAC9C;AACH,EAAA,MAAM,QAAA,GAAW,EAAE,GAAG,qCAAA,EAAuC,GAAG,QAAA,EAAS;AAEzE,EAAA,OAAO,EAAE,MAAA,CAAO;AAAA,IACd,SAAA,EAAW,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAG,QAAA,CAAS,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA;AAAA;AAAA;AAAA,IAGvD,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA;AAAA,
|
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AS,MAAM,EACnD,QAAA,EAAS;AAAA;AAAA,IAEZ,QAAA,EAAU,EACP,MAAA,EAAO,CACP,MAAM,aAAA,EAAe,QAAA,CAAS,eAAe,CAAA,CAC7C,MAAA,CAAO,mBAAA,EAAqB,EAAE,OAAA,EAAS,QAAA,CAAS,eAAA,EAAiB,CAAA,CACjE,MAAA,CAAO,CAAC,KAAA,KAAU,YAAA,CAAa,KAAK,CAAA,IAAK,OAAA,EAAS;AAAA,MACjD,SAAS,QAAA,CAAS;AAAA,KACnB,EACA,QAAA,EAAS,CACT,GAAG,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAC;AAAA,GACpB,CAAA;AACH;AAEO,IAAM,qBAAqB,uBAAA","file":"create-client.js","sourcesContent":["import { z } from \"zod\";\n\nimport { MIN_AGE } from \"../constants/age\";\nimport { birthdayRegex, isUnsafe, phoneRegex } from \"../constants/regex\";\nimport { calculateAge, isValidCalendarDate } from \"../utils/date\";\n\n/** Minimum age for a client record (business/legal-contract capacity). */\nexport const MIN_CLIENT_AGE = MIN_AGE;\n\nexport interface CreateClientSchemaMessages {\n required: string;\n invalidPhone: string;\n invalidEmail: string;\n unsafe: string;\n invalidBirthday: string;\n underage: string;\n}\n\nconst DEFAULT_CREATE_CLIENT_SCHEMA_MESSAGES: CreateClientSchemaMessages = {\n required: \"validation.required\",\n invalidPhone: \"validation.phone.invalid\",\n invalidEmail: \"validation.email.invalid\",\n unsafe: \"validation.unsafe\",\n invalidBirthday: \"validation.birthday.invalid\",\n underage: \"validation.birthday.underage\",\n};\n\nexport const buildCreateClientSchema = (\n messages: Partial<CreateClientSchemaMessages> = {}\n) => {\n const resolved = { ...DEFAULT_CREATE_CLIENT_SCHEMA_MESSAGES, ...messages };\n\n return z.object({\n firstname: z.string().min(1, resolved.required).max(255),\n // Optional (may be \"\"): many clients, e.g. imported phone contacts, only\n // have a first name.\n lastname: z.string().max(255),\n // Optional (may be \"\"): not every client gives a number.\n phone: z\n .string()\n .min(10, resolved.invalidPhone)\n .max(20)\n .regex(phoneRegex, resolved.invalidPhone)\n .optional()\n .or(z.literal(\"\")),\n email: z.email(resolved.invalidEmail).max(255).optional().or(z.literal(\"\")),\n notes: z\n .string()\n .refine((value) => !isUnsafe(value), resolved.unsafe)\n .optional(),\n /** Full date of birth, e.g. \"1990-08-15\". */\n birthday: z\n .string()\n .regex(birthdayRegex, resolved.invalidBirthday)\n .refine(isValidCalendarDate, { message: resolved.invalidBirthday })\n .refine((value) => calculateAge(value) >= MIN_AGE, {\n message: resolved.underage,\n })\n .optional()\n .or(z.literal(\"\")),\n });\n};\n\nexport const createClientSchema = buildCreateClientSchema();\n\nexport type CreateClientFormValues = z.infer<typeof createClientSchema>;\n"]}
|
|
@@ -5,7 +5,6 @@ var zod = require('zod');
|
|
|
5
5
|
// src/core/schemas/expense-form.ts
|
|
6
6
|
var DEFAULT_EXPENSE_FORM_MESSAGES = {
|
|
7
7
|
descriptionRequired: "expenses.validation.description.required",
|
|
8
|
-
categoryRequired: "expenses.validation.category.required",
|
|
9
8
|
amountRequired: "expenses.validation.amount.required",
|
|
10
9
|
invalidAmount: "expenses.validation.amount.invalid",
|
|
11
10
|
paymentDateRequired: "expenses.validation.paymentDate.required"
|
|
@@ -16,7 +15,8 @@ var createExpenseFormSchema = (messages = {}) => {
|
|
|
16
15
|
const resolved = { ...DEFAULT_EXPENSE_FORM_MESSAGES, ...messages };
|
|
17
16
|
return zod.z.object({
|
|
18
17
|
description: zod.z.string().min(1, resolved.descriptionRequired).max(255),
|
|
19
|
-
|
|
18
|
+
// Optional: an expense can go without a category.
|
|
19
|
+
category_id: zod.z.number().int().positive().nullable().default(null),
|
|
20
20
|
payment_type: expensePaymentTypeSchema.default("one_time"),
|
|
21
21
|
payment_date: zod.z.string().min(1, resolved.paymentDateRequired),
|
|
22
22
|
amount: zod.z.string().min(1, resolved.amountRequired).regex(/^\d+(\.\d{1,2})?$/, resolved.invalidAmount),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/schemas/expense-form.ts"],"names":["z"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/core/schemas/expense-form.ts"],"names":["z"],"mappings":";;;;;AASA,IAAM,6BAAA,GAA2D;AAAA,EAC/D,mBAAA,EAAqB,0CAAA;AAAA,EACrB,cAAA,EAAgB,qCAAA;AAAA,EAChB,aAAA,EAAe,oCAAA;AAAA,EACf,mBAAA,EAAqB;AACvB,CAAA;AAEO,IAAM,2BAA2BA,KAAA,CAAE,IAAA,CAAK,CAAC,UAAA,EAAY,WAAW,CAAC;AACjE,IAAM,sBAAsBA,KAAA,CAAE,IAAA,CAAK,CAAC,SAAA,EAAW,MAAM,CAAC;AAEtD,IAAM,uBAAA,GAA0B,CACrC,QAAA,GAA+C,EAAC,KAC7C;AACH,EAAA,MAAM,QAAA,GAAW,EAAE,GAAG,6BAAA,EAA+B,GAAG,QAAA,EAAS;AAEjE,EAAA,OAAOA,MAAE,MAAA,CAAO;AAAA,IACd,WAAA,EAAaA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAG,QAAA,CAAS,mBAAmB,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA;AAAA;AAAA,IAEpE,WAAA,EAAaA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,QAAA,EAAS,CAAE,QAAA,EAAS,CAAE,OAAA,CAAQ,IAAI,CAAA;AAAA,IAChE,YAAA,EAAc,wBAAA,CAAyB,OAAA,CAAQ,UAAU,CAAA;AAAA,IACzD,cAAcA,KAAA,CAAE,MAAA,GAAS,GAAA,CAAI,CAAA,EAAG,SAAS,mBAAmB,CAAA;AAAA,IAC5D,MAAA,EAAQA,KAAA,CACL,MAAA,EAAO,CACP,GAAA,CAAI,CAAA,EAAG,QAAA,CAAS,cAAc,CAAA,CAC9B,KAAA,CAAM,mBAAA,EAAqB,QAAA,CAAS,aAAa,CAAA;AAAA,IACpD,MAAA,EAAQ,mBAAA,CAAoB,OAAA,CAAQ,SAAS,CAAA;AAAA,IAC7C,KAAA,EAAOA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAI,CAAA,CAAE,QAAA,EAAS,CAAE,EAAA,CAAGA,KAAA,CAAE,OAAA,CAAQ,EAAE,CAAC;AAAA,GACxD,CAAA;AACH;AAEO,IAAM,oBAAoB,uBAAA","file":"expense-form.cjs","sourcesContent":["import { z } from \"zod\";\n\nexport interface ExpenseFormSchemaMessages {\n descriptionRequired: string;\n amountRequired: string;\n invalidAmount: string;\n paymentDateRequired: string;\n}\n\nconst DEFAULT_EXPENSE_FORM_MESSAGES: ExpenseFormSchemaMessages = {\n descriptionRequired: \"expenses.validation.description.required\",\n amountRequired: \"expenses.validation.amount.required\",\n invalidAmount: \"expenses.validation.amount.invalid\",\n paymentDateRequired: \"expenses.validation.paymentDate.required\",\n};\n\nexport const expensePaymentTypeSchema = z.enum([\"one_time\", \"recurring\"]);\nexport const expenseStatusSchema = z.enum([\"pending\", \"paid\"]);\n\nexport const createExpenseFormSchema = (\n messages: Partial<ExpenseFormSchemaMessages> = {}\n) => {\n const resolved = { ...DEFAULT_EXPENSE_FORM_MESSAGES, ...messages };\n\n return z.object({\n description: z.string().min(1, resolved.descriptionRequired).max(255),\n // Optional: an expense can go without a category.\n category_id: z.number().int().positive().nullable().default(null),\n payment_type: expensePaymentTypeSchema.default(\"one_time\"),\n payment_date: z.string().min(1, resolved.paymentDateRequired),\n amount: z\n .string()\n .min(1, resolved.amountRequired)\n .regex(/^\\d+(\\.\\d{1,2})?$/, resolved.invalidAmount),\n status: expenseStatusSchema.default(\"pending\"),\n notes: z.string().max(2000).optional().or(z.literal(\"\")),\n });\n};\n\nexport const expenseFormSchema = createExpenseFormSchema();\n\nexport type ExpenseFormValues = z.infer<typeof expenseFormSchema>;\n"]}
|