@agendar/shared 0.1.0 → 0.1.3
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/README.md +36 -10
- package/dist/{chunk-IXJZJJT6.js → chunk-2OENQIJQ.js} +135 -3
- package/dist/chunk-2OENQIJQ.js.map +1 -0
- package/dist/{chunk-ZZQ2WJR4.js → chunk-4HT2MGHE.js} +153 -3
- package/dist/chunk-4HT2MGHE.js.map +1 -0
- package/dist/{chunk-YXJIMNQE.js → chunk-POM3RC7W.js} +4 -4
- package/dist/chunk-POM3RC7W.js.map +1 -0
- package/dist/{chunk-LMKYYUVF.js → chunk-QJYEWLZE.js} +135 -3
- package/dist/chunk-QJYEWLZE.js.map +1 -0
- package/dist/i18n/en.cjs +133 -1
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +132 -0
- package/dist/i18n/en.d.ts +132 -0
- package/dist/i18n/en.js +1 -1
- package/dist/i18n/es.cjs +151 -1
- package/dist/i18n/es.cjs.map +1 -1
- package/dist/i18n/es.d.cts +150 -0
- package/dist/i18n/es.d.ts +150 -0
- package/dist/i18n/es.js +1 -1
- package/dist/i18n/index.cjs +417 -3
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +3 -3
- package/dist/i18n/pt.cjs +133 -1
- package/dist/i18n/pt.cjs.map +1 -1
- package/dist/i18n/pt.d.cts +132 -0
- package/dist/i18n/pt.d.ts +132 -0
- package/dist/i18n/pt.js +1 -1
- package/dist/schemas/create-client.cjs +2 -2
- package/dist/schemas/create-client.cjs.map +1 -1
- package/dist/schemas/create-client.js +1 -1
- package/dist/schemas/register-business-owner-form.cjs +4 -3
- package/dist/schemas/register-business-owner-form.cjs.map +1 -1
- package/dist/schemas/register-business-owner-form.d.cts +1 -0
- package/dist/schemas/register-business-owner-form.d.ts +1 -0
- package/dist/schemas/register-business-owner-form.js +3 -2
- package/dist/schemas/register-business-owner-form.js.map +1 -1
- package/dist/utils/appointments.cjs +2 -2
- package/dist/utils/appointments.cjs.map +1 -1
- package/dist/utils/appointments.js +1 -1
- package/dist/utils/date.cjs +2 -2
- package/dist/utils/date.cjs.map +1 -1
- package/dist/utils/date.js +1 -1
- package/dist/utils/decode-jwt.cjs +2 -2
- package/dist/utils/decode-jwt.cjs.map +1 -1
- package/dist/utils/decode-jwt.js +2 -2
- package/dist/utils/decode-jwt.js.map +1 -1
- package/package.json +9 -2
- package/dist/chunk-IXJZJJT6.js.map +0 -1
- package/dist/chunk-LMKYYUVF.js.map +0 -1
- package/dist/chunk-YXJIMNQE.js.map +0 -1
- package/dist/chunk-ZZQ2WJR4.js.map +0 -1
package/dist/i18n/pt.d.cts
CHANGED
|
@@ -149,6 +149,8 @@ declare const appPT: {
|
|
|
149
149
|
"tab.professionals": string;
|
|
150
150
|
"tab.people": string;
|
|
151
151
|
"tab.discover": string;
|
|
152
|
+
"tab.home": string;
|
|
153
|
+
"tab.profile": string;
|
|
152
154
|
"tab.appointments": string;
|
|
153
155
|
"tab.menu": string;
|
|
154
156
|
"tab.settings": string;
|
|
@@ -279,6 +281,9 @@ declare const appPT: {
|
|
|
279
281
|
"legal.privacy.introduction.title": string;
|
|
280
282
|
"legal.privacy.introduction.content": string;
|
|
281
283
|
"legal.privacy.dataProcessed.title": string;
|
|
284
|
+
"legal.privacy.dataProcessed.accountTitle": string;
|
|
285
|
+
"legal.privacy.dataProcessed.businessTitle": string;
|
|
286
|
+
"legal.privacy.dataProcessed.usageTitle": string;
|
|
282
287
|
"legal.privacy.dataProcessed.account": string;
|
|
283
288
|
"legal.privacy.dataProcessed.business": string;
|
|
284
289
|
"legal.privacy.dataProcessed.usage": string;
|
|
@@ -316,6 +321,19 @@ declare const appPT: {
|
|
|
316
321
|
"legal.terms.governingLaw.title": string;
|
|
317
322
|
"legal.terms.governingLaw.content": string;
|
|
318
323
|
"legal.terms.footer": string;
|
|
324
|
+
"legal.deleteAccount.title": string;
|
|
325
|
+
"legal.deleteAccount.introduction": string;
|
|
326
|
+
"legal.deleteAccount.howTo.title": string;
|
|
327
|
+
"legal.deleteAccount.howTo.app": string;
|
|
328
|
+
"legal.deleteAccount.howTo.web": string;
|
|
329
|
+
"legal.deleteAccount.howTo.email": string;
|
|
330
|
+
"legal.deleteAccount.deleted.title": string;
|
|
331
|
+
"legal.deleteAccount.deleted.account": string;
|
|
332
|
+
"legal.deleteAccount.deleted.soleOwner": string;
|
|
333
|
+
"legal.deleteAccount.deleted.member": string;
|
|
334
|
+
"legal.deleteAccount.retained.title": string;
|
|
335
|
+
"legal.deleteAccount.retained.content": string;
|
|
336
|
+
"legal.deleteAccount.warning": string;
|
|
319
337
|
"legal.support.title": string;
|
|
320
338
|
"legal.support.introduction": string;
|
|
321
339
|
"legal.support.channel.title": string;
|
|
@@ -472,6 +490,10 @@ declare const appPT: {
|
|
|
472
490
|
"clients.detail.appointmentsPerMonth": string;
|
|
473
491
|
"clients.detail.upcoming": string;
|
|
474
492
|
"clients.detail.bookingHistory": string;
|
|
493
|
+
"clients.bookingHistory.empty": string;
|
|
494
|
+
"clients.bookingHistory.error": string;
|
|
495
|
+
"clients.bookingHistory.retry": string;
|
|
496
|
+
"clients.bookingHistory.retryHint": string;
|
|
475
497
|
"clients.detail.viewAll": string;
|
|
476
498
|
"clients.detail.notes": string;
|
|
477
499
|
"clients.detail.newAppointment": string;
|
|
@@ -716,6 +738,10 @@ declare const appPT: {
|
|
|
716
738
|
"professionals.detail.metrics.revenue": string;
|
|
717
739
|
"professionals.detail.upcoming": string;
|
|
718
740
|
"professionals.detail.bookingHistory": string;
|
|
741
|
+
"professionals.bookingHistory.empty": string;
|
|
742
|
+
"professionals.bookingHistory.error": string;
|
|
743
|
+
"professionals.bookingHistory.retry": string;
|
|
744
|
+
"professionals.bookingHistory.retryHint": string;
|
|
719
745
|
"professionals.detail.emptyUpcoming": string;
|
|
720
746
|
"professionals.detail.emptyHistory": string;
|
|
721
747
|
"professionals.detail.viewAll": string;
|
|
@@ -988,6 +1014,7 @@ declare const appPT: {
|
|
|
988
1014
|
"appointment.status.canceled": string;
|
|
989
1015
|
"appointment.status.noShow": string;
|
|
990
1016
|
"appointments.create.success": string;
|
|
1017
|
+
"appointments.create.error": string;
|
|
991
1018
|
"appointments.update.success": string;
|
|
992
1019
|
"appointments.delete.success": string;
|
|
993
1020
|
"appointments.save.error": string;
|
|
@@ -1176,6 +1203,7 @@ declare const appPT: {
|
|
|
1176
1203
|
"establishments.professionals.topPerformers": string;
|
|
1177
1204
|
"common.close": string;
|
|
1178
1205
|
"appointment.new.title": string;
|
|
1206
|
+
"appointment.new.dateUnavailable": string;
|
|
1179
1207
|
"appointment.new.date": string;
|
|
1180
1208
|
"appointment.new.time": string;
|
|
1181
1209
|
"appointment.new.selectTime": string;
|
|
@@ -1884,6 +1912,110 @@ declare const appPT: {
|
|
|
1884
1912
|
WEBHOOK_200_SENT: string;
|
|
1885
1913
|
WEBHOOK_200_STATUS: string;
|
|
1886
1914
|
WHATSAPP_200_TEST: string;
|
|
1915
|
+
ABS_001: string;
|
|
1916
|
+
ABS_002: string;
|
|
1917
|
+
ABS_003: string;
|
|
1918
|
+
ABS_004: string;
|
|
1919
|
+
ABS_005: string;
|
|
1920
|
+
ABS_200: string;
|
|
1921
|
+
ABS_200_DELETE: string;
|
|
1922
|
+
ABS_201: string;
|
|
1923
|
+
AUTH_014: string;
|
|
1924
|
+
AUTH_016: string;
|
|
1925
|
+
AUTH_017: string;
|
|
1926
|
+
AUTH_018: string;
|
|
1927
|
+
AUTH_019: string;
|
|
1928
|
+
AUTH_020: string;
|
|
1929
|
+
AUTH_021: string;
|
|
1930
|
+
AUTH_022: string;
|
|
1931
|
+
AUTH_023: string;
|
|
1932
|
+
AUTH_200_ALL_SESSIONS_REVOKED: string;
|
|
1933
|
+
AUTH_200_CHANGE_PASSWORD: string;
|
|
1934
|
+
AUTH_200_CHANNEL_CHANGED: string;
|
|
1935
|
+
AUTH_200_CHANNEL_VERIFIED: string;
|
|
1936
|
+
AUTH_200_CODE_SENT: string;
|
|
1937
|
+
AUTH_200_SESSION_REVOKED: string;
|
|
1938
|
+
BIZ_001: string;
|
|
1939
|
+
BIZ_002: string;
|
|
1940
|
+
BIZ_003: string;
|
|
1941
|
+
BIZ_004: string;
|
|
1942
|
+
BIZ_200: string;
|
|
1943
|
+
BIZ_200_DELETE: string;
|
|
1944
|
+
BIZ_201: string;
|
|
1945
|
+
CLIENT_005: string;
|
|
1946
|
+
CLIENT_006: string;
|
|
1947
|
+
CLIENT_007: string;
|
|
1948
|
+
CLIENT_008: string;
|
|
1949
|
+
CLIENT_009: string;
|
|
1950
|
+
CLIENT_010: string;
|
|
1951
|
+
CLIENT_011: string;
|
|
1952
|
+
CLIENT_200_BALANCE_ADJUSTED: string;
|
|
1953
|
+
DRAWER_001: string;
|
|
1954
|
+
DRAWER_002: string;
|
|
1955
|
+
DRAWER_003: string;
|
|
1956
|
+
DRAWER_004: string;
|
|
1957
|
+
DRAWER_005: string;
|
|
1958
|
+
DRAWER_201: string;
|
|
1959
|
+
DRAWER_202: string;
|
|
1960
|
+
DRAWER_203: string;
|
|
1961
|
+
DRAWER_204: string;
|
|
1962
|
+
ECAT_001: string;
|
|
1963
|
+
ECAT_001_DUP: string;
|
|
1964
|
+
ECAT_002: string;
|
|
1965
|
+
ECAT_003: string;
|
|
1966
|
+
ECAT_004: string;
|
|
1967
|
+
ECAT_005: string;
|
|
1968
|
+
ECAT_200: string;
|
|
1969
|
+
ECAT_200_DEACTIVATE: string;
|
|
1970
|
+
ECAT_201: string;
|
|
1971
|
+
EXPENSE_001: string;
|
|
1972
|
+
EXPENSE_002: string;
|
|
1973
|
+
EXPENSE_003: string;
|
|
1974
|
+
EXPENSE_004: string;
|
|
1975
|
+
EXPENSE_200: string;
|
|
1976
|
+
EXPENSE_200_DELETE: string;
|
|
1977
|
+
EXPENSE_201: string;
|
|
1978
|
+
HOL_001: string;
|
|
1979
|
+
TAB_001: string;
|
|
1980
|
+
TAB_002: string;
|
|
1981
|
+
TAB_003: string;
|
|
1982
|
+
TAB_004: string;
|
|
1983
|
+
TAB_005: string;
|
|
1984
|
+
TAB_006: string;
|
|
1985
|
+
TAB_007: string;
|
|
1986
|
+
TAB_008: string;
|
|
1987
|
+
TAB_009: string;
|
|
1988
|
+
TAB_010: string;
|
|
1989
|
+
TAB_011: string;
|
|
1990
|
+
TAB_012: string;
|
|
1991
|
+
TAB_013: string;
|
|
1992
|
+
TAB_014: string;
|
|
1993
|
+
TAB_015: string;
|
|
1994
|
+
TAB_016: string;
|
|
1995
|
+
TAB_017: string;
|
|
1996
|
+
TAB_018: string;
|
|
1997
|
+
TAB_019: string;
|
|
1998
|
+
TAB_020: string;
|
|
1999
|
+
TAB_021: string;
|
|
2000
|
+
TAB_022: string;
|
|
2001
|
+
TAB_023: string;
|
|
2002
|
+
TAB_024: string;
|
|
2003
|
+
TAB_025: string;
|
|
2004
|
+
TAB_026: string;
|
|
2005
|
+
TAB_027: string;
|
|
2006
|
+
TAB_200_CANCELED: string;
|
|
2007
|
+
TAB_200_CLOSED: string;
|
|
2008
|
+
TAB_200_ITEM_ADDED: string;
|
|
2009
|
+
TAB_200_ITEM_REMOVED: string;
|
|
2010
|
+
TAB_200_ITEM_UPDATED: string;
|
|
2011
|
+
TAB_200_REOPENED: string;
|
|
2012
|
+
TAB_200_UPDATED: string;
|
|
2013
|
+
TAB_201: string;
|
|
2014
|
+
USER_004: string;
|
|
2015
|
+
USER_005: string;
|
|
2016
|
+
USER_200_CHANNEL_CHANGED: string;
|
|
2017
|
+
USER_200_CHANNEL_CHANGE_STARTED: string;
|
|
2018
|
+
USER_200_DELETE: string;
|
|
1887
2019
|
};
|
|
1888
2020
|
|
|
1889
2021
|
export { appPT };
|
package/dist/i18n/pt.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ declare const appPT: {
|
|
|
149
149
|
"tab.professionals": string;
|
|
150
150
|
"tab.people": string;
|
|
151
151
|
"tab.discover": string;
|
|
152
|
+
"tab.home": string;
|
|
153
|
+
"tab.profile": string;
|
|
152
154
|
"tab.appointments": string;
|
|
153
155
|
"tab.menu": string;
|
|
154
156
|
"tab.settings": string;
|
|
@@ -279,6 +281,9 @@ declare const appPT: {
|
|
|
279
281
|
"legal.privacy.introduction.title": string;
|
|
280
282
|
"legal.privacy.introduction.content": string;
|
|
281
283
|
"legal.privacy.dataProcessed.title": string;
|
|
284
|
+
"legal.privacy.dataProcessed.accountTitle": string;
|
|
285
|
+
"legal.privacy.dataProcessed.businessTitle": string;
|
|
286
|
+
"legal.privacy.dataProcessed.usageTitle": string;
|
|
282
287
|
"legal.privacy.dataProcessed.account": string;
|
|
283
288
|
"legal.privacy.dataProcessed.business": string;
|
|
284
289
|
"legal.privacy.dataProcessed.usage": string;
|
|
@@ -316,6 +321,19 @@ declare const appPT: {
|
|
|
316
321
|
"legal.terms.governingLaw.title": string;
|
|
317
322
|
"legal.terms.governingLaw.content": string;
|
|
318
323
|
"legal.terms.footer": string;
|
|
324
|
+
"legal.deleteAccount.title": string;
|
|
325
|
+
"legal.deleteAccount.introduction": string;
|
|
326
|
+
"legal.deleteAccount.howTo.title": string;
|
|
327
|
+
"legal.deleteAccount.howTo.app": string;
|
|
328
|
+
"legal.deleteAccount.howTo.web": string;
|
|
329
|
+
"legal.deleteAccount.howTo.email": string;
|
|
330
|
+
"legal.deleteAccount.deleted.title": string;
|
|
331
|
+
"legal.deleteAccount.deleted.account": string;
|
|
332
|
+
"legal.deleteAccount.deleted.soleOwner": string;
|
|
333
|
+
"legal.deleteAccount.deleted.member": string;
|
|
334
|
+
"legal.deleteAccount.retained.title": string;
|
|
335
|
+
"legal.deleteAccount.retained.content": string;
|
|
336
|
+
"legal.deleteAccount.warning": string;
|
|
319
337
|
"legal.support.title": string;
|
|
320
338
|
"legal.support.introduction": string;
|
|
321
339
|
"legal.support.channel.title": string;
|
|
@@ -472,6 +490,10 @@ declare const appPT: {
|
|
|
472
490
|
"clients.detail.appointmentsPerMonth": string;
|
|
473
491
|
"clients.detail.upcoming": string;
|
|
474
492
|
"clients.detail.bookingHistory": string;
|
|
493
|
+
"clients.bookingHistory.empty": string;
|
|
494
|
+
"clients.bookingHistory.error": string;
|
|
495
|
+
"clients.bookingHistory.retry": string;
|
|
496
|
+
"clients.bookingHistory.retryHint": string;
|
|
475
497
|
"clients.detail.viewAll": string;
|
|
476
498
|
"clients.detail.notes": string;
|
|
477
499
|
"clients.detail.newAppointment": string;
|
|
@@ -716,6 +738,10 @@ declare const appPT: {
|
|
|
716
738
|
"professionals.detail.metrics.revenue": string;
|
|
717
739
|
"professionals.detail.upcoming": string;
|
|
718
740
|
"professionals.detail.bookingHistory": string;
|
|
741
|
+
"professionals.bookingHistory.empty": string;
|
|
742
|
+
"professionals.bookingHistory.error": string;
|
|
743
|
+
"professionals.bookingHistory.retry": string;
|
|
744
|
+
"professionals.bookingHistory.retryHint": string;
|
|
719
745
|
"professionals.detail.emptyUpcoming": string;
|
|
720
746
|
"professionals.detail.emptyHistory": string;
|
|
721
747
|
"professionals.detail.viewAll": string;
|
|
@@ -988,6 +1014,7 @@ declare const appPT: {
|
|
|
988
1014
|
"appointment.status.canceled": string;
|
|
989
1015
|
"appointment.status.noShow": string;
|
|
990
1016
|
"appointments.create.success": string;
|
|
1017
|
+
"appointments.create.error": string;
|
|
991
1018
|
"appointments.update.success": string;
|
|
992
1019
|
"appointments.delete.success": string;
|
|
993
1020
|
"appointments.save.error": string;
|
|
@@ -1176,6 +1203,7 @@ declare const appPT: {
|
|
|
1176
1203
|
"establishments.professionals.topPerformers": string;
|
|
1177
1204
|
"common.close": string;
|
|
1178
1205
|
"appointment.new.title": string;
|
|
1206
|
+
"appointment.new.dateUnavailable": string;
|
|
1179
1207
|
"appointment.new.date": string;
|
|
1180
1208
|
"appointment.new.time": string;
|
|
1181
1209
|
"appointment.new.selectTime": string;
|
|
@@ -1884,6 +1912,110 @@ declare const appPT: {
|
|
|
1884
1912
|
WEBHOOK_200_SENT: string;
|
|
1885
1913
|
WEBHOOK_200_STATUS: string;
|
|
1886
1914
|
WHATSAPP_200_TEST: string;
|
|
1915
|
+
ABS_001: string;
|
|
1916
|
+
ABS_002: string;
|
|
1917
|
+
ABS_003: string;
|
|
1918
|
+
ABS_004: string;
|
|
1919
|
+
ABS_005: string;
|
|
1920
|
+
ABS_200: string;
|
|
1921
|
+
ABS_200_DELETE: string;
|
|
1922
|
+
ABS_201: string;
|
|
1923
|
+
AUTH_014: string;
|
|
1924
|
+
AUTH_016: string;
|
|
1925
|
+
AUTH_017: string;
|
|
1926
|
+
AUTH_018: string;
|
|
1927
|
+
AUTH_019: string;
|
|
1928
|
+
AUTH_020: string;
|
|
1929
|
+
AUTH_021: string;
|
|
1930
|
+
AUTH_022: string;
|
|
1931
|
+
AUTH_023: string;
|
|
1932
|
+
AUTH_200_ALL_SESSIONS_REVOKED: string;
|
|
1933
|
+
AUTH_200_CHANGE_PASSWORD: string;
|
|
1934
|
+
AUTH_200_CHANNEL_CHANGED: string;
|
|
1935
|
+
AUTH_200_CHANNEL_VERIFIED: string;
|
|
1936
|
+
AUTH_200_CODE_SENT: string;
|
|
1937
|
+
AUTH_200_SESSION_REVOKED: string;
|
|
1938
|
+
BIZ_001: string;
|
|
1939
|
+
BIZ_002: string;
|
|
1940
|
+
BIZ_003: string;
|
|
1941
|
+
BIZ_004: string;
|
|
1942
|
+
BIZ_200: string;
|
|
1943
|
+
BIZ_200_DELETE: string;
|
|
1944
|
+
BIZ_201: string;
|
|
1945
|
+
CLIENT_005: string;
|
|
1946
|
+
CLIENT_006: string;
|
|
1947
|
+
CLIENT_007: string;
|
|
1948
|
+
CLIENT_008: string;
|
|
1949
|
+
CLIENT_009: string;
|
|
1950
|
+
CLIENT_010: string;
|
|
1951
|
+
CLIENT_011: string;
|
|
1952
|
+
CLIENT_200_BALANCE_ADJUSTED: string;
|
|
1953
|
+
DRAWER_001: string;
|
|
1954
|
+
DRAWER_002: string;
|
|
1955
|
+
DRAWER_003: string;
|
|
1956
|
+
DRAWER_004: string;
|
|
1957
|
+
DRAWER_005: string;
|
|
1958
|
+
DRAWER_201: string;
|
|
1959
|
+
DRAWER_202: string;
|
|
1960
|
+
DRAWER_203: string;
|
|
1961
|
+
DRAWER_204: string;
|
|
1962
|
+
ECAT_001: string;
|
|
1963
|
+
ECAT_001_DUP: string;
|
|
1964
|
+
ECAT_002: string;
|
|
1965
|
+
ECAT_003: string;
|
|
1966
|
+
ECAT_004: string;
|
|
1967
|
+
ECAT_005: string;
|
|
1968
|
+
ECAT_200: string;
|
|
1969
|
+
ECAT_200_DEACTIVATE: string;
|
|
1970
|
+
ECAT_201: string;
|
|
1971
|
+
EXPENSE_001: string;
|
|
1972
|
+
EXPENSE_002: string;
|
|
1973
|
+
EXPENSE_003: string;
|
|
1974
|
+
EXPENSE_004: string;
|
|
1975
|
+
EXPENSE_200: string;
|
|
1976
|
+
EXPENSE_200_DELETE: string;
|
|
1977
|
+
EXPENSE_201: string;
|
|
1978
|
+
HOL_001: string;
|
|
1979
|
+
TAB_001: string;
|
|
1980
|
+
TAB_002: string;
|
|
1981
|
+
TAB_003: string;
|
|
1982
|
+
TAB_004: string;
|
|
1983
|
+
TAB_005: string;
|
|
1984
|
+
TAB_006: string;
|
|
1985
|
+
TAB_007: string;
|
|
1986
|
+
TAB_008: string;
|
|
1987
|
+
TAB_009: string;
|
|
1988
|
+
TAB_010: string;
|
|
1989
|
+
TAB_011: string;
|
|
1990
|
+
TAB_012: string;
|
|
1991
|
+
TAB_013: string;
|
|
1992
|
+
TAB_014: string;
|
|
1993
|
+
TAB_015: string;
|
|
1994
|
+
TAB_016: string;
|
|
1995
|
+
TAB_017: string;
|
|
1996
|
+
TAB_018: string;
|
|
1997
|
+
TAB_019: string;
|
|
1998
|
+
TAB_020: string;
|
|
1999
|
+
TAB_021: string;
|
|
2000
|
+
TAB_022: string;
|
|
2001
|
+
TAB_023: string;
|
|
2002
|
+
TAB_024: string;
|
|
2003
|
+
TAB_025: string;
|
|
2004
|
+
TAB_026: string;
|
|
2005
|
+
TAB_027: string;
|
|
2006
|
+
TAB_200_CANCELED: string;
|
|
2007
|
+
TAB_200_CLOSED: string;
|
|
2008
|
+
TAB_200_ITEM_ADDED: string;
|
|
2009
|
+
TAB_200_ITEM_REMOVED: string;
|
|
2010
|
+
TAB_200_ITEM_UPDATED: string;
|
|
2011
|
+
TAB_200_REOPENED: string;
|
|
2012
|
+
TAB_200_UPDATED: string;
|
|
2013
|
+
TAB_201: string;
|
|
2014
|
+
USER_004: string;
|
|
2015
|
+
USER_005: string;
|
|
2016
|
+
USER_200_CHANNEL_CHANGED: string;
|
|
2017
|
+
USER_200_CHANNEL_CHANGE_STARTED: string;
|
|
2018
|
+
USER_200_DELETE: string;
|
|
1887
2019
|
};
|
|
1888
2020
|
|
|
1889
2021
|
export { appPT };
|
package/dist/i18n/pt.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var zod = require('zod');
|
|
4
4
|
var dayjs = require('dayjs');
|
|
5
|
-
var localeData = require('dayjs/plugin/localeData');
|
|
6
|
-
var localizedFormat = require('dayjs/plugin/localizedFormat');
|
|
5
|
+
var localeData = require('dayjs/plugin/localeData.js');
|
|
6
|
+
var localizedFormat = require('dayjs/plugin/localizedFormat.js');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
|
|
@@ -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,KAA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AA,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\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\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 lastname: z.string().min(1, resolved.required).max(255),\n phone: z\n .string()\n .min(1, resolved.required)\n .min(10, resolved.invalidPhone)\n .max(20)\n .regex(phoneRegex, resolved.invalidPhone),\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"]}
|
|
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,OAAO,IAAI,IAAA,CAA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E,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 lastname: z.string().min(1, resolved.required).max(255),\n phone: z\n .string()\n .min(1, resolved.required)\n .min(10, resolved.invalidPhone)\n .max(20)\n .regex(phoneRegex, resolved.invalidPhone),\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"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MIN_AGE } from '../chunk-I5B37D6W.js';
|
|
2
2
|
import { birthdayRegex, isUnsafe, phoneRegex } from '../chunk-DRXSG6VD.js';
|
|
3
|
-
import { isValidCalendarDate, calculateAge } from '../chunk-
|
|
3
|
+
import { isValidCalendarDate, calculateAge } from '../chunk-POM3RC7W.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
var MIN_CLIENT_AGE = MIN_AGE;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var zod = require('zod');
|
|
4
4
|
var dayjs = require('dayjs');
|
|
5
|
-
var localeData = require('dayjs/plugin/localeData');
|
|
6
|
-
var localizedFormat = require('dayjs/plugin/localizedFormat');
|
|
5
|
+
var localeData = require('dayjs/plugin/localeData.js');
|
|
6
|
+
var localizedFormat = require('dayjs/plugin/localizedFormat.js');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
|
|
@@ -40,6 +40,7 @@ var MIN_BUSINESS_OWNER_AGE = MIN_AGE;
|
|
|
40
40
|
var DEFAULT_MESSAGES = {
|
|
41
41
|
required: "validation.required",
|
|
42
42
|
invalidEmail: "validation.email.invalid",
|
|
43
|
+
invalidPhone: "validation.phone.invalid",
|
|
43
44
|
passwordMinLength: "auth.signUp.errors.passwordMinLength",
|
|
44
45
|
passwordWeak: "auth.signUp.errors.passwordWeak",
|
|
45
46
|
passwordsMismatch: "auth.signUp.errors.passwordsDontMatch",
|
|
@@ -56,7 +57,7 @@ var createRegisterBusinessOwnerSchema = (messages = {}) => {
|
|
|
56
57
|
email: zod.z.email(resolved.invalidEmail).max(255).optional().or(zod.z.literal("")),
|
|
57
58
|
password: zod.z.string().min(6, resolved.passwordMinLength).max(255).regex(passwordRegex, resolved.passwordWeak),
|
|
58
59
|
confirmPassword: zod.z.string().min(6, resolved.passwordMinLength),
|
|
59
|
-
phone: zod.z.string().min(10).max(20).optional().or(zod.z.literal("")),
|
|
60
|
+
phone: zod.z.string().min(10, resolved.invalidPhone).max(20, resolved.invalidPhone).optional().or(zod.z.literal("")),
|
|
60
61
|
birthday: zod.z.string().min(1, resolved.required).regex(birthdayRegex, resolved.invalidBirthday).refine(isValidCalendarDate, { message: resolved.invalidBirthday }).refine(
|
|
61
62
|
(value) => calculateAge(value) >= MIN_BUSINESS_OWNER_AGE,
|
|
62
63
|
{ message: resolved.underage }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/constants/age.ts","../../src/core/constants/regex.ts","../../src/core/utils/date.ts","../../src/core/schemas/register-business-owner-form.ts"],"names":["dayjs","localizedFormat","localeData","z"],"mappings":";;;;;;;;;;;;;;;;AAIO,IAAM,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AAe,QAAA,CAAS,eAAe,EAC7C,MAAA,CAAO,mBAAA,EAAqB,EAAE,OAAA,EAAS,QAAA,CAAS,eAAA,EAAiB,CAAA,CACjE,MAAA;AAAA,MACC,CAAC,KAAA,KAAU,YAAA,CAAa,KAAK,CAAA,IAAK,sBAAA;AAAA,MAClC,EAAE,OAAA,EAAS,QAAA,CAAS,QAAA;AAAS,KAC/B;AAAA;AAAA;AAAA;AAAA,IAIF,aAAA,EAAeA,KAAA,CAAE,MAAA,EAAO,CAAE,IAAA,EAAK,CAAE,GAAA,CAAI,CAAA,EAAG,QAAA,CAAS,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlE,wBAAA,EAA0BA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC9C,wBAAA,EAA0BA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA,IAG9C,kBAAA,EAAoBA,KAAA,CAAE,OAAA,CAAQ,IAAA,EAAM;AAAA,MAClC,OAAO,QAAA,CAAS;AAAA,KACjB;AAAA,GACF,EACA,MAAA,CAAO,CAAC,SAAS,IAAA,CAAK,QAAA,KAAa,KAAK,eAAA,EAAiB;AAAA,IACxD,SAAS,QAAA,CAAS,iBAAA;AAAA,IAClB,IAAA,EAAM,CAAC,iBAAiB;AAAA,GACzB,CAAA,CACA,MAAA,CAAO,CAAC,IAAA,KAAS,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,IAAK,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,EAAG;AAAA,IAC5D,SAAS,QAAA,CAAS,eAAA;AAAA,IAClB,IAAA,EAAM,CAAC,OAAO;AAAA,GACf,CAAA;AACL;AAEO,IAAM,8BAA8B,iCAAA","file":"register-business-owner-form.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\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\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, passwordRegex } from \"../constants/regex\";\nimport { calculateAge, isValidCalendarDate } from \"../utils/date\";\n\n/** Minimum age to register as a business owner (business/legal-contract capacity). */\nexport const MIN_BUSINESS_OWNER_AGE = MIN_AGE;\n\nexport interface RegisterBusinessOwnerSchemaMessages {\n required: string;\n invalidEmail: string;\n passwordMinLength: string;\n passwordWeak: string;\n passwordsMismatch: string;\n invalidBirthday: string;\n underage: string;\n contactRequired: string;\n documentsNotAccepted: string;\n}\n\nconst DEFAULT_MESSAGES: RegisterBusinessOwnerSchemaMessages = {\n required: \"validation.required\",\n invalidEmail: \"validation.email.invalid\",\n passwordMinLength: \"auth.signUp.errors.passwordMinLength\",\n passwordWeak: \"auth.signUp.errors.passwordWeak\",\n passwordsMismatch: \"auth.signUp.errors.passwordsDontMatch\",\n invalidBirthday: \"validation.birthday.invalid\",\n underage: \"auth.signUp.errors.underage\",\n contactRequired: \"auth.signUp.errors.contactRequired\",\n documentsNotAccepted: \"auth.signUp.errors.documentsNotAccepted\",\n};\n\nexport const createRegisterBusinessOwnerSchema = (\n messages: Partial<RegisterBusinessOwnerSchemaMessages> = {},\n) => {\n const resolved = { ...DEFAULT_MESSAGES, ...messages };\n\n return z\n .object({\n firstname: z.string().trim().min(1, resolved.required).max(100),\n lastname: z.string().trim().min(1, resolved.required).max(100),\n email: z.email(resolved.invalidEmail).max(255).optional().or(z.literal(\"\")),\n password: z\n .string()\n .min(6, resolved.passwordMinLength)\n .max(255)\n .regex(passwordRegex, resolved.passwordWeak),\n confirmPassword: z.string().min(6, resolved.passwordMinLength),\n phone: z.string().min(10).max(20).optional().or(z.literal(\"\")),\n birthday: z\n .string()\n .min(1, resolved.required)\n .regex(birthdayRegex, resolved.invalidBirthday)\n .refine(isValidCalendarDate, { message: resolved.invalidBirthday })\n .refine(\n (value) => calculateAge(value) >= MIN_BUSINESS_OWNER_AGE,\n { message: resolved.underage },\n ),\n // Creates the Business atomically with the account — no physical\n // address required. See docs/adr/0010-business-establishment-split.md\n // in agendar-api.\n business_name: z.string().trim().min(1, resolved.required).max(255),\n // Proof issued by the Channel verification step (see CONTEXT.md in\n // agendar-api) — populated by the SignUp flow once the chosen\n // channel's code/Firebase token is confirmed. The backend is the\n // real gate (it re-validates the proof); these just let the step UI\n // know verification already happened for this session.\n email_verification_proof: z.string().optional(),\n phone_verification_proof: z.string().optional(),\n // Single checkbox on the password step, covering both documents —\n // see CONTEXT.md's Document acceptance entry in agendar-api.\n documents_accepted: z.literal(true, {\n error: resolved.documentsNotAccepted,\n }),\n })\n .refine((data) => data.password === data.confirmPassword, {\n message: resolved.passwordsMismatch,\n path: [\"confirmPassword\"],\n })\n .refine((data) => Boolean(data.email) || Boolean(data.phone), {\n message: resolved.contactRequired,\n path: [\"email\"],\n });\n};\n\nexport const registerBusinessOwnerSchema = createRegisterBusinessOwnerSchema();\n\nexport type RegisterBusinessOwnerFormValues = z.infer<\n typeof registerBusinessOwnerSchema\n>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/core/constants/age.ts","../../src/core/constants/regex.ts","../../src/core/utils/date.ts","../../src/core/schemas/register-business-owner-form.ts"],"names":["dayjs","localizedFormat","localeData","z"],"mappings":";;;;;;;;;;;;;;;;AAIO,IAAM,OAAA,GAAU,EAAA;;;ACDhB,IAAM,aAAA,GACX,iEAAA;AAMK,IAAM,aAAA,GAAgB,qBAAA;ACN7BA,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;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AAAS,KAC/B;AAAA;AAAA;AAAA;AAAA,IAIF,aAAA,EAAeA,KAAA,CAAE,MAAA,EAAO,CAAE,IAAA,EAAK,CAAE,GAAA,CAAI,CAAA,EAAG,QAAA,CAAS,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlE,wBAAA,EAA0BA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC9C,wBAAA,EAA0BA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA,IAG9C,kBAAA,EAAoBA,KAAA,CAAE,OAAA,CAAQ,IAAA,EAAM;AAAA,MAClC,OAAO,QAAA,CAAS;AAAA,KACjB;AAAA,GACF,EACA,MAAA,CAAO,CAAC,SAAS,IAAA,CAAK,QAAA,KAAa,KAAK,eAAA,EAAiB;AAAA,IACxD,SAAS,QAAA,CAAS,iBAAA;AAAA,IAClB,IAAA,EAAM,CAAC,iBAAiB;AAAA,GACzB,CAAA,CACA,MAAA,CAAO,CAAC,IAAA,KAAS,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,IAAK,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,EAAG;AAAA,IAC5D,SAAS,QAAA,CAAS,eAAA;AAAA,IAClB,IAAA,EAAM,CAAC,OAAO;AAAA,GACf,CAAA;AACL;AAEO,IAAM,8BAA8B,iCAAA","file":"register-business-owner-form.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, passwordRegex } from \"../constants/regex\";\nimport { calculateAge, isValidCalendarDate } from \"../utils/date\";\n\n/** Minimum age to register as a business owner (business/legal-contract capacity). */\nexport const MIN_BUSINESS_OWNER_AGE = MIN_AGE;\n\nexport interface RegisterBusinessOwnerSchemaMessages {\n required: string;\n invalidEmail: string;\n invalidPhone: string;\n passwordMinLength: string;\n passwordWeak: string;\n passwordsMismatch: string;\n invalidBirthday: string;\n underage: string;\n contactRequired: string;\n documentsNotAccepted: string;\n}\n\nconst DEFAULT_MESSAGES: RegisterBusinessOwnerSchemaMessages = {\n required: \"validation.required\",\n invalidEmail: \"validation.email.invalid\",\n invalidPhone: \"validation.phone.invalid\",\n passwordMinLength: \"auth.signUp.errors.passwordMinLength\",\n passwordWeak: \"auth.signUp.errors.passwordWeak\",\n passwordsMismatch: \"auth.signUp.errors.passwordsDontMatch\",\n invalidBirthday: \"validation.birthday.invalid\",\n underage: \"auth.signUp.errors.underage\",\n contactRequired: \"auth.signUp.errors.contactRequired\",\n documentsNotAccepted: \"auth.signUp.errors.documentsNotAccepted\",\n};\n\nexport const createRegisterBusinessOwnerSchema = (\n messages: Partial<RegisterBusinessOwnerSchemaMessages> = {},\n) => {\n const resolved = { ...DEFAULT_MESSAGES, ...messages };\n\n return z\n .object({\n firstname: z.string().trim().min(1, resolved.required).max(100),\n lastname: z.string().trim().min(1, resolved.required).max(100),\n email: z.email(resolved.invalidEmail).max(255).optional().or(z.literal(\"\")),\n password: z\n .string()\n .min(6, resolved.passwordMinLength)\n .max(255)\n .regex(passwordRegex, resolved.passwordWeak),\n confirmPassword: z.string().min(6, resolved.passwordMinLength),\n phone: z\n .string()\n .min(10, resolved.invalidPhone)\n .max(20, resolved.invalidPhone)\n .optional()\n .or(z.literal(\"\")),\n birthday: z\n .string()\n .min(1, resolved.required)\n .regex(birthdayRegex, resolved.invalidBirthday)\n .refine(isValidCalendarDate, { message: resolved.invalidBirthday })\n .refine(\n (value) => calculateAge(value) >= MIN_BUSINESS_OWNER_AGE,\n { message: resolved.underage },\n ),\n // Creates the Business atomically with the account — no physical\n // address required. See docs/adr/0010-business-establishment-split.md\n // in agendar-api.\n business_name: z.string().trim().min(1, resolved.required).max(255),\n // Proof issued by the Channel verification step (see CONTEXT.md in\n // agendar-api) — populated by the SignUp flow once the chosen\n // channel's code/Firebase token is confirmed. The backend is the\n // real gate (it re-validates the proof); these just let the step UI\n // know verification already happened for this session.\n email_verification_proof: z.string().optional(),\n phone_verification_proof: z.string().optional(),\n // Single checkbox on the password step, covering both documents —\n // see CONTEXT.md's Document acceptance entry in agendar-api.\n documents_accepted: z.literal(true, {\n error: resolved.documentsNotAccepted,\n }),\n })\n .refine((data) => data.password === data.confirmPassword, {\n message: resolved.passwordsMismatch,\n path: [\"confirmPassword\"],\n })\n .refine((data) => Boolean(data.email) || Boolean(data.phone), {\n message: resolved.contactRequired,\n path: [\"email\"],\n });\n};\n\nexport const registerBusinessOwnerSchema = createRegisterBusinessOwnerSchema();\n\nexport type RegisterBusinessOwnerFormValues = z.infer<\n typeof registerBusinessOwnerSchema\n>;\n"]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { MIN_AGE } from '../chunk-I5B37D6W.js';
|
|
2
2
|
import { birthdayRegex, passwordRegex } from '../chunk-DRXSG6VD.js';
|
|
3
|
-
import { isValidCalendarDate, calculateAge } from '../chunk-
|
|
3
|
+
import { isValidCalendarDate, calculateAge } from '../chunk-POM3RC7W.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
var MIN_BUSINESS_OWNER_AGE = MIN_AGE;
|
|
7
7
|
var DEFAULT_MESSAGES = {
|
|
8
8
|
required: "validation.required",
|
|
9
9
|
invalidEmail: "validation.email.invalid",
|
|
10
|
+
invalidPhone: "validation.phone.invalid",
|
|
10
11
|
passwordMinLength: "auth.signUp.errors.passwordMinLength",
|
|
11
12
|
passwordWeak: "auth.signUp.errors.passwordWeak",
|
|
12
13
|
passwordsMismatch: "auth.signUp.errors.passwordsDontMatch",
|
|
@@ -23,7 +24,7 @@ var createRegisterBusinessOwnerSchema = (messages = {}) => {
|
|
|
23
24
|
email: z.email(resolved.invalidEmail).max(255).optional().or(z.literal("")),
|
|
24
25
|
password: z.string().min(6, resolved.passwordMinLength).max(255).regex(passwordRegex, resolved.passwordWeak),
|
|
25
26
|
confirmPassword: z.string().min(6, resolved.passwordMinLength),
|
|
26
|
-
phone: z.string().min(10).max(20).optional().or(z.literal("")),
|
|
27
|
+
phone: z.string().min(10, resolved.invalidPhone).max(20, resolved.invalidPhone).optional().or(z.literal("")),
|
|
27
28
|
birthday: z.string().min(1, resolved.required).regex(birthdayRegex, resolved.invalidBirthday).refine(isValidCalendarDate, { message: resolved.invalidBirthday }).refine(
|
|
28
29
|
(value) => calculateAge(value) >= MIN_BUSINESS_OWNER_AGE,
|
|
29
30
|
{ message: resolved.underage }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/schemas/register-business-owner-form.ts"],"names":[],"mappings":";;;;;AAOO,IAAM,sBAAA,GAAyB;
|
|
1
|
+
{"version":3,"sources":["../../src/core/schemas/register-business-owner-form.ts"],"names":[],"mappings":";;;;;AAOO,IAAM,sBAAA,GAAyB;AAetC,IAAM,gBAAA,GAAwD;AAAA,EAC5D,QAAA,EAAU,qBAAA;AAAA,EACV,YAAA,EAAc,0BAAA;AAAA,EACd,YAAA,EAAc,0BAAA;AAAA,EACd,iBAAA,EAAmB,sCAAA;AAAA,EACnB,YAAA,EAAc,iCAAA;AAAA,EACd,iBAAA,EAAmB,uCAAA;AAAA,EACnB,eAAA,EAAiB,6BAAA;AAAA,EACjB,QAAA,EAAU,6BAAA;AAAA,EACV,eAAA,EAAiB,oCAAA;AAAA,EACjB,oBAAA,EAAsB;AACxB,CAAA;AAEO,IAAM,iCAAA,GAAoC,CAC/C,QAAA,GAAyD,EAAC,KACvD;AACH,EAAA,MAAM,QAAA,GAAW,EAAE,GAAG,gBAAA,EAAkB,GAAG,QAAA,EAAS;AAEpD,EAAA,OAAO,EACJ,MAAA,CAAO;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BAAA;AAAA,MAClC,EAAE,OAAA,EAAS,QAAA,CAAS,QAAA;AAAS,KAC/B;AAAA;AAAA;AAAA;AAAA,IAIF,aAAA,EAAe,CAAA,CAAE,MAAA,EAAO,CAAE,IAAA,EAAK,CAAE,GAAA,CAAI,CAAA,EAAG,QAAA,CAAS,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlE,wBAAA,EAA0B,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC9C,wBAAA,EAA0B,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA,IAG9C,kBAAA,EAAoB,CAAA,CAAE,OAAA,CAAQ,IAAA,EAAM;AAAA,MAClC,OAAO,QAAA,CAAS;AAAA,KACjB;AAAA,GACF,EACA,MAAA,CAAO,CAAC,SAAS,IAAA,CAAK,QAAA,KAAa,KAAK,eAAA,EAAiB;AAAA,IACxD,SAAS,QAAA,CAAS,iBAAA;AAAA,IAClB,IAAA,EAAM,CAAC,iBAAiB;AAAA,GACzB,CAAA,CACA,MAAA,CAAO,CAAC,IAAA,KAAS,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,IAAK,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,EAAG;AAAA,IAC5D,SAAS,QAAA,CAAS,eAAA;AAAA,IAClB,IAAA,EAAM,CAAC,OAAO;AAAA,GACf,CAAA;AACL;AAEO,IAAM,8BAA8B,iCAAA","file":"register-business-owner-form.js","sourcesContent":["import { z } from \"zod\";\n\nimport { MIN_AGE } from \"../constants/age\";\nimport { birthdayRegex, passwordRegex } from \"../constants/regex\";\nimport { calculateAge, isValidCalendarDate } from \"../utils/date\";\n\n/** Minimum age to register as a business owner (business/legal-contract capacity). */\nexport const MIN_BUSINESS_OWNER_AGE = MIN_AGE;\n\nexport interface RegisterBusinessOwnerSchemaMessages {\n required: string;\n invalidEmail: string;\n invalidPhone: string;\n passwordMinLength: string;\n passwordWeak: string;\n passwordsMismatch: string;\n invalidBirthday: string;\n underage: string;\n contactRequired: string;\n documentsNotAccepted: string;\n}\n\nconst DEFAULT_MESSAGES: RegisterBusinessOwnerSchemaMessages = {\n required: \"validation.required\",\n invalidEmail: \"validation.email.invalid\",\n invalidPhone: \"validation.phone.invalid\",\n passwordMinLength: \"auth.signUp.errors.passwordMinLength\",\n passwordWeak: \"auth.signUp.errors.passwordWeak\",\n passwordsMismatch: \"auth.signUp.errors.passwordsDontMatch\",\n invalidBirthday: \"validation.birthday.invalid\",\n underage: \"auth.signUp.errors.underage\",\n contactRequired: \"auth.signUp.errors.contactRequired\",\n documentsNotAccepted: \"auth.signUp.errors.documentsNotAccepted\",\n};\n\nexport const createRegisterBusinessOwnerSchema = (\n messages: Partial<RegisterBusinessOwnerSchemaMessages> = {},\n) => {\n const resolved = { ...DEFAULT_MESSAGES, ...messages };\n\n return z\n .object({\n firstname: z.string().trim().min(1, resolved.required).max(100),\n lastname: z.string().trim().min(1, resolved.required).max(100),\n email: z.email(resolved.invalidEmail).max(255).optional().or(z.literal(\"\")),\n password: z\n .string()\n .min(6, resolved.passwordMinLength)\n .max(255)\n .regex(passwordRegex, resolved.passwordWeak),\n confirmPassword: z.string().min(6, resolved.passwordMinLength),\n phone: z\n .string()\n .min(10, resolved.invalidPhone)\n .max(20, resolved.invalidPhone)\n .optional()\n .or(z.literal(\"\")),\n birthday: z\n .string()\n .min(1, resolved.required)\n .regex(birthdayRegex, resolved.invalidBirthday)\n .refine(isValidCalendarDate, { message: resolved.invalidBirthday })\n .refine(\n (value) => calculateAge(value) >= MIN_BUSINESS_OWNER_AGE,\n { message: resolved.underage },\n ),\n // Creates the Business atomically with the account — no physical\n // address required. See docs/adr/0010-business-establishment-split.md\n // in agendar-api.\n business_name: z.string().trim().min(1, resolved.required).max(255),\n // Proof issued by the Channel verification step (see CONTEXT.md in\n // agendar-api) — populated by the SignUp flow once the chosen\n // channel's code/Firebase token is confirmed. The backend is the\n // real gate (it re-validates the proof); these just let the step UI\n // know verification already happened for this session.\n email_verification_proof: z.string().optional(),\n phone_verification_proof: z.string().optional(),\n // Single checkbox on the password step, covering both documents —\n // see CONTEXT.md's Document acceptance entry in agendar-api.\n documents_accepted: z.literal(true, {\n error: resolved.documentsNotAccepted,\n }),\n })\n .refine((data) => data.password === data.confirmPassword, {\n message: resolved.passwordsMismatch,\n path: [\"confirmPassword\"],\n })\n .refine((data) => Boolean(data.email) || Boolean(data.phone), {\n message: resolved.contactRequired,\n path: [\"email\"],\n });\n};\n\nexport const registerBusinessOwnerSchema = createRegisterBusinessOwnerSchema();\n\nexport type RegisterBusinessOwnerFormValues = z.infer<\n typeof registerBusinessOwnerSchema\n>;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var dayjs = require('dayjs');
|
|
4
|
-
var localeData = require('dayjs/plugin/localeData');
|
|
5
|
-
var localizedFormat = require('dayjs/plugin/localizedFormat');
|
|
4
|
+
var localeData = require('dayjs/plugin/localeData.js');
|
|
5
|
+
var localizedFormat = require('dayjs/plugin/localizedFormat.js');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
|