@shophost/rest-api 2.0.68 → 2.0.69
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/package.json +1 -1
- package/schema.prisma +1 -0
- package/src/core/db/__generated__/client/internal/class.js +3 -2
- package/src/core/db/__generated__/client/internal/prismaNamespace.d.ts +1 -0
- package/src/core/db/__generated__/client/internal/prismaNamespace.js +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.d.ts +1 -0
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js +1 -1
- package/src/core/db/__generated__/client/models/OrganizationConfiguration.d.ts +41 -1
- package/src/features/organization/organization-configuration.schema.d.ts +2 -0
- package/src/features/organization/organization-configuration.schema.js +1 -1
- package/src/features/organization/organization.route.d.ts +5 -0
- package/src/features/organization/organization.schema.d.ts +2 -0
- package/src/features/organization/organization.service.d.ts +4 -0
- package/src/features/organization/organization.service.js +1 -1
- package/src/features/reservation/emails/reservation-cancellation.email.js +1 -1
- package/src/features/reservation/emails/reservation-confirmation.email.js +1 -1
- package/src/features/reservation/emails/reservation-email-date.d.ts +2 -0
- package/src/features/reservation/emails/reservation-email-date.js +1 -0
- package/src/features/reservation/emails/reservation-notification.email.js +1 -1
- package/src/features/reservation/emails/reservation-updated.email.js +1 -1
- package/src/schemas/index.d.ts +1 -0
- package/src/schemas/index.js +1 -1
- package/src/schemas/time-zone.schema.d.ts +9 -0
- package/src/schemas/time-zone.schema.js +1 -0
|
@@ -54,6 +54,7 @@ declare class OrganizationService {
|
|
|
54
54
|
defaultLocale: "hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu";
|
|
55
55
|
supportedLocales: ("hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu")[];
|
|
56
56
|
defaultCurrency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
57
|
+
defaultTimeZone: string;
|
|
57
58
|
createdAt: Date;
|
|
58
59
|
hostname?: string | undefined;
|
|
59
60
|
stripeAccountId?: string | undefined;
|
|
@@ -126,6 +127,7 @@ declare class OrganizationService {
|
|
|
126
127
|
defaultLocale: "hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu";
|
|
127
128
|
supportedLocales: ("hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu")[];
|
|
128
129
|
defaultCurrency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
130
|
+
defaultTimeZone: string;
|
|
129
131
|
createdAt: Date;
|
|
130
132
|
hostname?: string | undefined;
|
|
131
133
|
stripeAccountId?: string | undefined;
|
|
@@ -195,6 +197,7 @@ declare class OrganizationService {
|
|
|
195
197
|
defaultLocale: "hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu";
|
|
196
198
|
supportedLocales: ("hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu")[];
|
|
197
199
|
defaultCurrency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
200
|
+
defaultTimeZone: string;
|
|
198
201
|
createdAt: Date;
|
|
199
202
|
hostname?: string | undefined;
|
|
200
203
|
stripeAccountId?: string | undefined;
|
|
@@ -264,6 +267,7 @@ declare class OrganizationService {
|
|
|
264
267
|
defaultLocale: "hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu";
|
|
265
268
|
supportedLocales: ("hr" | "th" | "tr" | "id" | "is" | "mt" | "ml" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ms" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu")[];
|
|
266
269
|
defaultCurrency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
270
|
+
defaultTimeZone: string;
|
|
267
271
|
createdAt: Date;
|
|
268
272
|
hostname?: string | undefined;
|
|
269
273
|
stripeAccountId?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as l}from"tslib";import{z as p}from"@hono/zod-openapi";import{HttpException as T}from"../../core/exceptions/http-exception";import{OrganizationSchema as d,PaginationMetaSchema as h}from"../../schemas";class S{constructor(t,e){this.prisma=t,this.locationService=e,this.convertToTimeString=i=>i?i.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"UTC"}):""}requireLocationService(){if(!this.locationService)throw new Error("Google Maps API key is required");return this.locationService}getOrganizations(t,e){return l(this,void 0,void 0,function*(){const{page:i,limit:n}=e,[o,s]=yield this.prisma.organization.paginate({orderBy:{createdAt:"desc"},where:{members:{some:{userId:t}}},include:{address:!0,configuration:!0,logoFile:!0}}).withPages({page:i,limit:n});return{meta:h.parse(s),list:p.array(d).parse(o)}})}formatDateScheduleToTimeString(t){return t?["monday","tuesday","wednesday","thursday","friday","saturday","sunday"].reduce((i,n)=>(i[n]=this.convertToTimeString(t[n]),i),{}):null}getOrganization(t){return l(this,void 0,void 0,function*(){var e,i;const n=yield this.prisma.organization.findUnique({where:{id:t,deletedAt:null},include:{address:!0,configuration:{include:{openingTimes:!0,closingTimes:!0}},logoFile:!0}});if(!n)throw new T(404,"Organization not found");const o=(()=>{if(!n.configuration.isAcceptingOrders||!n.configuration.openingTimes||!n.configuration.closingTimes)return!1;const s=new Date(new Date().toLocaleString("en-US",{timeZone:"Europe/Warsaw"})),u=s.toLocaleDateString("en-US",{weekday:"long"}).toLowerCase(),a=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"Europe/Warsaw"}),r=n.configuration.openingTimes[u],c=n.configuration.closingTimes[u];if(!r||!c)return!1;const m=this.convertToTimeString(r),f=this.convertToTimeString(c);return a>=m&&a<=f})();return d.parse(Object.assign(Object.assign({},n),{configuration:Object.assign(Object.assign({},n.configuration),{isOpen:o,openingTimes:(e=this.formatDateScheduleToTimeString(n.configuration.openingTimes))!==null&&e!==void 0?e:void 0,closingTimes:(i=this.formatDateScheduleToTimeString(n.configuration.closingTimes))!==null&&i!==void 0?i:void 0})}))})}createOrganization(t,e){return l(this,void 0,void 0,function*(){var i,n;const o=yield this.requireLocationService().getPlaceDetails(e.address.placeId),s=yield this.prisma.organization.create({data:Object.assign({name:e.name,phone:e.phone,email:e.email,address:{create:Object.assign(Object.assign({},e.address),{latitude:o.latitude,longitude:o.longitude,createdBy:t})},configuration:{create:{countriesShipping:["us"],createdBy:t,enableHostCheckout:!1,enableHostTracking:!1,isAcceptingReservations:!1,openingTimes:{create:{monday:null,tuesday:null,wednesday:null,thursday:null,friday:null,saturday:null,sunday:null}},closingTimes:{create:{monday:null,tuesday:null,wednesday:null,thursday:null,friday:null,saturday:null}}}},members:{create:{user:{connect:{id:t}},role:"owner"}},createdBy:t},e.logoId?{logoFile:{connect:{id:e.logoId}}}:{}),include:{address:!0,configuration:{include:{openingTimes:!0,closingTimes:!0}},logoFile:!0}});return d.parse(Object.assign(Object.assign({},s),{configuration:Object.assign(Object.assign({},s.configuration),{openingTimes:(i=this.formatDateScheduleToTimeString(s.configuration.openingTimes))!==null&&i!==void 0?i:void 0,closingTimes:(n=this.formatDateScheduleToTimeString(s.configuration.closingTimes))!==null&&n!==void 0?n:void 0})}))})}updateOrganization(t,e,i){return l(this,void 0,void 0,function*(){var n,o;if(!(yield this.prisma.organization.findUnique({where:{id:t,deletedAt:null}})))throw new T(404,"Organization not found");const u=i.address?yield this.requireLocationService().getPlaceDetails(i.address.placeId):void 0,a=c=>{if(!c)return null;const[m,f]=c.split(":").map(Number),g=new Date;return g.setUTCHours(m),g.setUTCMinutes(f),g.setUTCSeconds(0),g.setUTCMilliseconds(0),g},r=yield this.prisma.organization.update({where:{id:t},data:Object.assign(Object.assign(Object.assign(Object.assign({name:i.name,phone:i.phone,email:i.email},i.logoId?{logoFile:{connect:{id:i.logoId}}}:{}),{address:i.address?{update:Object.assign(Object.assign({},i.address),{latitude:u.latitude,longitude:u.longitude,updatedBy:e})}:void 0}),i.configuration?{configuration:{update:{countriesShipping:i.configuration.countriesShipping,enableHostCheckout:i.configuration.enableHostCheckout,enableHostTracking:i.configuration.enableHostTracking,defaultLocale:i.configuration.defaultLocale,supportedLocales:i.configuration.supportedLocales,defaultCurrency:i.configuration.defaultCurrency,updatedBy:e,isAcceptingOrders:i.configuration.isAcceptingOrders,isAcceptingReservations:i.configuration.isAcceptingReservations,openingTimes:i.configuration.openingTimes?{update:{data:{monday:i.configuration.openingTimes.monday?a(i.configuration.openingTimes.monday):null,tuesday:i.configuration.openingTimes.tuesday?a(i.configuration.openingTimes.tuesday):null,wednesday:i.configuration.openingTimes.wednesday?a(i.configuration.openingTimes.wednesday):null,thursday:i.configuration.openingTimes.thursday?a(i.configuration.openingTimes.thursday):null,friday:i.configuration.openingTimes.friday?a(i.configuration.openingTimes.friday):null,saturday:i.configuration.openingTimes.saturday?a(i.configuration.openingTimes.saturday):null,sunday:i.configuration.openingTimes.sunday?a(i.configuration.openingTimes.sunday):null}}}:void 0,closingTimes:i.configuration.closingTimes?{update:{data:{monday:i.configuration.closingTimes.monday?a(i.configuration.closingTimes.monday):null,tuesday:i.configuration.closingTimes.tuesday?a(i.configuration.closingTimes.tuesday):null,wednesday:i.configuration.closingTimes.wednesday?a(i.configuration.closingTimes.wednesday):null,thursday:i.configuration.closingTimes.thursday?a(i.configuration.closingTimes.thursday):null,friday:i.configuration.closingTimes.friday?a(i.configuration.closingTimes.friday):null,saturday:i.configuration.closingTimes.saturday?a(i.configuration.closingTimes.saturday):null,sunday:i.configuration.closingTimes.sunday?a(i.configuration.closingTimes.sunday):null}}}:void 0}}}:void 0),{updatedBy:e}),include:{address:!0,logoFile:!0,configuration:{include:{openingTimes:!0,closingTimes:!0}}}});return d.parse(Object.assign(Object.assign({},r),{configuration:Object.assign(Object.assign({},r.configuration),{openingTimes:(n=this.formatDateScheduleToTimeString(r.configuration.openingTimes))!==null&&n!==void 0?n:void 0,closingTimes:(o=this.formatDateScheduleToTimeString(r.configuration.closingTimes))!==null&&o!==void 0?o:void 0})}))})}deleteOrganization(t,e){return l(this,void 0,void 0,function*(){if(!(yield this.prisma.organization.findUnique({where:{id:t}})))throw new T(404,"Organization not found");yield this.prisma.organization.update({where:{id:t},data:{deletedAt:new Date,deletedBy:e}})})}}export{S as OrganizationService};
|
|
1
|
+
import{__awaiter as l}from"tslib";import{z as p}from"@hono/zod-openapi";import{HttpException as T}from"../../core/exceptions/http-exception";import{OrganizationSchema as d,PaginationMetaSchema as h}from"../../schemas";class S{constructor(t,e){this.prisma=t,this.locationService=e,this.convertToTimeString=i=>i?i.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"UTC"}):""}requireLocationService(){if(!this.locationService)throw new Error("Google Maps API key is required");return this.locationService}getOrganizations(t,e){return l(this,void 0,void 0,function*(){const{page:i,limit:n}=e,[o,s]=yield this.prisma.organization.paginate({orderBy:{createdAt:"desc"},where:{members:{some:{userId:t}}},include:{address:!0,configuration:!0,logoFile:!0}}).withPages({page:i,limit:n});return{meta:h.parse(s),list:p.array(d).parse(o)}})}formatDateScheduleToTimeString(t){return t?["monday","tuesday","wednesday","thursday","friday","saturday","sunday"].reduce((i,n)=>(i[n]=this.convertToTimeString(t[n]),i),{}):null}getOrganization(t){return l(this,void 0,void 0,function*(){var e,i;const n=yield this.prisma.organization.findUnique({where:{id:t,deletedAt:null},include:{address:!0,configuration:{include:{openingTimes:!0,closingTimes:!0}},logoFile:!0}});if(!n)throw new T(404,"Organization not found");const o=(()=>{if(!n.configuration.isAcceptingOrders||!n.configuration.openingTimes||!n.configuration.closingTimes)return!1;const s=new Date(new Date().toLocaleString("en-US",{timeZone:"Europe/Warsaw"})),u=s.toLocaleDateString("en-US",{weekday:"long"}).toLowerCase(),a=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"Europe/Warsaw"}),r=n.configuration.openingTimes[u],c=n.configuration.closingTimes[u];if(!r||!c)return!1;const m=this.convertToTimeString(r),f=this.convertToTimeString(c);return a>=m&&a<=f})();return d.parse(Object.assign(Object.assign({},n),{configuration:Object.assign(Object.assign({},n.configuration),{isOpen:o,openingTimes:(e=this.formatDateScheduleToTimeString(n.configuration.openingTimes))!==null&&e!==void 0?e:void 0,closingTimes:(i=this.formatDateScheduleToTimeString(n.configuration.closingTimes))!==null&&i!==void 0?i:void 0})}))})}createOrganization(t,e){return l(this,void 0,void 0,function*(){var i,n;const o=yield this.requireLocationService().getPlaceDetails(e.address.placeId),s=yield this.prisma.organization.create({data:Object.assign({name:e.name,phone:e.phone,email:e.email,address:{create:Object.assign(Object.assign({},e.address),{latitude:o.latitude,longitude:o.longitude,createdBy:t})},configuration:{create:{countriesShipping:["us"],createdBy:t,enableHostCheckout:!1,enableHostTracking:!1,isAcceptingReservations:!1,openingTimes:{create:{monday:null,tuesday:null,wednesday:null,thursday:null,friday:null,saturday:null,sunday:null}},closingTimes:{create:{monday:null,tuesday:null,wednesday:null,thursday:null,friday:null,saturday:null}}}},members:{create:{user:{connect:{id:t}},role:"owner"}},createdBy:t},e.logoId?{logoFile:{connect:{id:e.logoId}}}:{}),include:{address:!0,configuration:{include:{openingTimes:!0,closingTimes:!0}},logoFile:!0}});return d.parse(Object.assign(Object.assign({},s),{configuration:Object.assign(Object.assign({},s.configuration),{openingTimes:(i=this.formatDateScheduleToTimeString(s.configuration.openingTimes))!==null&&i!==void 0?i:void 0,closingTimes:(n=this.formatDateScheduleToTimeString(s.configuration.closingTimes))!==null&&n!==void 0?n:void 0})}))})}updateOrganization(t,e,i){return l(this,void 0,void 0,function*(){var n,o;if(!(yield this.prisma.organization.findUnique({where:{id:t,deletedAt:null}})))throw new T(404,"Organization not found");const u=i.address?yield this.requireLocationService().getPlaceDetails(i.address.placeId):void 0,a=c=>{if(!c)return null;const[m,f]=c.split(":").map(Number),g=new Date;return g.setUTCHours(m),g.setUTCMinutes(f),g.setUTCSeconds(0),g.setUTCMilliseconds(0),g},r=yield this.prisma.organization.update({where:{id:t},data:Object.assign(Object.assign(Object.assign(Object.assign({name:i.name,phone:i.phone,email:i.email},i.logoId?{logoFile:{connect:{id:i.logoId}}}:{}),{address:i.address?{update:Object.assign(Object.assign({},i.address),{latitude:u.latitude,longitude:u.longitude,updatedBy:e})}:void 0}),i.configuration?{configuration:{update:{countriesShipping:i.configuration.countriesShipping,enableHostCheckout:i.configuration.enableHostCheckout,enableHostTracking:i.configuration.enableHostTracking,defaultLocale:i.configuration.defaultLocale,defaultTimeZone:i.configuration.defaultTimeZone,supportedLocales:i.configuration.supportedLocales,defaultCurrency:i.configuration.defaultCurrency,updatedBy:e,isAcceptingOrders:i.configuration.isAcceptingOrders,isAcceptingReservations:i.configuration.isAcceptingReservations,openingTimes:i.configuration.openingTimes?{update:{data:{monday:i.configuration.openingTimes.monday?a(i.configuration.openingTimes.monday):null,tuesday:i.configuration.openingTimes.tuesday?a(i.configuration.openingTimes.tuesday):null,wednesday:i.configuration.openingTimes.wednesday?a(i.configuration.openingTimes.wednesday):null,thursday:i.configuration.openingTimes.thursday?a(i.configuration.openingTimes.thursday):null,friday:i.configuration.openingTimes.friday?a(i.configuration.openingTimes.friday):null,saturday:i.configuration.openingTimes.saturday?a(i.configuration.openingTimes.saturday):null,sunday:i.configuration.openingTimes.sunday?a(i.configuration.openingTimes.sunday):null}}}:void 0,closingTimes:i.configuration.closingTimes?{update:{data:{monday:i.configuration.closingTimes.monday?a(i.configuration.closingTimes.monday):null,tuesday:i.configuration.closingTimes.tuesday?a(i.configuration.closingTimes.tuesday):null,wednesday:i.configuration.closingTimes.wednesday?a(i.configuration.closingTimes.wednesday):null,thursday:i.configuration.closingTimes.thursday?a(i.configuration.closingTimes.thursday):null,friday:i.configuration.closingTimes.friday?a(i.configuration.closingTimes.friday):null,saturday:i.configuration.closingTimes.saturday?a(i.configuration.closingTimes.saturday):null,sunday:i.configuration.closingTimes.sunday?a(i.configuration.closingTimes.sunday):null}}}:void 0}}}:void 0),{updatedBy:e}),include:{address:!0,logoFile:!0,configuration:{include:{openingTimes:!0,closingTimes:!0}}}});return d.parse(Object.assign(Object.assign({},r),{configuration:Object.assign(Object.assign({},r.configuration),{openingTimes:(n=this.formatDateScheduleToTimeString(r.configuration.openingTimes))!==null&&n!==void 0?n:void 0,closingTimes:(o=this.formatDateScheduleToTimeString(r.configuration.closingTimes))!==null&&o!==void 0?o:void 0})}))})}deleteOrganization(t,e){return l(this,void 0,void 0,function*(){if(!(yield this.prisma.organization.findUnique({where:{id:t}})))throw new T(404,"Organization not found");yield this.prisma.organization.update({where:{id:t},data:{deletedAt:new Date,deletedBy:e}})})}}export{S as OrganizationService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Body as y,Column as s,Container as b,Head as N,Heading as v,Hr as k,Html as A,Img as r,Link as n,Preview as T,Row as d,Section as i,Tailwind as C,Text as l}from"../../../core/email/components";import{formatReservationEmailDate as j,formatReservationEmailDateTime as F}from"./reservation-email-date";const u=({user:x,organization:t,reservation:c})=>{var m,o,h,g,p;const f=`Your reservation with ${t.name} has been cancelled`,w=F(c.date);return a(A,{children:[e(N,{}),e(T,{children:f}),e(C,{children:a(y,{className:"bg-gray-50 font-sans",children:[a(b,{className:"bg-gray-50 p-6 max-w-[600px]",children:[e(i,{className:"mb-6",children:a(d,{children:[e(s,{className:"w-[80%]",children:e(r,{alt:`${t.name} logo`,height:"100",src:(m=t.logoFile)===null||m===void 0?void 0:m.url,className:"rounded-lg"})}),e(s,{align:"right",children:a(d,{align:"right",children:[e(s,{children:e(n,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",className:"mx-[4px]",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})}),e(s,{children:e(n,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",className:"mx-[4px]",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})})]})})]})}),a(i,{children:[a(v,{className:"text-3xl font-bold text-gray-800 mb-0",children:["Hi ",x.firstname,","]}),e(l,{className:"text-gray-600 mb-2 text-lg",children:"Your reservation has been cancelled."})]})]}),a(b,{className:"mx-auto max-w-[600px] rounded-xl bg-white px-6",children:[e(i,{className:"mb-6",children:a(d,{children:[a(s,{className:"w-[60%]",children:[e(l,{className:"text-gray-500 mb-0",children:"Cancelled reservation details"}),a(l,{className:"font-semibold text-gray-800 my-0",children:[c.firstname," ",c.lastname]}),a(l,{className:"font-semibold text-gray-800 my-0",children:["Reference: ",c.referenceId]}),a(l,{className:"font-semibold text-gray-800 my-0",children:["Date and Time: ",w]}),a(l,{className:"font-semibold text-gray-800 my-0",children:["Number of Guests: ",c.guests]})]}),e(s,{className:"w-[40%] p-0 mt-0",align:"right",valign:"top",children:e(l,{className:"text-gray-500 mb-0 pt-1",children:j(new Date)})})]})}),e(k,{className:"border-gray-200 mt-4"}),a(i,{className:"mb-6",children:[a(l,{className:"text-gray-700",children:["Your reservation at ",t.name," has been cancelled. If you did not request this cancellation or wish to make a new reservation, please contact us at ",t.phone,"."]}),a(l,{className:"text-gray-700",children:["We hope to welcome you at ",t.name," another time."]})]})]}),e(i,{className:"text-center bg-gray-50 py-5",children:a("table",{className:"w-full",children:[e("tr",{className:"w-full",children:e("td",{align:"center",children:((o=t.logoFile)===null||o===void 0?void 0:o.url)&&e(r,{alt:`${t.name} logo`,height:"100",src:t.logoFile.url,className:"rounded-lg"})})}),e("tr",{className:"w-full",children:a("td",{align:"center",children:[e(l,{className:"my-[8px] text-[16px] font-semibold text-xl pt-2 text-gray-900",children:t.name}),a(l,{className:"my-[8px] text-[16px] leading-[24px] text-gray-500",children:[(h=t.address)===null||h===void 0?void 0:h.addressLineOne,","," ",(g=t.address)===null||g===void 0?void 0:g.zipCode," ",(p=t.address)===null||p===void 0?void 0:p.city]}),e(l,{className:"mb-0 mt-[4px] text-[16px] leading-[24px] text-gray-500",children:t.phone})]})}),e("tr",{children:e("td",{align:"center",children:a(d,{className:"table-cell h-[44px] w-[56px] align-bottom pt-5",children:[e(s,{className:"pr-[8px]",children:e(n,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})}),e(s,{children:e(n,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})})]})})})]})})]})})]})},I={user:{id:"VD0OJ52f0mdAnm5YePP6BAW6hdbaCjAJ",name:"Abhishek Shaji",email:"kontakt@abhishek.pl",emailVerified:!0,image:"https://lh3.googleusercontent.com/a/ACg8ocKbkCAMTNvMizjXNxcm1aYtBiWnYpCYmU-7aE2Ft_M_uiHheZ5f=s96-c",createdAt:"2025-03-22T22:54:40.260Z",updatedAt:"2025-03-22T22:54:40.260Z",firstname:"Abhishek",lastname:"Shaji"},reservation:{id:"cm94wbpbm0000itx1iv9k2mqr",referenceId:"PH6LD6",firstname:"Abhishek",lastname:"Shaji",phone:"+48570135862",guests:4,date:new Date("2025-04-07T19:30:00.000Z"),createdAt:"2025-03-22T22:54:40.260Z",acceptedAt:"2025-03-22T23:00:23.456Z",cancelledAt:"2025-03-23T10:15:45.789Z"},organization:{id:"cm8kthfdq0001lg03b59mdy7b",name:"Madras Bistro",phone:"+48570135862",email:"contact@madrasbistro.pl",createdAt:"2025-03-22T23:05:14.271Z",legalEntityId:null,address:{id:"cm8kthfdr0002lg0350ijialt",firstname:null,lastname:null,phone:null,addressLineOne:"Plac Bohater\xF3w Getta 2",doorNumber:null,addressLineTwo:"3",zipCode:"33-332",city:"Krak\xF3w",country:"PL",placeId:"ChIJf-nsRkRbFkcR21gtObFSSSA",deliveryInstructions:null},configuration:{id:"cm8kthfdr0003lg03ghgs262n",hostname:"madrasbistro.pl",countriesShipping:["us"],stripeAccountId:"null",enableHostCheckout:!1,enableHostTracking:!1,isAcceptingOrders:!1,isAcceptingReservations:!1,defaultLocale:"en",supportedLocales:["en","pl"],defaultCurrency:"PLN",createdAt:"2025-03-22T23:05:14.271Z"},logo:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",logoFile:{id:"cm8ktmu890005lg0356gwclfk",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",mimeType:"image/png",size:1652289,filename:"logo.png"}}};u.PreviewProps=I;export default u;export{u as ReservationCancellationEmail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Body as N,Column as s,Container as b,Head as v,Heading as k,Hr as A,Html as T,Img as i,Link as n,Preview as j,Row as m,Section as c,Tailwind as C,Text as l}from"../../../core/email/components";import{formatReservationEmailDate as P,formatReservationEmailDateTime as F}from"./reservation-email-date";const u=({user:x,organization:t,reservation:r})=>{var o,d,h,g,p;const y=`This is your reservation confirmation from ${t.name}`,f=t.configuration.defaultTimeZone,w=F(r.date,f);return a(T,{children:[e(v,{}),e(j,{children:y}),e(C,{children:a(N,{className:"bg-gray-50 font-sans",children:[a(b,{className:"bg-gray-50 p-6 max-w-[600px]",children:[e(c,{className:"mb-6",children:a(m,{children:[e(s,{className:"w-[80%]",children:e(i,{alt:`${t.name} logo`,height:"100",src:(o=t.logoFile)===null||o===void 0?void 0:o.url,className:"rounded-lg"})}),e(s,{align:"right",children:a(m,{align:"right",children:[e(s,{children:e(n,{href:"https://www.instagram.com/madrasbistro/",children:e(i,{alt:"Instagram",className:"mx-[4px]",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})}),e(s,{children:e(n,{href:"https://www.facebook.com/madrasBistro/",children:e(i,{alt:"Facebook",className:"mx-[4px]",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})})]})})]})}),a(c,{children:[a(k,{className:"text-3xl font-bold text-gray-800 mb-0",children:["Hi ",x.firstname,","]}),e(l,{className:"text-gray-600 mb-2 text-lg",children:"Your reservation has been confirmed."})]})]}),a(b,{className:"mx-auto max-w-[600px] rounded-xl bg-white px-6",children:[e(c,{className:"mb-6",children:a(m,{children:[a(s,{className:"w-[60%]",children:[e(l,{className:"text-gray-500 mb-0",children:"Reservation details"}),a(l,{className:"font-semibold text-gray-800 my-0",children:[r.firstname," ",r.lastname]}),a(l,{className:"font-semibold text-gray-800 my-0",children:["Reference: ",r.referenceId]}),a(l,{className:"font-semibold text-gray-800 my-0",children:["Date and Time: ",w]}),a(l,{className:"font-semibold text-gray-800 my-0",children:["Number of Guests: ",r.guests]}),e(l,{className:"text-gray-500 mb-0",children:"Phone"}),e(l,{className:"font-semibold text-gray-800 my-0",children:r.phone})]}),e(s,{className:"w-[40%] p-0 mt-0",align:"right",valign:"top",children:e(l,{className:"text-gray-500 mb-0 pt-1",children:P(new Date,f)})})]})}),e(A,{className:"border-gray-200 mt-4"}),a(c,{className:"mb-6",children:[a(l,{className:"text-gray-700",children:["We're looking forward to welcoming you at ",t.name,". If you need to make any changes to your reservation, please contact us directly at ",t.phone,"."]}),e(l,{className:"text-gray-700",children:"Please note that we hold your table for 15 minutes from your reservation time."})]})]}),e(c,{className:"text-center bg-gray-50 py-5",children:a("table",{className:"w-full",children:[e("tr",{className:"w-full",children:e("td",{align:"center",children:((d=t.logoFile)===null||d===void 0?void 0:d.url)&&e(i,{alt:`${t.name} logo`,height:"100",src:t.logoFile.url,className:"rounded-lg"})})}),e("tr",{className:"w-full",children:a("td",{align:"center",children:[e(l,{className:"my-[8px] text-[16px] font-semibold text-xl pt-2 text-gray-900",children:t.name}),a(l,{className:"my-[8px] text-[16px] leading-[24px] text-gray-500",children:[(h=t.address)===null||h===void 0?void 0:h.addressLineOne,","," ",(g=t.address)===null||g===void 0?void 0:g.zipCode," ",(p=t.address)===null||p===void 0?void 0:p.city]}),e(l,{className:"mb-0 mt-[4px] text-[16px] leading-[24px] text-gray-500",children:t.phone})]})}),e("tr",{children:e("td",{align:"center",children:a(m,{className:"table-cell h-[44px] w-[56px] align-bottom pt-5",children:[e(s,{className:"pr-[8px]",children:e(n,{href:"https://www.facebook.com/madrasBistro/",children:e(i,{alt:"Facebook",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})}),e(s,{children:e(n,{href:"https://www.instagram.com/madrasbistro/",children:e(i,{alt:"Instagram",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})})]})})})]})})]})})]})},I={user:{id:"VD0OJ52f0mdAnm5YePP6BAW6hdbaCjAJ",name:"Abhishek Shaji",email:"kontakt@abhishek.pl",emailVerified:!0,image:"https://lh3.googleusercontent.com/a/ACg8ocKbkCAMTNvMizjXNxcm1aYtBiWnYpCYmU-7aE2Ft_M_uiHheZ5f=s96-c",createdAt:"2025-03-22T22:54:40.260Z",updatedAt:"2025-03-22T22:54:40.260Z",firstname:"Abhishek",lastname:"Shaji"},reservation:{id:"cm94wbpbm0000itx1iv9k2mqr",referenceId:"PH6LD6",firstname:"Abhishek",lastname:"Shaji",phone:"+48570135862",guests:4,date:new Date("2025-04-07T19:30:00.000Z"),createdAt:"2025-03-22T22:54:40.260Z",acceptedAt:"2025-03-22T23:00:23.456Z",cancelledAt:null},organization:{id:"cm8kthfdq0001lg03b59mdy7b",name:"Madras Bistro",phone:"+48570135862",email:"contact@madrasbistro.pl",createdAt:"2025-03-22T23:05:14.271Z",legalEntityId:null,address:{id:"cm8kthfdr0002lg0350ijialt",firstname:null,lastname:null,phone:null,addressLineOne:"Plac Bohater\xF3w Getta 2",doorNumber:null,addressLineTwo:"3",zipCode:"33-332",city:"Krak\xF3w",country:"PL",placeId:"ChIJf-nsRkRbFkcR21gtObFSSSA",deliveryInstructions:null},configuration:{id:"cm8kthfdr0003lg03ghgs262n",hostname:"madrasbistro.pl",countriesShipping:["us"],stripeAccountId:"null",enableHostCheckout:!1,enableHostTracking:!1,isAcceptingOrders:!1,isAcceptingReservations:!1,defaultLocale:"en",supportedLocales:["en","pl"],defaultCurrency:"PLN",createdAt:"2025-03-22T23:05:14.271Z"},logo:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",logoFile:{id:"cm8ktmu890005lg0356gwclfk",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",mimeType:"image/png",size:1652289,filename:"logo.png"}}};u.PreviewProps=I;export default u;export{u as ReservationConfirmationEmail};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_ORGANIZATION_TIME_ZONE as o,isValidTimeZone as m}from"../../../schemas/time-zone.schema";function s(e){return!e||!m(e)?o:e}function n(e,r,t){const a=new Intl.DateTimeFormat("en-GB",Object.assign(Object.assign({},r),{timeZone:s(t)})).formatToParts(new Date(e));return Object.fromEntries(a.filter(i=>i.type!=="literal").map(i=>[i.type,i.value]))}export function formatReservationEmailDate(e,r){const t=n(e,{year:"numeric",month:"2-digit",day:"2-digit"},r);return`${t.day}.${t.month}.${t.year}`}export function formatReservationEmailDateTime(e,r){const t=n(e,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"},r);return`${t.day}.${t.month}.${t.year} at ${t.hour}:${t.minute}`}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Body as v,Button as k,Column as s,Container as f,Head as A,Heading as T,Hr as j,Html as P,Img as i,Link as c,Preview as C,Row as d,Section as n,Tailwind as R,Text as t}from"../../../core/email/components";import{formatReservationEmailDate as F,formatReservationEmailDateTime as D}from"./reservation-email-date";const u=({user:x,member:N,organization:l,reservation:r})=>{var m,o,h,g,p,b;const w=`New reservation request for ${l.name}`,y=D(r.date);return a(P,{children:[e(A,{}),e(C,{children:w}),e(R,{children:a(v,{className:"bg-gray-50 font-sans",children:[a(f,{className:"bg-gray-50 p-6 max-w-[600px]",children:[e(n,{className:"mb-6",children:a(d,{children:[e(s,{className:"w-[80%]",children:e(i,{alt:`${l.name} logo`,height:"100",src:(m=l.logoFile)===null||m===void 0?void 0:m.url,className:"rounded-lg"})}),e(s,{align:"right",children:a(d,{align:"right",children:[e(s,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(i,{alt:"Instagram",className:"mx-[4px]",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})}),e(s,{children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(i,{alt:"Facebook",className:"mx-[4px]",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})})]})})]})}),a(n,{children:[a(T,{className:"text-3xl font-bold text-gray-800 mb-0",children:["Hi ",N.firstname,","]}),e(t,{className:"text-gray-600 mb-2 text-lg",children:"You have received a new reservation request."})]})]}),a(f,{className:"mx-auto max-w-[600px] rounded-xl bg-white px-6",children:[e(n,{className:"mb-6",children:a(d,{children:[a(s,{className:"w-[60%]",children:[e(t,{className:"text-gray-500 mb-0",children:"Reservation details"}),a(t,{className:"font-semibold text-gray-800 my-0",children:[r.firstname," ",r.lastname]}),a(t,{className:"font-semibold text-gray-800 my-0",children:["Reference: ",r.referenceId]}),a(t,{className:"font-semibold text-gray-800 my-0",children:["Date and Time: ",y]}),a(t,{className:"font-semibold text-gray-800 my-0",children:["Number of Guests: ",r.guests]}),e(t,{className:"text-gray-500 mb-0",children:"Phone"}),e(t,{className:"font-semibold text-gray-800 my-0",children:r.phone}),e(t,{className:"text-gray-500 mb-0",children:"Email"}),e(t,{className:"font-semibold text-gray-800 my-0",children:x.email})]}),e(s,{className:"w-[40%] p-0 mt-0",align:"right",valign:"top",children:e(t,{className:"text-gray-500 mb-0 pt-1",children:F(new Date)})})]})}),e(j,{className:"border-gray-200 mt-4"}),a(n,{className:"mb-6",children:[e(t,{className:"text-gray-700",children:"Please review and respond to this reservation request as soon as possible."}),e(k,{href:`https://admin.${(o=l.configuration)===null||o===void 0?void 0:o.hostname}/admin/reservations/${r.id}`,className:"bg-blue-600 rounded py-3 px-5 text-white text-center block mt-4",children:"View Reservation Details"})]})]}),e(n,{className:"text-center bg-gray-50 py-5",children:a("table",{className:"w-full",children:[e("tr",{className:"w-full",children:e("td",{align:"center",children:((h=l.logoFile)===null||h===void 0?void 0:h.url)&&e(i,{alt:`${l.name} logo`,height:"100",src:l.logoFile.url,className:"rounded-lg"})})}),e("tr",{className:"w-full",children:a("td",{align:"center",children:[e(t,{className:"my-[8px] text-[16px] font-semibold text-xl pt-2 text-gray-900",children:l.name}),a(t,{className:"my-[8px] text-[16px] leading-[24px] text-gray-500",children:[(g=l.address)===null||g===void 0?void 0:g.addressLineOne,","," ",(p=l.address)===null||p===void 0?void 0:p.zipCode," ",(b=l.address)===null||b===void 0?void 0:b.city]}),e(t,{className:"mb-0 mt-[4px] text-[16px] leading-[24px] text-gray-500",children:l.phone})]})}),e("tr",{children:e("td",{align:"center",children:a(d,{className:"table-cell h-[44px] w-[56px] align-bottom pt-5",children:[e(s,{className:"pr-[8px]",children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(i,{alt:"Facebook",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})}),e(s,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(i,{alt:"Instagram",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})})]})})})]})})]})})]})},I={user:{id:"VD0OJ52f0mdAnm5YePP6BAW6hdbaCjAJ",name:"Abhishek Shaji",email:"kontakt@abhishek.pl",emailVerified:!0,image:"https://lh3.googleusercontent.com/a/ACg8ocKbkCAMTNvMizjXNxcm1aYtBiWnYpCYmU-7aE2Ft_M_uiHheZ5f=s96-c",createdAt:"2025-03-22T22:54:40.260Z",updatedAt:"2025-03-22T22:54:40.260Z",firstname:"Abhishek",lastname:"Shaji"},member:{id:"KL9MN52f0mdOnp8YeQR7CAX5hdbdDkBP",name:"John Doe",email:"john@madrasbistro.pl",emailVerified:!0,image:null,createdAt:"2025-03-20T10:30:15.123Z",updatedAt:"2025-03-20T10:30:15.123Z",firstname:"John",lastname:"Doe"},reservation:{id:"cm94wbpbm0000itx1iv9k2mqr",referenceId:"PH6LD6",firstname:"Abhishek",lastname:"Shaji",phone:"+48570135862",guests:4,date:new Date("2025-04-07T19:30:00.000Z"),createdAt:"2025-03-22T22:54:40.260Z",acceptedAt:null,cancelledAt:null},organization:{id:"cm8kthfdq0001lg03b59mdy7b",name:"Madras Bistro",phone:"+48570135862",email:"contact@madrasbistro.pl",createdAt:"2025-03-22T23:05:14.271Z",legalEntityId:null,address:{id:"cm8kthfdr0002lg0350ijialt",firstname:null,lastname:null,phone:null,addressLineOne:"Plac Bohater\xF3w Getta 2",doorNumber:null,addressLineTwo:"3",zipCode:"33-332",city:"Krak\xF3w",country:"PL",placeId:"ChIJf-nsRkRbFkcR21gtObFSSSA",deliveryInstructions:null},configuration:{id:"cm8kthfdr0003lg03ghgs262n",hostname:"madrasbistro.pl",countriesShipping:["us"],stripeAccountId:"null",enableHostCheckout:!1,enableHostTracking:!1,isAcceptingOrders:!1,isAcceptingReservations:!1,defaultLocale:"en",supportedLocales:["en","pl"],defaultCurrency:"PLN",createdAt:"2025-03-22T23:05:14.271Z"},logo:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",logoFile:{id:"cm8ktmu890005lg0356gwclfk",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",mimeType:"image/png",size:1652289,filename:"logo.png"}}};u.PreviewProps=I;export default u;export{u as ReservationNotificationEmail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Body as y,Column as s,Container as x,Head as N,Heading as v,Hr as k,Html as A,Img as r,Link as c,Preview as T,Row as n,Section as i,Tailwind as j,Text as a}from"../../../core/email/components";import{formatReservationEmailDate as B,formatReservationEmailDateTime as I}from"./reservation-email-date";const u=({user:b,organization:l,reservation:d})=>{var m,o,h,g,p;const f=`Your reservation with ${l.name} has been updated`,w=I(d.date);return t(A,{children:[e(N,{}),e(T,{children:f}),e(j,{children:t(y,{className:"bg-gray-50 font-sans",children:[t(x,{className:"bg-gray-50 p-6 max-w-[600px]",children:[e(i,{className:"mb-6",children:t(n,{children:[e(s,{className:"w-[80%]",children:e(r,{alt:`${l.name} logo`,height:"100",src:(m=l.logoFile)===null||m===void 0?void 0:m.url,className:"rounded-lg"})}),e(s,{align:"right",children:t(n,{align:"right",children:[e(s,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",className:"mx-[4px]",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})}),e(s,{children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",className:"mx-[4px]",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})})]})})]})}),t(i,{children:[t(v,{className:"text-3xl font-bold text-gray-800 mb-0",children:["Hi ",b.firstname,","]}),e(a,{className:"text-gray-600 mb-2 text-lg",children:"Your reservation details have been updated."})]})]}),t(x,{className:"mx-auto max-w-[600px] rounded-xl bg-white px-6",children:[e(i,{className:"mb-6",children:t(n,{children:[t(s,{className:"w-[60%]",children:[e(a,{className:"text-gray-500 mb-0",children:"Updated reservation details"}),t(a,{className:"font-semibold text-gray-800 my-0",children:[d.firstname," ",d.lastname]}),t(a,{className:"font-semibold text-gray-800 my-0",children:["Reference: ",d.referenceId]}),t(a,{className:"font-semibold text-gray-800 my-0",children:["Date and Time: ",w]}),t(a,{className:"font-semibold text-gray-800 my-0",children:["Number of Guests: ",d.guests]}),e(a,{className:"text-gray-500 mb-0",children:"Phone"}),e(a,{className:"font-semibold text-gray-800 my-0",children:d.phone})]}),e(s,{className:"w-[40%] p-0 mt-0",align:"right",valign:"top",children:e(a,{className:"text-gray-500 mb-0 pt-1",children:B(new Date)})})]})}),e(k,{className:"border-gray-200 mt-4"}),t(i,{className:"mb-6",children:[t(a,{className:"text-gray-700",children:["Your updated reservation is now scheduled with"," ",l.name,". If anything still needs to change, please contact us directly at ",l.phone,"."]}),e(a,{className:"text-gray-700",children:"We look forward to welcoming you."})]})]}),e(i,{className:"text-center bg-gray-50 py-5",children:t("table",{className:"w-full",children:[e("tr",{className:"w-full",children:e("td",{align:"center",children:((o=l.logoFile)===null||o===void 0?void 0:o.url)&&e(r,{alt:`${l.name} logo`,height:"100",src:l.logoFile.url,className:"rounded-lg"})})}),e("tr",{className:"w-full",children:t("td",{align:"center",children:[e(a,{className:"my-[8px] text-[16px] font-semibold text-xl pt-2 text-gray-900",children:l.name}),t(a,{className:"my-[8px] text-[16px] leading-[24px] text-gray-500",children:[(h=l.address)===null||h===void 0?void 0:h.addressLineOne,","," ",(g=l.address)===null||g===void 0?void 0:g.zipCode," ",(p=l.address)===null||p===void 0?void 0:p.city]}),e(a,{className:"mb-0 mt-[4px] text-[16px] leading-[24px] text-gray-500",children:l.phone})]})}),e("tr",{children:e("td",{align:"center",children:t(n,{className:"table-cell h-[44px] w-[56px] align-bottom pt-5",children:[e(s,{className:"pr-[8px]",children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})}),e(s,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})})]})})})]})})]})})]})},P={user:{id:"VD0OJ52f0mdAnm5YePP6BAW6hdbaCjAJ",name:"Abhishek Shaji",email:"kontakt@abhishek.pl",emailVerified:!0,image:"https://lh3.googleusercontent.com/a/ACg8ocKbkCAMTNvMizjXNxcm1aYtBiWnYpCYmU-7aE2Ft_M_uiHheZ5f=s96-c",createdAt:"2025-03-22T22:54:40.260Z",updatedAt:"2025-03-22T22:54:40.260Z",firstname:"Abhishek",lastname:"Shaji"},reservation:{id:"cm94wbpbm0000itx1iv9k2mqr",referenceId:"PH6LD6",firstname:"Abhishek",lastname:"Shaji",phone:"+48570135862",guests:6,date:new Date("2025-04-08T20:00:00.000Z"),createdAt:"2025-03-22T22:54:40.260Z",acceptedAt:"2025-03-22T23:00:23.456Z",cancelledAt:null},organization:{id:"cm8kthfdq0001lg03b59mdy7b",name:"Madras Bistro",phone:"+48570135862",email:"contact@madrasbistro.pl",createdAt:"2025-03-22T23:05:14.271Z",legalEntityId:null,address:{id:"cm8kthfdr0002lg0350ijialt",firstname:null,lastname:null,phone:null,addressLineOne:"Plac Bohater\xF3w Getta 2",doorNumber:null,addressLineTwo:"3",zipCode:"33-332",city:"Krak\xF3w",country:"PL",latitude:50.04647,longitude:19.95508,isDefault:!1,deliveryInstructions:null,placeId:"ChIJJ0oJ4wdbFkcRzM2QfH7O49o",createdAt:"2025-03-22T23:05:14.271Z",createdBy:null,updatedAt:"2025-03-22T23:05:14.271Z",updatedBy:null,deletedAt:null,deletedBy:null},configurationId:"cm8kthfdr0003lg03zmxz6v4j",logo:null,logoId:"cm8kthfdq0000lg0351daejow",updatedAt:"2025-03-22T23:05:14.271Z",updatedBy:null,deletedAt:null,deletedBy:null,slug:"madras-bistro"}};u.PreviewProps=P;export default u;export{u as ReservationUpdatedEmail};
|
package/src/schemas/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from "../features/order/fulfilment.schema";
|
|
|
22
22
|
export * from "../features/file/file.schema";
|
|
23
23
|
export * from "../features/order/recipient.schema";
|
|
24
24
|
export * from "./currency.schema";
|
|
25
|
+
export * from "./time-zone.schema";
|
|
25
26
|
export * from "../core/auth/auth.schema";
|
|
26
27
|
export * from "./address.schema";
|
|
27
28
|
export * from "./params.schema";
|
package/src/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"../features/analytics/analytics.schema";export*from"../features/access/access.schema";export*from"../features/cart/cart.schema";export*from"./error.schema";export*from"../core/auth/headers.schema";export*from"../features/integration/integration.schema";export*from"../features/product/product.schema";export*from"../core/auth/user.schema";export*from"./pagination.schema";export*from"../features/order/order.schema";export*from"../features/organization/organization.schema";export*from"../features/shipping-method/shipping-method.schema";export*from"../features/product-category/product-category.schema";export*from"../features/shipping-method/shipping-zone.schema";export*from"../features/product/product-modifier.schema";export*from"../features/organization/organization-configuration.schema";export*from"./number.schema";export*from"../features/manufacturer/manufacturer.schema";export*from"./locales.schema";export*from"../features/organization/legal-entity.schema";export*from"../features/order/fulfilment.schema";export*from"../features/file/file.schema";export*from"../features/order/recipient.schema";export*from"./currency.schema";export*from"../core/auth/auth.schema";export*from"./address.schema";export*from"./params.schema";export*from"../features/location/location.schema";export*from"../features/payment/payment.schema";export*from"../features/reservation/reservation.schema";export*from"../features/customer/customer.schema";
|
|
1
|
+
export*from"../features/analytics/analytics.schema";export*from"../features/access/access.schema";export*from"../features/cart/cart.schema";export*from"./error.schema";export*from"../core/auth/headers.schema";export*from"../features/integration/integration.schema";export*from"../features/product/product.schema";export*from"../core/auth/user.schema";export*from"./pagination.schema";export*from"../features/order/order.schema";export*from"../features/organization/organization.schema";export*from"../features/shipping-method/shipping-method.schema";export*from"../features/product-category/product-category.schema";export*from"../features/shipping-method/shipping-zone.schema";export*from"../features/product/product-modifier.schema";export*from"../features/organization/organization-configuration.schema";export*from"./number.schema";export*from"../features/manufacturer/manufacturer.schema";export*from"./locales.schema";export*from"../features/organization/legal-entity.schema";export*from"../features/order/fulfilment.schema";export*from"../features/file/file.schema";export*from"../features/order/recipient.schema";export*from"./currency.schema";export*from"./time-zone.schema";export*from"../core/auth/auth.schema";export*from"./address.schema";export*from"./params.schema";export*from"../features/location/location.schema";export*from"../features/payment/payment.schema";export*from"../features/reservation/reservation.schema";export*from"../features/customer/customer.schema";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const DEFAULT_ORGANIZATION_TIME_ZONE = "Europe/Warsaw";
|
|
3
|
+
export declare const supportedTimeZones: readonly ["UTC", "Europe/Warsaw", "Europe/London", "Europe/Dublin", "Europe/Lisbon", "Europe/Madrid", "Europe/Paris", "Europe/Amsterdam", "Europe/Brussels", "Europe/Berlin", "Europe/Zurich", "Europe/Rome", "Europe/Prague", "Europe/Vienna", "Europe/Budapest", "Europe/Copenhagen", "Europe/Stockholm", "Europe/Oslo", "Europe/Helsinki", "Europe/Athens", "Europe/Bucharest", "Europe/Sofia", "Europe/Istanbul", "Europe/Kyiv", "Europe/Vilnius", "Europe/Riga", "Europe/Tallinn", "Europe/Moscow", "America/St_Johns", "America/Halifax", "America/New_York", "America/Toronto", "America/Chicago", "America/Winnipeg", "America/Denver", "America/Phoenix", "America/Edmonton", "America/Los_Angeles", "America/Vancouver", "America/Anchorage", "Pacific/Honolulu", "America/Mexico_City", "America/Bogota", "America/Lima", "America/Santiago", "America/Sao_Paulo", "America/Argentina/Buenos_Aires", "Africa/Casablanca", "Africa/Cairo", "Africa/Johannesburg", "Asia/Dubai", "Asia/Riyadh", "Asia/Jerusalem", "Asia/Tehran", "Asia/Karachi", "Asia/Kolkata", "Asia/Dhaka", "Asia/Bangkok", "Asia/Singapore", "Asia/Hong_Kong", "Asia/Shanghai", "Asia/Taipei", "Asia/Seoul", "Asia/Tokyo", "Australia/Perth", "Australia/Adelaide", "Australia/Sydney", "Pacific/Auckland"];
|
|
4
|
+
export declare const timeZoneOptions: {
|
|
5
|
+
value: "Europe/Warsaw" | "UTC" | "Europe/London" | "Europe/Dublin" | "Europe/Lisbon" | "Europe/Madrid" | "Europe/Paris" | "Europe/Amsterdam" | "Europe/Brussels" | "Europe/Berlin" | "Europe/Zurich" | "Europe/Rome" | "Europe/Prague" | "Europe/Vienna" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Stockholm" | "Europe/Oslo" | "Europe/Helsinki" | "Europe/Athens" | "Europe/Bucharest" | "Europe/Sofia" | "Europe/Istanbul" | "Europe/Kyiv" | "Europe/Vilnius" | "Europe/Riga" | "Europe/Tallinn" | "Europe/Moscow" | "America/St_Johns" | "America/Halifax" | "America/New_York" | "America/Toronto" | "America/Chicago" | "America/Winnipeg" | "America/Denver" | "America/Phoenix" | "America/Edmonton" | "America/Los_Angeles" | "America/Vancouver" | "America/Anchorage" | "Pacific/Honolulu" | "America/Mexico_City" | "America/Bogota" | "America/Lima" | "America/Santiago" | "America/Sao_Paulo" | "America/Argentina/Buenos_Aires" | "Africa/Casablanca" | "Africa/Cairo" | "Africa/Johannesburg" | "Asia/Dubai" | "Asia/Riyadh" | "Asia/Jerusalem" | "Asia/Tehran" | "Asia/Karachi" | "Asia/Kolkata" | "Asia/Dhaka" | "Asia/Bangkok" | "Asia/Singapore" | "Asia/Hong_Kong" | "Asia/Shanghai" | "Asia/Taipei" | "Asia/Seoul" | "Asia/Tokyo" | "Australia/Perth" | "Australia/Adelaide" | "Australia/Sydney" | "Pacific/Auckland";
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const isValidTimeZone: (value: string) => boolean;
|
|
9
|
+
export declare const defaultTimeZone: z.ZodString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as r}from"@hono/zod-openapi";export const DEFAULT_ORGANIZATION_TIME_ZONE="Europe/Warsaw",supportedTimeZones=["UTC","Europe/Warsaw","Europe/London","Europe/Dublin","Europe/Lisbon","Europe/Madrid","Europe/Paris","Europe/Amsterdam","Europe/Brussels","Europe/Berlin","Europe/Zurich","Europe/Rome","Europe/Prague","Europe/Vienna","Europe/Budapest","Europe/Copenhagen","Europe/Stockholm","Europe/Oslo","Europe/Helsinki","Europe/Athens","Europe/Bucharest","Europe/Sofia","Europe/Istanbul","Europe/Kyiv","Europe/Vilnius","Europe/Riga","Europe/Tallinn","Europe/Moscow","America/St_Johns","America/Halifax","America/New_York","America/Toronto","America/Chicago","America/Winnipeg","America/Denver","America/Phoenix","America/Edmonton","America/Los_Angeles","America/Vancouver","America/Anchorage","Pacific/Honolulu","America/Mexico_City","America/Bogota","America/Lima","America/Santiago","America/Sao_Paulo","America/Argentina/Buenos_Aires","Africa/Casablanca","Africa/Cairo","Africa/Johannesburg","Asia/Dubai","Asia/Riyadh","Asia/Jerusalem","Asia/Tehran","Asia/Karachi","Asia/Kolkata","Asia/Dhaka","Asia/Bangkok","Asia/Singapore","Asia/Hong_Kong","Asia/Shanghai","Asia/Taipei","Asia/Seoul","Asia/Tokyo","Australia/Perth","Australia/Adelaide","Australia/Sydney","Pacific/Auckland"];const i=new Set(supportedTimeZones);export const timeZoneOptions=supportedTimeZones.map(e=>({value:e,label:e.replace(/_/g," ")})),isValidTimeZone=e=>{const a=e.trim();if(!a)return!1;if(i.has(a))return!0;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}).format(new Date),!0}catch{return!1}},defaultTimeZone=r.string().trim().min(1,"Time zone is required").refine(isValidTimeZone,"Invalid time zone").openapi({example:DEFAULT_ORGANIZATION_TIME_ZONE,description:"Default IANA time zone for the organization"});
|