From b1330b828ad960ed78ce4273c1f0d3008b0e3c2a Mon Sep 17 00:00:00 2001 From: "amplication[bot]" Date: Thu, 11 Apr 2024 13:41:51 +0000 Subject: [PATCH 1/2] Amplication build # cluvacjsq01241upfmo987t2b Congratulations on your first commit with Amplication! We encourage you to continue exploring the many ways Amplication can supercharge your development. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you find Amplication useful, please show your support and give our GitHub repo a star ⭐️ This simple action helps our open-source project grow and reach more developers like you. Thank you and happy coding! Build URL: [https://app.amplication-sandbox.com/clte3ekxk00064uis9y053fqx/cluva4e280000nm1qlucbvizr/cluva7ffe00011upfyk074oua/builds/cluvacjsq01241upfmo987t2b](https://app.amplication-sandbox.com/clte3ekxk00064uis9y053fqx/cluva4e280000nm1qlucbvizr/cluva7ffe00011upfyk074oua/builds/cluvacjsq01241upfmo987t2b) --- apps/roi-cacl-2-admin/.dockerignore | 7 + apps/roi-cacl-2-admin/.env | 2 + apps/roi-cacl-2-admin/.gitignore | 23 + apps/roi-cacl-2-admin/Dockerfile | 51 + apps/roi-cacl-2-admin/README.md | 47 + .../roi-cacl-2-admin/configuration/nginx.conf | 11 + apps/roi-cacl-2-admin/package.json | 60 + apps/roi-cacl-2-admin/public/favicon.ico | Bin 0 -> 6548 bytes apps/roi-cacl-2-admin/public/index.html | 40 + apps/roi-cacl-2-admin/public/logo192.png | Bin 0 -> 9721 bytes apps/roi-cacl-2-admin/public/logo512.png | Bin 0 -> 17361 bytes apps/roi-cacl-2-admin/public/manifest.json | 25 + apps/roi-cacl-2-admin/public/robots.txt | 3 + apps/roi-cacl-2-admin/src/App.scss | 59 + apps/roi-cacl-2-admin/src/App.tsx | 369 ++++ .../src/Components/Pagination.tsx | 10 + apps/roi-cacl-2-admin/src/Login.tsx | 117 ++ .../src/account/AccountCreate.tsx | 35 + .../src/account/AccountEdit.tsx | 35 + .../src/account/AccountList.tsx | 39 + .../src/account/AccountShow.tsx | 32 + .../src/account/AccountTitle.ts | 7 + .../src/api/account/Account.ts | 16 + .../src/api/account/AccountCountArgs.ts | 5 + .../src/api/account/AccountCreateInput.ts | 15 + .../src/api/account/AccountFindManyArgs.ts | 9 + .../src/api/account/AccountFindUniqueArgs.ts | 5 + .../api/account/AccountListRelationFilter.ts | 7 + .../src/api/account/AccountOrderByInput.ts | 16 + .../src/api/account/AccountUpdateInput.ts | 15 + .../src/api/account/AccountWhereInput.ts | 19 + .../api/account/AccountWhereUniqueInput.ts | 3 + .../src/api/account/CreateAccountArgs.ts | 5 + .../src/api/account/DeleteAccountArgs.ts | 5 + .../src/api/account/UpdateAccountArgs.ts | 7 + .../roi-cacl-2-admin/src/api/apiKey/ApiKey.ts | 13 + .../src/api/apiKey/ApiKeyCountArgs.ts | 5 + .../src/api/apiKey/ApiKeyCreateInput.ts | 11 + .../src/api/apiKey/ApiKeyFindManyArgs.ts | 9 + .../src/api/apiKey/ApiKeyFindUniqueArgs.ts | 5 + .../api/apiKey/ApiKeyListRelationFilter.ts | 7 + .../src/api/apiKey/ApiKeyOrderByInput.ts | 12 + .../src/api/apiKey/ApiKeyUpdateInput.ts | 11 + .../src/api/apiKey/ApiKeyWhereInput.ts | 17 + .../src/api/apiKey/ApiKeyWhereUniqueInput.ts | 3 + .../src/api/apiKey/CreateApiKeyArgs.ts | 5 + .../src/api/apiKey/DeleteApiKeyArgs.ts | 5 + .../src/api/apiKey/UpdateApiKeyArgs.ts | 7 + ...eyCreateNestedManyWithoutAppModelsInput.ts | 5 + .../ApiKeyUpdateManyWithoutAppModelsInput.ts | 7 + .../src/api/appModel/AppModel.ts | 18 + .../src/api/appModel/AppModelCountArgs.ts | 5 + .../src/api/appModel/AppModelCreateInput.ts | 15 + .../src/api/appModel/AppModelFindManyArgs.ts | 9 + .../api/appModel/AppModelFindUniqueArgs.ts | 5 + .../appModel/AppModelListRelationFilter.ts | 7 + .../src/api/appModel/AppModelOrderByInput.ts | 10 + .../src/api/appModel/AppModelUpdateInput.ts | 15 + .../src/api/appModel/AppModelWhereInput.ts | 17 + .../api/appModel/AppModelWhereUniqueInput.ts | 3 + .../src/api/appModel/CreateAppModelArgs.ts | 5 + ...alCreateNestedManyWithoutAppModelsInput.ts | 5 + ...edentialUpdateManyWithoutAppModelsInput.ts | 7 + .../src/api/appModel/DeleteAppModelArgs.ts | 5 + .../api/appModel/EnumAppModelCategories.ts | 10 + .../src/api/appModel/UpdateAppModelArgs.ts | 7 + ...okCreateNestedManyWithoutAppModelsInput.ts | 5 + .../WebhookUpdateManyWithoutAppModelsInput.ts | 7 + .../src/api/attendee/Attendee.ts | 10 + .../src/api/attendee/AttendeeCountArgs.ts | 5 + .../src/api/attendee/AttendeeCreateInput.ts | 9 + .../src/api/attendee/AttendeeFindManyArgs.ts | 9 + .../api/attendee/AttendeeFindUniqueArgs.ts | 5 + .../attendee/AttendeeListRelationFilter.ts | 7 + .../src/api/attendee/AttendeeOrderByInput.ts | 10 + .../src/api/attendee/AttendeeUpdateInput.ts | 9 + .../src/api/attendee/AttendeeWhereInput.ts | 13 + .../api/attendee/AttendeeWhereUniqueInput.ts | 3 + .../src/api/attendee/CreateAttendeeArgs.ts | 5 + .../src/api/attendee/DeleteAttendeeArgs.ts | 5 + .../src/api/attendee/UpdateAttendeeArgs.ts | 7 + .../src/api/availability/Availability.ts | 14 + .../api/availability/AvailabilityCountArgs.ts | 5 + .../availability/AvailabilityCreateInput.ts | 13 + .../availability/AvailabilityFindManyArgs.ts | 9 + .../AvailabilityFindUniqueArgs.ts | 5 + .../AvailabilityListRelationFilter.ts | 7 + .../availability/AvailabilityOrderByInput.ts | 12 + .../availability/AvailabilityUpdateInput.ts | 13 + .../availability/AvailabilityWhereInput.ts | 17 + .../AvailabilityWhereUniqueInput.ts | 3 + .../availability/CreateAvailabilityArgs.ts | 5 + .../availability/DeleteAvailabilityArgs.ts | 5 + .../availability/UpdateAvailabilityArgs.ts | 7 + ...deeCreateNestedManyWithoutBookingsInput.ts | 5 + .../AttendeeUpdateManyWithoutBookingsInput.ts | 7 + .../src/api/booking/Booking.ts | 40 + .../src/api/booking/BookingCountArgs.ts | 5 + .../src/api/booking/BookingCreateInput.ts | 38 + .../src/api/booking/BookingFindManyArgs.ts | 9 + .../src/api/booking/BookingFindUniqueArgs.ts | 5 + .../api/booking/BookingListRelationFilter.ts | 7 + .../src/api/booking/BookingOrderByInput.ts | 28 + ...nceCreateNestedManyWithoutBookingsInput.ts | 5 + ...ReferenceUpdateManyWithoutBookingsInput.ts | 7 + .../src/api/booking/BookingUpdateInput.ts | 38 + .../src/api/booking/BookingWhereInput.ts | 47 + .../api/booking/BookingWhereUniqueInput.ts | 3 + .../src/api/booking/CreateBookingArgs.ts | 5 + .../src/api/booking/DeleteBookingArgs.ts | 5 + .../src/api/booking/EnumBookingStatus.ts | 6 + ...entCreateNestedManyWithoutBookingsInput.ts | 5 + .../PaymentUpdateManyWithoutBookingsInput.ts | 7 + .../src/api/booking/UpdateBookingArgs.ts | 7 + ...derCreateNestedManyWithoutBookingsInput.ts | 5 + ...wReminderUpdateManyWithoutBookingsInput.ts | 7 + .../api/bookingReference/BookingReference.ts | 13 + .../BookingReferenceCountArgs.ts | 5 + .../BookingReferenceCreateInput.ts | 12 + .../BookingReferenceFindManyArgs.ts | 9 + .../BookingReferenceFindUniqueArgs.ts | 5 + .../BookingReferenceListRelationFilter.ts | 7 + .../BookingReferenceOrderByInput.ts | 13 + .../BookingReferenceUpdateInput.ts | 12 + .../BookingReferenceWhereInput.ts | 17 + .../BookingReferenceWhereUniqueInput.ts | 3 + .../CreateBookingReferenceArgs.ts | 5 + .../DeleteBookingReferenceArgs.ts | 5 + .../UpdateBookingReferenceArgs.ts | 7 + .../api/credential/CreateCredentialArgs.ts | 5 + .../src/api/credential/Credential.ts | 13 + .../src/api/credential/CredentialCountArgs.ts | 5 + .../api/credential/CredentialCreateInput.ts | 12 + .../api/credential/CredentialFindManyArgs.ts | 9 + .../credential/CredentialFindUniqueArgs.ts | 5 + .../CredentialListRelationFilter.ts | 7 + .../api/credential/CredentialOrderByInput.ts | 9 + .../api/credential/CredentialUpdateInput.ts | 12 + .../api/credential/CredentialWhereInput.ts | 15 + .../credential/CredentialWhereUniqueInput.ts | 3 + .../api/credential/DeleteCredentialArgs.ts | 5 + ...CreateNestedManyWithoutCredentialsInput.ts | 5 + ...lendarUpdateManyWithoutCredentialsInput.ts | 7 + .../api/credential/UpdateCredentialArgs.ts | 7 + .../CreateDailyEventReferenceArgs.ts | 5 + .../DailyEventReference.ts | 8 + .../DailyEventReferenceCountArgs.ts | 5 + .../DailyEventReferenceCreateInput.ts | 7 + .../DailyEventReferenceFindManyArgs.ts | 9 + .../DailyEventReferenceFindUniqueArgs.ts | 5 + .../DailyEventReferenceListRelationFilter.ts | 7 + .../DailyEventReferenceOrderByInput.ts | 8 + .../DailyEventReferenceUpdateInput.ts | 7 + .../DailyEventReferenceWhereInput.ts | 10 + .../DailyEventReferenceWhereUniqueInput.ts | 3 + .../DeleteDailyEventReferenceArgs.ts | 5 + .../UpdateDailyEventReferenceArgs.ts | 7 + .../CreateDestinationCalendarArgs.ts | 5 + .../DeleteDestinationCalendarArgs.ts | 5 + .../DestinationCalendar.ts | 14 + .../DestinationCalendarCountArgs.ts | 5 + .../DestinationCalendarCreateInput.ts | 13 + .../DestinationCalendarFindManyArgs.ts | 9 + .../DestinationCalendarFindUniqueArgs.ts | 5 + .../DestinationCalendarListRelationFilter.ts | 7 + .../DestinationCalendarOrderByInput.ts | 11 + .../DestinationCalendarUpdateInput.ts | 13 + .../DestinationCalendarWhereInput.ts | 16 + .../DestinationCalendarWhereUniqueInput.ts | 3 + .../UpdateDestinationCalendarArgs.ts | 7 + ...yCreateNestedManyWithoutEventTypesInput.ts | 5 + ...abilityUpdateManyWithoutEventTypesInput.ts | 7 + ...gCreateNestedManyWithoutEventTypesInput.ts | 5 + ...BookingUpdateManyWithoutEventTypesInput.ts | 7 + .../src/api/eventType/CreateEventTypeArgs.ts | 5 + .../src/api/eventType/DeleteEventTypeArgs.ts | 5 + .../api/eventType/EnumEventTypePeriodType.ts | 5 + .../eventType/EnumEventTypeSchedulingType.ts | 4 + .../src/api/eventType/EventType.ts | 54 + .../src/api/eventType/EventTypeCountArgs.ts | 5 + .../src/api/eventType/EventTypeCreateInput.ts | 53 + ...tCreateNestedManyWithoutEventTypesInput.ts | 5 + ...omInputUpdateManyWithoutEventTypesInput.ts | 7 + .../api/eventType/EventTypeFindManyArgs.ts | 9 + .../api/eventType/EventTypeFindUniqueArgs.ts | 5 + .../eventType/EventTypeListRelationFilter.ts | 7 + .../api/eventType/EventTypeOrderByInput.ts | 38 + .../src/api/eventType/EventTypeUpdateInput.ts | 53 + .../src/api/eventType/EventTypeWhereInput.ts | 61 + .../eventType/EventTypeWhereUniqueInput.ts | 3 + .../src/api/eventType/UpdateEventTypeArgs.ts | 7 + ...rCreateNestedManyWithoutEventTypesInput.ts | 5 + .../UserUpdateManyWithoutEventTypesInput.ts | 7 + ...kCreateNestedManyWithoutEventTypesInput.ts | 5 + ...WebhookUpdateManyWithoutEventTypesInput.ts | 7 + ...eCreateNestedManyWithoutEventTypesInput.ts | 5 + ...entTypeUpdateManyWithoutEventTypesInput.ts | 7 + .../CreateEventTypeCustomInputArgs.ts | 5 + .../DeleteEventTypeCustomInputArgs.ts | 5 + .../EnumEventTypeCustomInputType.ts | 6 + .../EventTypeCustomInput.ts | 10 + .../EventTypeCustomInputCountArgs.ts | 5 + .../EventTypeCustomInputCreateInput.ts | 9 + .../EventTypeCustomInputFindManyArgs.ts | 9 + .../EventTypeCustomInputFindUniqueArgs.ts | 5 + .../EventTypeCustomInputListRelationFilter.ts | 7 + .../EventTypeCustomInputOrderByInput.ts | 10 + .../EventTypeCustomInputUpdateInput.ts | 9 + .../EventTypeCustomInputWhereInput.ts | 13 + .../EventTypeCustomInputWhereUniqueInput.ts | 3 + .../UpdateEventTypeCustomInputArgs.ts | 7 + .../src/api/feedback/CreateFeedbackArgs.ts | 5 + .../src/api/feedback/DeleteFeedbackArgs.ts | 5 + .../src/api/feedback/Feedback.ts | 9 + .../src/api/feedback/FeedbackCountArgs.ts | 5 + .../src/api/feedback/FeedbackCreateInput.ts | 8 + .../src/api/feedback/FeedbackFindManyArgs.ts | 9 + .../api/feedback/FeedbackFindUniqueArgs.ts | 5 + .../feedback/FeedbackListRelationFilter.ts | 7 + .../src/api/feedback/FeedbackOrderByInput.ts | 9 + .../src/api/feedback/FeedbackUpdateInput.ts | 8 + .../src/api/feedback/FeedbackWhereInput.ts | 13 + .../api/feedback/FeedbackWhereUniqueInput.ts | 3 + .../src/api/feedback/UpdateFeedbackArgs.ts | 7 + .../api/hashedLink/CreateHashedLinkArgs.ts | 5 + .../api/hashedLink/DeleteHashedLinkArgs.ts | 5 + .../src/api/hashedLink/HashedLink.ts | 7 + .../src/api/hashedLink/HashedLinkCountArgs.ts | 5 + .../api/hashedLink/HashedLinkCreateInput.ts | 6 + .../api/hashedLink/HashedLinkFindManyArgs.ts | 9 + .../hashedLink/HashedLinkFindUniqueArgs.ts | 5 + .../HashedLinkListRelationFilter.ts | 7 + .../api/hashedLink/HashedLinkOrderByInput.ts | 7 + .../api/hashedLink/HashedLinkUpdateInput.ts | 6 + .../api/hashedLink/HashedLinkWhereInput.ts | 9 + .../hashedLink/HashedLinkWhereUniqueInput.ts | 3 + .../api/hashedLink/UpdateHashedLinkArgs.ts | 7 + .../impersonation/CreateImpersonationArgs.ts | 5 + .../impersonation/DeleteImpersonationArgs.ts | 5 + .../src/api/impersonation/Impersonation.ts | 8 + .../impersonation/ImpersonationCountArgs.ts | 5 + .../impersonation/ImpersonationCreateInput.ts | 6 + .../ImpersonationFindManyArgs.ts | 9 + .../ImpersonationFindUniqueArgs.ts | 5 + .../ImpersonationListRelationFilter.ts | 7 + .../ImpersonationOrderByInput.ts | 8 + .../impersonation/ImpersonationUpdateInput.ts | 6 + .../impersonation/ImpersonationWhereInput.ts | 10 + .../ImpersonationWhereUniqueInput.ts | 3 + .../impersonation/UpdateImpersonationArgs.ts | 7 + .../api/membership/CreateMembershipArgs.ts | 5 + .../api/membership/DeleteMembershipArgs.ts | 5 + .../src/api/membership/EnumMembershipRole.ts | 5 + .../src/api/membership/Membership.ts | 10 + .../src/api/membership/MembershipCountArgs.ts | 5 + .../api/membership/MembershipCreateInput.ts | 9 + .../api/membership/MembershipFindManyArgs.ts | 9 + .../membership/MembershipFindUniqueArgs.ts | 5 + .../MembershipListRelationFilter.ts | 7 + .../api/membership/MembershipOrderByInput.ts | 9 + .../api/membership/MembershipUpdateInput.ts | 9 + .../api/membership/MembershipWhereInput.ts | 12 + .../membership/MembershipWhereUniqueInput.ts | 3 + .../api/membership/UpdateMembershipArgs.ts | 7 + .../src/api/payment/CreatePaymentArgs.ts | 5 + .../src/api/payment/DeletePaymentArgs.ts | 5 + .../src/api/payment/EnumPaymentType.ts | 3 + .../src/api/payment/Payment.ts | 16 + .../src/api/payment/PaymentCountArgs.ts | 5 + .../src/api/payment/PaymentCreateInput.ts | 15 + .../src/api/payment/PaymentFindManyArgs.ts | 9 + .../src/api/payment/PaymentFindUniqueArgs.ts | 5 + .../api/payment/PaymentListRelationFilter.ts | 7 + .../src/api/payment/PaymentOrderByInput.ts | 15 + .../src/api/payment/PaymentUpdateInput.ts | 15 + .../src/api/payment/PaymentWhereInput.ts | 19 + .../api/payment/PaymentWhereUniqueInput.ts | 3 + .../src/api/payment/UpdatePaymentArgs.ts | 7 + .../reminderMail/CreateReminderMailArgs.ts | 5 + .../reminderMail/DeleteReminderMailArgs.ts | 5 + .../EnumReminderMailReminderType.ts | 3 + .../src/api/reminderMail/ReminderMail.ts | 7 + .../api/reminderMail/ReminderMailCountArgs.ts | 5 + .../reminderMail/ReminderMailCreateInput.ts | 5 + .../reminderMail/ReminderMailFindManyArgs.ts | 9 + .../ReminderMailFindUniqueArgs.ts | 5 + .../ReminderMailListRelationFilter.ts | 7 + .../reminderMail/ReminderMailOrderByInput.ts | 9 + .../reminderMail/ReminderMailUpdateInput.ts | 5 + .../reminderMail/ReminderMailWhereInput.ts | 10 + .../ReminderMailWhereUniqueInput.ts | 3 + .../reminderMail/UpdateReminderMailArgs.ts | 7 + .../CreateResetPasswordRequestArgs.ts | 5 + .../DeleteResetPasswordRequestArgs.ts | 5 + .../ResetPasswordRequest.ts | 7 + .../ResetPasswordRequestCountArgs.ts | 5 + .../ResetPasswordRequestCreateInput.ts | 4 + .../ResetPasswordRequestFindManyArgs.ts | 9 + .../ResetPasswordRequestFindUniqueArgs.ts | 5 + .../ResetPasswordRequestListRelationFilter.ts | 7 + .../ResetPasswordRequestOrderByInput.ts | 9 + .../ResetPasswordRequestUpdateInput.ts | 4 + .../ResetPasswordRequestWhereInput.ts | 10 + .../ResetPasswordRequestWhereUniqueInput.ts | 3 + .../UpdateResetPasswordRequestArgs.ts | 7 + ...tyCreateNestedManyWithoutSchedulesInput.ts | 5 + ...labilityUpdateManyWithoutSchedulesInput.ts | 7 + .../src/api/schedule/CreateScheduleArgs.ts | 5 + .../src/api/schedule/DeleteScheduleArgs.ts | 5 + ...peCreateNestedManyWithoutSchedulesInput.ts | 5 + ...ventTypeUpdateManyWithoutSchedulesInput.ts | 7 + .../src/api/schedule/Schedule.ts | 12 + .../src/api/schedule/ScheduleCountArgs.ts | 5 + .../src/api/schedule/ScheduleCreateInput.ts | 11 + .../src/api/schedule/ScheduleFindManyArgs.ts | 9 + .../api/schedule/ScheduleFindUniqueArgs.ts | 5 + .../schedule/ScheduleListRelationFilter.ts | 7 + .../src/api/schedule/ScheduleOrderByInput.ts | 8 + .../src/api/schedule/ScheduleUpdateInput.ts | 11 + .../src/api/schedule/ScheduleWhereInput.ts | 15 + .../api/schedule/ScheduleWhereUniqueInput.ts | 3 + .../src/api/schedule/UpdateScheduleArgs.ts | 7 + .../CreateSelectedCalendarArgs.ts | 5 + .../DeleteSelectedCalendarArgs.ts | 5 + .../api/selectedCalendar/SelectedCalendar.ts | 8 + .../SelectedCalendarCountArgs.ts | 5 + .../SelectedCalendarCreateInput.ts | 7 + .../SelectedCalendarFindManyArgs.ts | 9 + .../SelectedCalendarFindUniqueArgs.ts | 5 + .../SelectedCalendarListRelationFilter.ts | 7 + .../SelectedCalendarOrderByInput.ts | 8 + .../SelectedCalendarUpdateInput.ts | 7 + .../SelectedCalendarWhereInput.ts | 10 + .../SelectedCalendarWhereUniqueInput.ts | 3 + .../UpdateSelectedCalendarArgs.ts | 7 + .../src/api/session/CreateSessionArgs.ts | 5 + .../src/api/session/DeleteSessionArgs.ts | 5 + .../src/api/session/Session.ts | 8 + .../src/api/session/SessionCountArgs.ts | 5 + .../src/api/session/SessionCreateInput.ts | 7 + .../src/api/session/SessionFindManyArgs.ts | 9 + .../src/api/session/SessionFindUniqueArgs.ts | 5 + .../api/session/SessionListRelationFilter.ts | 7 + .../src/api/session/SessionOrderByInput.ts | 8 + .../src/api/session/SessionUpdateInput.ts | 7 + .../src/api/session/SessionWhereInput.ts | 10 + .../api/session/SessionWhereUniqueInput.ts | 3 + .../src/api/session/UpdateSessionArgs.ts | 7 + .../src/api/team/CreateTeamArgs.ts | 5 + .../src/api/team/DeleteTeamArgs.ts | 5 + ...ntTypeCreateNestedManyWithoutTeamsInput.ts | 5 + .../EventTypeUpdateManyWithoutTeamsInput.ts | 7 + ...ershipCreateNestedManyWithoutTeamsInput.ts | 5 + .../MembershipUpdateManyWithoutTeamsInput.ts | 7 + apps/roi-cacl-2-admin/src/api/team/Team.ts | 13 + .../src/api/team/TeamCountArgs.ts | 5 + .../src/api/team/TeamCreateInput.ts | 12 + .../src/api/team/TeamFindManyArgs.ts | 9 + .../src/api/team/TeamFindUniqueArgs.ts | 5 + .../src/api/team/TeamListRelationFilter.ts | 7 + .../src/api/team/TeamOrderByInput.ts | 10 + .../src/api/team/TeamUpdateInput.ts | 12 + .../src/api/team/TeamWhereInput.ts | 16 + .../src/api/team/TeamWhereUniqueInput.ts | 3 + .../src/api/team/UpdateTeamArgs.ts | 7 + ...ccountCreateNestedManyWithoutUsersInput.ts | 5 + .../AccountUpdateManyWithoutUsersInput.ts | 7 + ...ApiKeyCreateNestedManyWithoutUsersInput.ts | 5 + .../user/ApiKeyUpdateManyWithoutUsersInput.ts | 7 + ...bilityCreateNestedManyWithoutUsersInput.ts | 5 + ...AvailabilityUpdateManyWithoutUsersInput.ts | 7 + ...ookingCreateNestedManyWithoutUsersInput.ts | 5 + .../BookingUpdateManyWithoutUsersInput.ts | 7 + .../src/api/user/CreateUserArgs.ts | 5 + ...entialCreateNestedManyWithoutUsersInput.ts | 5 + .../CredentialUpdateManyWithoutUsersInput.ts | 7 + .../src/api/user/DeleteUserArgs.ts | 5 + .../src/api/user/EnumUserIdentityProvider.ts | 5 + .../src/api/user/EnumUserPlan.ts | 5 + .../src/api/user/EnumUserRole.ts | 6 + ...ntTypeCreateNestedManyWithoutUsersInput.ts | 5 + .../EventTypeUpdateManyWithoutUsersInput.ts | 7 + ...edbackCreateNestedManyWithoutUsersInput.ts | 5 + .../FeedbackUpdateManyWithoutUsersInput.ts | 7 + ...nationCreateNestedManyWithoutUsersInput.ts | 5 + ...mpersonationUpdateManyWithoutUsersInput.ts | 7 + ...ershipCreateNestedManyWithoutUsersInput.ts | 5 + .../MembershipUpdateManyWithoutUsersInput.ts | 7 + ...heduleCreateNestedManyWithoutUsersInput.ts | 5 + .../ScheduleUpdateManyWithoutUsersInput.ts | 7 + ...lendarCreateNestedManyWithoutUsersInput.ts | 5 + ...ctedCalendarUpdateManyWithoutUsersInput.ts | 7 + ...essionCreateNestedManyWithoutUsersInput.ts | 5 + .../SessionUpdateManyWithoutUsersInput.ts | 7 + .../src/api/user/UpdateUserArgs.ts | 7 + apps/roi-cacl-2-admin/src/api/user/User.ts | 70 + .../src/api/user/UserCountArgs.ts | 5 + .../src/api/user/UserCreateInput.ts | 68 + .../src/api/user/UserFindManyArgs.ts | 9 + .../src/api/user/UserFindUniqueArgs.ts | 5 + .../src/api/user/UserListRelationFilter.ts | 7 + .../src/api/user/UserOrderByInput.ts | 40 + .../src/api/user/UserUpdateInput.ts | 68 + .../src/api/user/UserWhereInput.ts | 78 + .../src/api/user/UserWhereUniqueInput.ts | 3 + ...ebhookCreateNestedManyWithoutUsersInput.ts | 5 + .../WebhookUpdateManyWithoutUsersInput.ts | 7 + ...rkflowCreateNestedManyWithoutUsersInput.ts | 5 + .../WorkflowUpdateManyWithoutUsersInput.ts | 7 + .../CreateVerificationTokenArgs.ts | 5 + .../DeleteVerificationTokenArgs.ts | 5 + .../UpdateVerificationTokenArgs.ts | 7 + .../verificationToken/VerificationToken.ts | 8 + .../VerificationTokenCountArgs.ts | 5 + .../VerificationTokenCreateInput.ts | 5 + .../VerificationTokenFindManyArgs.ts | 9 + .../VerificationTokenFindUniqueArgs.ts | 5 + .../VerificationTokenListRelationFilter.ts | 7 + .../VerificationTokenOrderByInput.ts | 10 + .../VerificationTokenUpdateInput.ts | 5 + .../VerificationTokenWhereInput.ts | 12 + .../VerificationTokenWhereUniqueInput.ts | 3 + .../src/api/webhook/CreateWebhookArgs.ts | 5 + .../src/api/webhook/DeleteWebhookArgs.ts | 5 + .../api/webhook/EnumWebhookEventTriggers.ts | 5 + .../src/api/webhook/UpdateWebhookArgs.ts | 7 + .../src/api/webhook/Webhook.ts | 18 + .../src/api/webhook/WebhookCountArgs.ts | 5 + .../src/api/webhook/WebhookCreateInput.ts | 16 + .../src/api/webhook/WebhookFindManyArgs.ts | 9 + .../src/api/webhook/WebhookFindUniqueArgs.ts | 5 + .../api/webhook/WebhookListRelationFilter.ts | 7 + .../src/api/webhook/WebhookOrderByInput.ts | 14 + .../src/api/webhook/WebhookUpdateInput.ts | 16 + .../src/api/webhook/WebhookWhereInput.ts | 19 + .../api/webhook/WebhookWhereUniqueInput.ts | 3 + .../src/api/workflow/CreateWorkflowArgs.ts | 5 + .../src/api/workflow/DeleteWorkflowArgs.ts | 5 + .../src/api/workflow/EnumWorkflowTimeUnit.ts | 5 + .../src/api/workflow/EnumWorkflowTrigger.ts | 5 + .../src/api/workflow/UpdateWorkflowArgs.ts | 7 + .../src/api/workflow/Workflow.ts | 14 + .../src/api/workflow/WorkflowCountArgs.ts | 5 + .../src/api/workflow/WorkflowCreateInput.ts | 13 + .../src/api/workflow/WorkflowFindManyArgs.ts | 9 + .../api/workflow/WorkflowFindUniqueArgs.ts | 5 + .../workflow/WorkflowListRelationFilter.ts | 7 + .../src/api/workflow/WorkflowOrderByInput.ts | 10 + ...epCreateNestedManyWithoutWorkflowsInput.ts | 5 + ...flowStepUpdateManyWithoutWorkflowsInput.ts | 7 + .../src/api/workflow/WorkflowUpdateInput.ts | 13 + .../src/api/workflow/WorkflowWhereInput.ts | 17 + .../api/workflow/WorkflowWhereUniqueInput.ts | 3 + ...peCreateNestedManyWithoutWorkflowsInput.ts | 5 + ...ventTypeUpdateManyWithoutWorkflowsInput.ts | 7 + .../CreateWorkflowReminderArgs.ts | 5 + .../DeleteWorkflowReminderArgs.ts | 5 + .../EnumWorkflowReminderMethod.ts | 4 + .../UpdateWorkflowReminderArgs.ts | 7 + .../api/workflowReminder/WorkflowReminder.ts | 12 + .../WorkflowReminderCountArgs.ts | 5 + .../WorkflowReminderCreateInput.ts | 11 + .../WorkflowReminderFindManyArgs.ts | 9 + .../WorkflowReminderFindUniqueArgs.ts | 5 + .../WorkflowReminderListRelationFilter.ts | 7 + .../WorkflowReminderOrderByInput.ts | 11 + .../WorkflowReminderUpdateInput.ts | 11 + .../WorkflowReminderWhereInput.ts | 16 + .../WorkflowReminderWhereUniqueInput.ts | 3 + .../workflowStep/CreateWorkflowStepArgs.ts | 5 + .../workflowStep/DeleteWorkflowStepArgs.ts | 5 + .../workflowStep/EnumWorkflowStepAction.ts | 6 + .../workflowStep/EnumWorkflowStepTemplate.ts | 4 + .../workflowStep/UpdateWorkflowStepArgs.ts | 7 + ...eateNestedManyWithoutWorkflowStepsInput.ts | 5 + ...nderUpdateManyWithoutWorkflowStepsInput.ts | 7 + .../src/api/workflowStep/WorkflowStep.ts | 14 + .../api/workflowStep/WorkflowStepCountArgs.ts | 5 + .../workflowStep/WorkflowStepCreateInput.ts | 13 + .../workflowStep/WorkflowStepFindManyArgs.ts | 9 + .../WorkflowStepFindUniqueArgs.ts | 5 + .../WorkflowStepListRelationFilter.ts | 7 + .../workflowStep/WorkflowStepOrderByInput.ts | 12 + .../workflowStep/WorkflowStepUpdateInput.ts | 13 + .../workflowStep/WorkflowStepWhereInput.ts | 16 + .../WorkflowStepWhereUniqueInput.ts | 3 + .../CreateWorkflowsOnEventTypeArgs.ts | 5 + .../DeleteWorkflowsOnEventTypeArgs.ts | 5 + .../UpdateWorkflowsOnEventTypeArgs.ts | 7 + .../WorkflowsOnEventType.ts | 8 + .../WorkflowsOnEventTypeCountArgs.ts | 5 + .../WorkflowsOnEventTypeCreateInput.ts | 7 + .../WorkflowsOnEventTypeFindManyArgs.ts | 9 + .../WorkflowsOnEventTypeFindUniqueArgs.ts | 5 + .../WorkflowsOnEventTypeListRelationFilter.ts | 7 + .../WorkflowsOnEventTypeOrderByInput.ts | 7 + .../WorkflowsOnEventTypeUpdateInput.ts | 7 + .../WorkflowsOnEventTypeWhereInput.ts | 9 + .../WorkflowsOnEventTypeWhereUniqueInput.ts | 3 + .../src/apiKey/ApiKeyCreate.tsx | 37 + .../src/apiKey/ApiKeyEdit.tsx | 37 + .../src/apiKey/ApiKeyList.tsx | 43 + .../src/apiKey/ApiKeyShow.tsx | 36 + .../src/apiKey/ApiKeyTitle.ts | 7 + .../src/appModel/AppModelCreate.tsx | 63 + .../src/appModel/AppModelEdit.tsx | 63 + .../src/appModel/AppModelList.tsx | 24 + .../src/appModel/AppModelShow.tsx | 101 + .../src/appModel/AppModelTitle.ts | 7 + .../src/attendee/AttendeeCreate.tsx | 26 + .../src/attendee/AttendeeEdit.tsx | 26 + .../src/attendee/AttendeeList.tsx | 33 + .../src/attendee/AttendeeShow.tsx | 26 + .../src/attendee/AttendeeTitle.ts | 7 + .../src/auth-provider/ra-auth-http.ts | 78 + .../src/auth-provider/ra-auth-jwt.ts | 72 + apps/roi-cacl-2-admin/src/auth.ts | 34 + .../src/availability/AvailabilityCreate.tsx | 45 + .../src/availability/AvailabilityEdit.tsx | 45 + .../src/availability/AvailabilityList.tsx | 49 + .../src/availability/AvailabilityShow.tsx | 42 + .../src/availability/AvailabilityTitle.ts | 7 + .../src/booking/BookingCreate.tsx | 123 ++ .../src/booking/BookingEdit.tsx | 123 ++ .../src/booking/BookingList.tsx | 82 + .../src/booking/BookingShow.tsx | 177 ++ .../src/booking/BookingTitle.ts | 7 + .../BookingReferenceCreate.tsx | 34 + .../bookingReference/BookingReferenceEdit.tsx | 32 + .../bookingReference/BookingReferenceList.tsx | 37 + .../bookingReference/BookingReferenceShow.tsx | 30 + .../bookingReference/BookingReferenceTitle.ts | 7 + apps/roi-cacl-2-admin/src/constants.ts | 2 + .../src/credential/CredentialCreate.tsx | 45 + .../src/credential/CredentialEdit.tsx | 45 + .../src/credential/CredentialList.tsx | 39 + .../src/credential/CredentialShow.tsx | 74 + .../src/credential/CredentialTitle.ts | 7 + .../DailyEventReferenceCreate.tsx | 26 + .../DailyEventReferenceEdit.tsx | 26 + .../DailyEventReferenceList.tsx | 33 + .../DailyEventReferenceShow.tsx | 26 + .../DailyEventReferenceTitle.ts | 9 + .../src/data-provider/graphqlDataProvider.ts | 28 + .../DestinationCalendarCreate.tsx | 46 + .../DestinationCalendarEdit.tsx | 46 + .../DestinationCalendarList.tsx | 53 + .../DestinationCalendarShow.tsx | 46 + .../DestinationCalendarTitle.ts | 9 + .../src/eventType/EventTypeCreate.tsx | 178 ++ .../src/eventType/EventTypeEdit.tsx | 178 ++ .../src/eventType/EventTypeList.tsx | 92 + .../src/eventType/EventTypeShow.tsx | 261 +++ .../src/eventType/EventTypeTitle.ts | 7 + .../EventTypeCustomInputCreate.tsx | 46 + .../EventTypeCustomInputEdit.tsx | 46 + .../EventTypeCustomInputList.tsx | 40 + .../EventTypeCustomInputShow.tsx | 33 + .../EventTypeCustomInputTitle.ts | 9 + .../src/feedback/FeedbackCreate.tsx | 28 + .../src/feedback/FeedbackEdit.tsx | 28 + .../src/feedback/FeedbackList.tsx | 32 + .../src/feedback/FeedbackShow.tsx | 25 + .../src/feedback/FeedbackTitle.ts | 7 + .../src/hashedLink/HashedLinkCreate.tsx | 27 + .../src/hashedLink/HashedLinkEdit.tsx | 27 + .../src/hashedLink/HashedLinkList.tsx | 34 + .../src/hashedLink/HashedLinkShow.tsx | 27 + .../src/hashedLink/HashedLinkTitle.ts | 7 + .../src/impersonation/ImpersonationCreate.tsx | 32 + .../src/impersonation/ImpersonationEdit.tsx | 32 + .../src/impersonation/ImpersonationList.tsx | 42 + .../src/impersonation/ImpersonationShow.tsx | 35 + .../src/impersonation/ImpersonationTitle.ts | 7 + apps/roi-cacl-2-admin/src/index.css | 26 + apps/roi-cacl-2-admin/src/index.tsx | 18 + apps/roi-cacl-2-admin/src/login.scss | 119 ++ .../src/membership/MembershipCreate.tsx | 38 + .../src/membership/MembershipEdit.tsx | 38 + .../src/membership/MembershipList.tsx | 36 + .../src/membership/MembershipShow.tsx | 29 + .../src/membership/MembershipTitle.ts | 7 + apps/roi-cacl-2-admin/src/pages/Dashboard.tsx | 12 + .../src/payment/PaymentCreate.tsx | 41 + .../src/payment/PaymentEdit.tsx | 41 + .../src/payment/PaymentList.tsx | 39 + .../src/payment/PaymentShow.tsx | 32 + .../src/payment/PaymentTitle.ts | 7 + .../src/reminderMail/ReminderMailCreate.tsx | 31 + .../src/reminderMail/ReminderMailEdit.tsx | 31 + .../src/reminderMail/ReminderMailList.tsx | 23 + .../src/reminderMail/ReminderMailShow.tsx | 22 + .../src/reminderMail/ReminderMailTitle.ts | 7 + apps/roi-cacl-2-admin/src/reportWebVitals.ts | 17 + .../ResetPasswordRequestCreate.tsx | 21 + .../ResetPasswordRequestEdit.tsx | 21 + .../ResetPasswordRequestList.tsx | 25 + .../ResetPasswordRequestShow.tsx | 24 + .../ResetPasswordRequestTitle.ts | 9 + .../src/schedule/ScheduleCreate.tsx | 46 + .../src/schedule/ScheduleEdit.tsx | 46 + .../src/schedule/ScheduleList.tsx | 31 + .../src/schedule/ScheduleShow.tsx | 141 ++ .../src/schedule/ScheduleTitle.ts | 7 + .../SelectedCalendarCreate.tsx | 26 + .../selectedCalendar/SelectedCalendarEdit.tsx | 24 + .../selectedCalendar/SelectedCalendarList.tsx | 31 + .../selectedCalendar/SelectedCalendarShow.tsx | 24 + .../selectedCalendar/SelectedCalendarTitle.ts | 7 + .../src/session/SessionCreate.tsx | 27 + .../src/session/SessionEdit.tsx | 27 + .../src/session/SessionList.tsx | 31 + .../src/session/SessionShow.tsx | 24 + .../src/session/SessionTitle.ts | 7 + apps/roi-cacl-2-admin/src/setupTests.ts | 5 + apps/roi-cacl-2-admin/src/team/TeamCreate.tsx | 44 + apps/roi-cacl-2-admin/src/team/TeamEdit.tsx | 44 + apps/roi-cacl-2-admin/src/team/TeamList.tsx | 30 + apps/roi-cacl-2-admin/src/team/TeamShow.tsx | 127 ++ apps/roi-cacl-2-admin/src/team/TeamTitle.ts | 7 + apps/roi-cacl-2-admin/src/theme/theme.ts | 33 + apps/roi-cacl-2-admin/src/types.ts | 13 + apps/roi-cacl-2-admin/src/user/EnumRoles.ts | 3 + .../roi-cacl-2-admin/src/user/RolesOptions.ts | 11 + apps/roi-cacl-2-admin/src/user/UserCreate.tsx | 242 +++ apps/roi-cacl-2-admin/src/user/UserEdit.tsx | 242 +++ apps/roi-cacl-2-admin/src/user/UserList.tsx | 80 + apps/roi-cacl-2-admin/src/user/UserShow.tsx | 405 ++++ apps/roi-cacl-2-admin/src/user/UserTitle.ts | 7 + apps/roi-cacl-2-admin/src/user/roles.ts | 6 + .../src/util/BooleanFilter.ts | 4 + .../src/util/BooleanNullableFilter.ts | 4 + .../src/util/DateTimeFilter.ts | 10 + .../src/util/DateTimeNullableFilter.ts | 10 + apps/roi-cacl-2-admin/src/util/FloatFilter.ts | 10 + .../src/util/FloatNullableFilter.ts | 10 + apps/roi-cacl-2-admin/src/util/IntFilter.ts | 10 + .../src/util/IntNullableFilter.ts | 10 + apps/roi-cacl-2-admin/src/util/JsonFilter.ts | 5 + .../src/util/JsonNullableFilter.ts | 5 + .../src/util/MetaQueryPayload.ts | 3 + apps/roi-cacl-2-admin/src/util/QueryMode.ts | 4 + apps/roi-cacl-2-admin/src/util/SortOrder.ts | 4 + .../roi-cacl-2-admin/src/util/StringFilter.ts | 16 + .../src/util/StringNullableFilter.ts | 15 + .../VerificationTokenCreate.tsx | 22 + .../VerificationTokenEdit.tsx | 20 + .../VerificationTokenList.tsx | 24 + .../VerificationTokenShow.tsx | 23 + .../VerificationTokenTitle.ts | 7 + .../src/webhook/WebhookCreate.tsx | 57 + .../src/webhook/WebhookEdit.tsx | 57 + .../src/webhook/WebhookList.tsx | 55 + .../src/webhook/WebhookShow.tsx | 48 + .../src/webhook/WebhookTitle.ts | 7 + .../src/workflow/WorkflowCreate.tsx | 70 + .../src/workflow/WorkflowEdit.tsx | 70 + .../src/workflow/WorkflowList.tsx | 33 + .../src/workflow/WorkflowShow.tsx | 77 + .../src/workflow/WorkflowTitle.ts | 7 + .../WorkflowReminderCreate.tsx | 49 + .../workflowReminder/WorkflowReminderEdit.tsx | 47 + .../workflowReminder/WorkflowReminderList.tsx | 42 + .../workflowReminder/WorkflowReminderShow.tsx | 35 + .../workflowReminder/WorkflowReminderTitle.ts | 7 + .../src/workflowStep/WorkflowStepCreate.tsx | 66 + .../src/workflowStep/WorkflowStepEdit.tsx | 66 + .../src/workflowStep/WorkflowStepList.tsx | 39 + .../src/workflowStep/WorkflowStepShow.tsx | 66 + .../src/workflowStep/WorkflowStepTitle.ts | 7 + .../WorkflowsOnEventTypeCreate.tsx | 35 + .../WorkflowsOnEventTypeEdit.tsx | 35 + .../WorkflowsOnEventTypeList.tsx | 43 + .../WorkflowsOnEventTypeShow.tsx | 36 + .../WorkflowsOnEventTypeTitle.ts | 9 + apps/roi-cacl-2-admin/tsconfig.json | 21 + apps/roi-cacl-2/.dockerignore | 8 + apps/roi-cacl-2/.env | 8 + apps/roi-cacl-2/.gitignore | 5 + apps/roi-cacl-2/.prettierignore | 5 + apps/roi-cacl-2/Dockerfile | 68 + apps/roi-cacl-2/README.md | 64 + apps/roi-cacl-2/docker-compose.dev.yml | 13 + apps/roi-cacl-2/docker-compose.yml | 47 + apps/roi-cacl-2/nest-cli.json | 10 + apps/roi-cacl-2/package.json | 73 + apps/roi-cacl-2/prisma/schema.prisma | 553 ++++++ apps/roi-cacl-2/scripts/customSeed.ts | 7 + apps/roi-cacl-2/scripts/seed.ts | 25 + .../src/account/account.controller.ts | 12 + apps/roi-cacl-2/src/account/account.module.ts | 13 + .../src/account/account.resolver.ts | 11 + .../roi-cacl-2/src/account/account.service.ts | 10 + apps/roi-cacl-2/src/account/base/Account.ts | 139 ++ .../src/account/base/AccountCountArgs.ts | 28 + .../src/account/base/AccountCreateInput.ts | 134 ++ .../src/account/base/AccountFindManyArgs.ts | 62 + .../src/account/base/AccountFindUniqueArgs.ts | 30 + .../account/base/AccountListRelationFilter.ts | 56 + .../src/account/base/AccountOrderByInput.ts | 155 ++ .../src/account/base/AccountUpdateInput.ts | 143 ++ .../src/account/base/AccountWhereInput.ts | 157 ++ .../account/base/AccountWhereUniqueInput.ts | 27 + .../src/account/base/CreateAccountArgs.ts | 30 + .../src/account/base/DeleteAccountArgs.ts | 30 + .../src/account/base/UpdateAccountArgs.ts | 40 + .../base/account.controller.base.spec.ts | 204 ++ .../account/base/account.controller.base.ts | 217 ++ .../src/account/base/account.module.base.ts | 18 + .../src/account/base/account.resolver.base.ts | 129 ++ .../src/account/base/account.service.base.ts | 59 + .../src/apiKey/apiKey.controller.ts | 12 + apps/roi-cacl-2/src/apiKey/apiKey.module.ts | 13 + apps/roi-cacl-2/src/apiKey/apiKey.resolver.ts | 11 + apps/roi-cacl-2/src/apiKey/apiKey.service.ts | 10 + apps/roi-cacl-2/src/apiKey/base/ApiKey.ts | 97 + .../src/apiKey/base/ApiKeyCountArgs.ts | 28 + .../src/apiKey/base/ApiKeyCreateInput.ts | 87 + .../src/apiKey/base/ApiKeyFindManyArgs.ts | 62 + .../src/apiKey/base/ApiKeyFindUniqueArgs.ts | 30 + .../apiKey/base/ApiKeyListRelationFilter.ts | 56 + .../src/apiKey/base/ApiKeyOrderByInput.ts | 111 ++ .../src/apiKey/base/ApiKeyUpdateInput.ts | 90 + .../src/apiKey/base/ApiKeyWhereInput.ts | 116 ++ .../src/apiKey/base/ApiKeyWhereUniqueInput.ts | 27 + .../src/apiKey/base/CreateApiKeyArgs.ts | 30 + .../src/apiKey/base/DeleteApiKeyArgs.ts | 30 + .../src/apiKey/base/UpdateApiKeyArgs.ts | 40 + .../base/apiKey.controller.base.spec.ts | 206 ++ .../src/apiKey/base/apiKey.controller.base.ts | 232 +++ .../src/apiKey/base/apiKey.module.base.ts | 18 + .../src/apiKey/base/apiKey.resolver.base.ts | 153 ++ .../src/apiKey/base/apiKey.service.base.ts | 69 + apps/roi-cacl-2/src/app.module.ts | 99 + .../src/appModel/appModel.controller.ts | 12 + .../src/appModel/appModel.module.ts | 13 + .../src/appModel/appModel.resolver.ts | 11 + .../src/appModel/appModel.service.ts | 10 + ...eyCreateNestedManyWithoutAppModelsInput.ts | 28 + .../ApiKeyUpdateManyWithoutAppModelsInput.ts | 46 + apps/roi-cacl-2/src/appModel/base/AppModel.ts | 118 ++ .../src/appModel/base/AppModelCountArgs.ts | 28 + .../src/appModel/base/AppModelCreateInput.ts | 97 + .../src/appModel/base/AppModelFindManyArgs.ts | 62 + .../appModel/base/AppModelFindUniqueArgs.ts | 30 + .../base/AppModelListRelationFilter.ts | 56 + .../src/appModel/base/AppModelOrderByInput.ts | 89 + .../src/appModel/base/AppModelUpdateInput.ts | 100 + .../src/appModel/base/AppModelWhereInput.ts | 117 ++ .../appModel/base/AppModelWhereUniqueInput.ts | 27 + .../src/appModel/base/CreateAppModelArgs.ts | 30 + ...alCreateNestedManyWithoutAppModelsInput.ts | 28 + ...edentialUpdateManyWithoutAppModelsInput.ts | 46 + .../src/appModel/base/DeleteAppModelArgs.ts | 30 + .../appModel/base/EnumAppModelCategories.ts | 26 + .../src/appModel/base/UpdateAppModelArgs.ts | 40 + ...okCreateNestedManyWithoutAppModelsInput.ts | 28 + .../WebhookUpdateManyWithoutAppModelsInput.ts | 46 + .../base/appModel.controller.base.spec.ts | 194 ++ .../appModel/base/appModel.controller.base.ts | 427 ++++ .../src/appModel/base/appModel.module.base.ts | 18 + .../appModel/base/appModel.resolver.base.ts | 147 ++ .../appModel/base/appModel.service.base.ts | 87 + .../src/attendee/attendee.controller.ts | 12 + .../src/attendee/attendee.module.ts | 13 + .../src/attendee/attendee.resolver.ts | 11 + .../src/attendee/attendee.service.ts | 10 + apps/roi-cacl-2/src/attendee/base/Attendee.ts | 73 + .../src/attendee/base/AttendeeCountArgs.ts | 28 + .../src/attendee/base/AttendeeCreateInput.ts | 68 + .../src/attendee/base/AttendeeFindManyArgs.ts | 62 + .../attendee/base/AttendeeFindUniqueArgs.ts | 30 + .../base/AttendeeListRelationFilter.ts | 56 + .../src/attendee/base/AttendeeOrderByInput.ts | 89 + .../src/attendee/base/AttendeeUpdateInput.ts | 77 + .../src/attendee/base/AttendeeWhereInput.ts | 91 + .../attendee/base/AttendeeWhereUniqueInput.ts | 31 + .../src/attendee/base/CreateAttendeeArgs.ts | 30 + .../src/attendee/base/DeleteAttendeeArgs.ts | 30 + .../src/attendee/base/UpdateAttendeeArgs.ts | 40 + .../base/attendee.controller.base.spec.ts | 180 ++ .../attendee/base/attendee.controller.base.ts | 187 ++ .../src/attendee/base/attendee.module.base.ts | 18 + .../attendee/base/attendee.resolver.base.ts | 131 ++ .../attendee/base/attendee.service.base.ts | 59 + .../availability/availability.controller.ts | 12 + .../src/availability/availability.module.ts | 13 + .../src/availability/availability.resolver.ts | 11 + .../src/availability/availability.service.ts | 10 + .../src/availability/base/Availability.ts | 93 + .../base/AvailabilityCountArgs.ts | 28 + .../base/AvailabilityCreateInput.ts | 94 + .../base/AvailabilityFindManyArgs.ts | 62 + .../base/AvailabilityFindUniqueArgs.ts | 30 + .../base/AvailabilityListRelationFilter.ts | 56 + .../base/AvailabilityOrderByInput.ts | 111 ++ .../base/AvailabilityUpdateInput.ts | 103 + .../base/AvailabilityWhereInput.ts | 117 ++ .../base/AvailabilityWhereUniqueInput.ts | 31 + .../base/CreateAvailabilityArgs.ts | 30 + .../base/DeleteAvailabilityArgs.ts | 30 + .../base/UpdateAvailabilityArgs.ts | 40 + .../base/availability.controller.base.spec.ts | 202 ++ .../base/availability.controller.base.ts | 278 +++ .../base/availability.module.base.ts | 18 + .../base/availability.resolver.base.ts | 185 ++ .../base/availability.service.base.ts | 82 + ...deeCreateNestedManyWithoutBookingsInput.ts | 28 + .../AttendeeUpdateManyWithoutBookingsInput.ts | 46 + apps/roi-cacl-2/src/booking/base/Booking.ts | 309 +++ .../src/booking/base/BookingCountArgs.ts | 28 + .../src/booking/base/BookingCreateInput.ts | 314 +++ .../src/booking/base/BookingFindManyArgs.ts | 62 + .../src/booking/base/BookingFindUniqueArgs.ts | 30 + .../booking/base/BookingListRelationFilter.ts | 56 + .../src/booking/base/BookingOrderByInput.ts | 287 +++ ...nceCreateNestedManyWithoutBookingsInput.ts | 28 + ...ReferenceUpdateManyWithoutBookingsInput.ts | 46 + .../src/booking/base/BookingUpdateInput.ts | 332 ++++ .../src/booking/base/BookingWhereInput.ts | 353 ++++ .../booking/base/BookingWhereUniqueInput.ts | 31 + .../src/booking/base/CreateBookingArgs.ts | 30 + .../src/booking/base/DeleteBookingArgs.ts | 30 + .../src/booking/base/EnumBookingStatus.ts | 23 + ...entCreateNestedManyWithoutBookingsInput.ts | 28 + .../PaymentUpdateManyWithoutBookingsInput.ts | 46 + .../src/booking/base/UpdateBookingArgs.ts | 40 + ...derCreateNestedManyWithoutBookingsInput.ts | 28 + ...wReminderUpdateManyWithoutBookingsInput.ts | 46 + .../base/booking.controller.base.spec.ts | 258 +++ .../booking/base/booking.controller.base.ts | 750 +++++++ .../src/booking/base/booking.module.base.ts | 18 + .../src/booking/base/booking.resolver.base.ts | 277 +++ .../src/booking/base/booking.service.base.ts | 139 ++ .../src/booking/booking.controller.ts | 12 + apps/roi-cacl-2/src/booking/booking.module.ts | 13 + .../src/booking/booking.resolver.ts | 11 + .../roi-cacl-2/src/booking/booking.service.ts | 10 + .../bookingReference/base/BookingReference.ts | 115 ++ .../base/BookingReferenceCountArgs.ts | 28 + .../base/BookingReferenceCreateInput.ts | 109 ++ .../base/BookingReferenceFindManyArgs.ts | 62 + .../base/BookingReferenceFindUniqueArgs.ts | 30 + .../BookingReferenceListRelationFilter.ts | 56 + .../base/BookingReferenceOrderByInput.ts | 122 ++ .../base/BookingReferenceUpdateInput.ts | 115 ++ .../base/BookingReferenceWhereInput.ts | 125 ++ .../base/BookingReferenceWhereUniqueInput.ts | 31 + .../base/CreateBookingReferenceArgs.ts | 30 + .../base/DeleteBookingReferenceArgs.ts | 30 + .../base/UpdateBookingReferenceArgs.ts | 40 + .../bookingReference.controller.base.spec.ts | 192 ++ .../base/bookingReference.controller.base.ts | 209 ++ .../base/bookingReference.module.base.ts | 18 + .../base/bookingReference.resolver.base.ts | 131 ++ .../base/bookingReference.service.base.ts | 64 + .../bookingReference.controller.ts | 12 + .../bookingReference.module.ts | 13 + .../bookingReference.resolver.ts | 11 + .../bookingReference.service.ts | 10 + apps/roi-cacl-2/src/connectMicroservices.ts | 6 + .../credential/base/CreateCredentialArgs.ts | 30 + .../src/credential/base/Credential.ts | 76 + .../credential/base/CredentialCountArgs.ts | 28 + .../credential/base/CredentialCreateInput.ts | 77 + .../credential/base/CredentialFindManyArgs.ts | 62 + .../base/CredentialFindUniqueArgs.ts | 30 + .../base/CredentialListRelationFilter.ts | 56 + .../credential/base/CredentialOrderByInput.ts | 78 + .../credential/base/CredentialUpdateInput.ts | 83 + .../credential/base/CredentialWhereInput.ts | 95 + .../base/CredentialWhereUniqueInput.ts | 31 + .../credential/base/DeleteCredentialArgs.ts | 30 + ...CreateNestedManyWithoutCredentialsInput.ts | 28 + ...lendarUpdateManyWithoutCredentialsInput.ts | 46 + .../credential/base/UpdateCredentialArgs.ts | 40 + .../base/credential.controller.base.spec.ts | 168 ++ .../base/credential.controller.base.ts | 320 +++ .../credential/base/credential.module.base.ts | 18 + .../base/credential.resolver.base.ts | 178 ++ .../base/credential.service.base.ts | 83 + .../src/credential/credential.controller.ts | 12 + .../src/credential/credential.module.ts | 13 + .../src/credential/credential.resolver.ts | 11 + .../src/credential/credential.service.ts | 10 + .../base/CreateDailyEventReferenceArgs.ts | 30 + .../base/DailyEventReference.ts | 54 + .../base/DailyEventReferenceCountArgs.ts | 28 + .../base/DailyEventReferenceCreateInput.ts | 49 + .../base/DailyEventReferenceFindManyArgs.ts | 62 + .../base/DailyEventReferenceFindUniqueArgs.ts | 30 + .../DailyEventReferenceListRelationFilter.ts | 56 + .../base/DailyEventReferenceOrderByInput.ts | 67 + .../base/DailyEventReferenceUpdateInput.ts | 55 + .../base/DailyEventReferenceWhereInput.ts | 68 + .../DailyEventReferenceWhereUniqueInput.ts | 31 + .../base/DeleteDailyEventReferenceArgs.ts | 30 + .../base/UpdateDailyEventReferenceArgs.ts | 40 + ...ailyEventReference.controller.base.spec.ts | 172 ++ .../dailyEventReference.controller.base.ts | 179 ++ .../base/dailyEventReference.module.base.ts | 18 + .../base/dailyEventReference.resolver.base.ts | 131 ++ .../base/dailyEventReference.service.base.ts | 70 + .../dailyEventReference.controller.ts | 12 + .../dailyEventReference.module.ts | 13 + .../dailyEventReference.resolver.ts | 11 + .../dailyEventReference.service.ts | 10 + .../decorators/api-nested-query.decorator.ts | 80 + .../src/decorators/public.decorator.ts | 10 + .../base/CreateDestinationCalendarArgs.ts | 30 + .../base/DeleteDestinationCalendarArgs.ts | 30 + .../base/DestinationCalendar.ts | 84 + .../base/DestinationCalendarCountArgs.ts | 28 + .../base/DestinationCalendarCreateInput.ts | 88 + .../base/DestinationCalendarFindManyArgs.ts | 62 + .../base/DestinationCalendarFindUniqueArgs.ts | 30 + .../DestinationCalendarListRelationFilter.ts | 56 + .../base/DestinationCalendarOrderByInput.ts | 100 + .../base/DestinationCalendarUpdateInput.ts | 94 + .../base/DestinationCalendarWhereInput.ts | 107 + .../DestinationCalendarWhereUniqueInput.ts | 31 + .../base/UpdateDestinationCalendarArgs.ts | 40 + ...estinationCalendar.controller.base.spec.ts | 172 ++ .../destinationCalendar.controller.base.ts | 305 +++ .../base/destinationCalendar.module.base.ts | 18 + .../base/destinationCalendar.resolver.base.ts | 215 ++ .../base/destinationCalendar.service.base.ts | 97 + .../destinationCalendar.controller.ts | 12 + .../destinationCalendar.module.ts | 13 + .../destinationCalendar.resolver.ts | 11 + .../destinationCalendar.service.ts | 10 + apps/roi-cacl-2/src/errors.ts | 16 + ...yCreateNestedManyWithoutEventTypesInput.ts | 28 + ...abilityUpdateManyWithoutEventTypesInput.ts | 46 + ...gCreateNestedManyWithoutEventTypesInput.ts | 28 + ...BookingUpdateManyWithoutEventTypesInput.ts | 46 + .../src/eventType/base/CreateEventTypeArgs.ts | 30 + .../src/eventType/base/DeleteEventTypeArgs.ts | 30 + .../eventType/base/EnumEventTypePeriodType.ts | 22 + .../base/EnumEventTypeSchedulingType.ts | 21 + .../src/eventType/base/EventType.ts | 417 ++++ .../src/eventType/base/EventTypeCountArgs.ts | 28 + .../eventType/base/EventTypeCreateInput.ts | 437 +++++ ...tCreateNestedManyWithoutEventTypesInput.ts | 28 + ...omInputUpdateManyWithoutEventTypesInput.ts | 46 + .../eventType/base/EventTypeFindManyArgs.ts | 62 + .../eventType/base/EventTypeFindUniqueArgs.ts | 30 + .../base/EventTypeListRelationFilter.ts | 56 + .../eventType/base/EventTypeOrderByInput.ts | 397 ++++ .../eventType/base/EventTypeUpdateInput.ts | 479 +++++ .../src/eventType/base/EventTypeWhereInput.ts | 490 +++++ .../base/EventTypeWhereUniqueInput.ts | 31 + .../src/eventType/base/UpdateEventTypeArgs.ts | 40 + ...rCreateNestedManyWithoutEventTypesInput.ts | 28 + .../UserUpdateManyWithoutEventTypesInput.ts | 46 + ...kCreateNestedManyWithoutEventTypesInput.ts | 28 + ...WebhookUpdateManyWithoutEventTypesInput.ts | 46 + ...eCreateNestedManyWithoutEventTypesInput.ts | 28 + ...entTypeUpdateManyWithoutEventTypesInput.ts | 46 + .../base/eventType.controller.base.spec.ts | 278 +++ .../base/eventType.controller.base.ts | 1053 ++++++++++ .../eventType/base/eventType.module.base.ts | 18 + .../eventType/base/eventType.resolver.base.ts | 309 +++ .../eventType/base/eventType.service.base.ts | 163 ++ .../src/eventType/eventType.controller.ts | 12 + .../src/eventType/eventType.module.ts | 13 + .../src/eventType/eventType.resolver.ts | 11 + .../src/eventType/eventType.service.ts | 10 + .../base/CreateEventTypeCustomInputArgs.ts | 30 + .../base/DeleteEventTypeCustomInputArgs.ts | 30 + .../base/EnumEventTypeCustomInputType.ts | 23 + .../base/EventTypeCustomInput.ts | 78 + .../base/EventTypeCustomInputCountArgs.ts | 28 + .../base/EventTypeCustomInputCreateInput.ts | 63 + .../base/EventTypeCustomInputFindManyArgs.ts | 62 + .../EventTypeCustomInputFindUniqueArgs.ts | 30 + .../EventTypeCustomInputListRelationFilter.ts | 56 + .../base/EventTypeCustomInputOrderByInput.ts | 89 + .../base/EventTypeCustomInputUpdateInput.ts | 84 + .../base/EventTypeCustomInputWhereInput.ts | 92 + .../EventTypeCustomInputWhereUniqueInput.ts | 31 + .../base/UpdateEventTypeCustomInputArgs.ts | 40 + ...entTypeCustomInput.controller.base.spec.ts | 176 ++ .../eventTypeCustomInput.controller.base.ts | 190 ++ .../base/eventTypeCustomInput.module.base.ts | 18 + .../eventTypeCustomInput.resolver.base.ts | 127 ++ .../base/eventTypeCustomInput.service.base.ts | 74 + .../eventTypeCustomInput.controller.ts | 12 + .../eventTypeCustomInput.module.ts | 13 + .../eventTypeCustomInput.resolver.ts | 11 + .../eventTypeCustomInput.service.ts | 10 + .../src/feedback/base/CreateFeedbackArgs.ts | 30 + .../src/feedback/base/DeleteFeedbackArgs.ts | 30 + apps/roi-cacl-2/src/feedback/base/Feedback.ts | 70 + .../src/feedback/base/FeedbackCountArgs.ts | 28 + .../src/feedback/base/FeedbackCreateInput.ts | 57 + .../src/feedback/base/FeedbackFindManyArgs.ts | 62 + .../feedback/base/FeedbackFindUniqueArgs.ts | 30 + .../base/FeedbackListRelationFilter.ts | 56 + .../src/feedback/base/FeedbackOrderByInput.ts | 78 + .../src/feedback/base/FeedbackUpdateInput.ts | 66 + .../src/feedback/base/FeedbackWhereInput.ts | 81 + .../feedback/base/FeedbackWhereUniqueInput.ts | 31 + .../src/feedback/base/UpdateFeedbackArgs.ts | 40 + .../base/feedback.controller.base.spec.ts | 190 ++ .../feedback/base/feedback.controller.base.ts | 183 ++ .../src/feedback/base/feedback.module.base.ts | 18 + .../feedback/base/feedback.resolver.base.ts | 125 ++ .../feedback/base/feedback.service.base.ts | 59 + .../src/feedback/feedback.controller.ts | 12 + .../src/feedback/feedback.module.ts | 13 + .../src/feedback/feedback.resolver.ts | 11 + .../src/feedback/feedback.service.ts | 10 + .../src/filters/HttpExceptions.filter.ts | 89 + .../hashedLink/base/CreateHashedLinkArgs.ts | 30 + .../hashedLink/base/DeleteHashedLinkArgs.ts | 30 + .../src/hashedLink/base/HashedLink.ts | 45 + .../hashedLink/base/HashedLinkCountArgs.ts | 28 + .../hashedLink/base/HashedLinkCreateInput.ts | 38 + .../hashedLink/base/HashedLinkFindManyArgs.ts | 62 + .../base/HashedLinkFindUniqueArgs.ts | 30 + .../base/HashedLinkListRelationFilter.ts | 56 + .../hashedLink/base/HashedLinkOrderByInput.ts | 56 + .../hashedLink/base/HashedLinkUpdateInput.ts | 44 + .../hashedLink/base/HashedLinkWhereInput.ts | 57 + .../base/HashedLinkWhereUniqueInput.ts | 31 + .../hashedLink/base/UpdateHashedLinkArgs.ts | 40 + .../base/hashedLink.controller.base.spec.ts | 168 ++ .../base/hashedLink.controller.base.ts | 168 ++ .../hashedLink/base/hashedLink.module.base.ts | 18 + .../base/hashedLink.resolver.base.ts | 127 ++ .../base/hashedLink.service.base.ts | 61 + .../src/hashedLink/hashedLink.controller.ts | 12 + .../src/hashedLink/hashedLink.module.ts | 13 + .../src/hashedLink/hashedLink.resolver.ts | 11 + .../src/hashedLink/hashedLink.service.ts | 10 + .../src/health/base/health.controller.base.ts | 19 + .../src/health/base/health.service.base.ts | 15 + .../src/health/health.controller.ts | 10 + apps/roi-cacl-2/src/health/health.module.ts | 10 + apps/roi-cacl-2/src/health/health.service.ts | 10 + .../base/CreateImpersonationArgs.ts | 30 + .../base/DeleteImpersonationArgs.ts | 30 + .../src/impersonation/base/Impersonation.ts | 53 + .../base/ImpersonationCountArgs.ts | 28 + .../base/ImpersonationCreateInput.ts | 39 + .../base/ImpersonationFindManyArgs.ts | 62 + .../base/ImpersonationFindUniqueArgs.ts | 30 + .../base/ImpersonationListRelationFilter.ts | 56 + .../base/ImpersonationOrderByInput.ts | 67 + .../base/ImpersonationUpdateInput.ts | 45 + .../base/ImpersonationWhereInput.ts | 69 + .../base/ImpersonationWhereUniqueInput.ts | 31 + .../base/UpdateImpersonationArgs.ts | 40 + .../impersonation.controller.base.spec.ts | 182 ++ .../base/impersonation.controller.base.ts | 208 ++ .../base/impersonation.module.base.ts | 18 + .../base/impersonation.resolver.base.ts | 150 ++ .../base/impersonation.service.base.ts | 71 + .../impersonation/impersonation.controller.ts | 12 + .../src/impersonation/impersonation.module.ts | 13 + .../impersonation/impersonation.resolver.ts | 11 + .../impersonation/impersonation.service.ts | 10 + apps/roi-cacl-2/src/main.ts | 53 + .../membership/base/CreateMembershipArgs.ts | 30 + .../membership/base/DeleteMembershipArgs.ts | 30 + .../src/membership/base/EnumMembershipRole.ts | 22 + .../src/membership/base/Membership.ts | 65 + .../membership/base/MembershipCountArgs.ts | 28 + .../membership/base/MembershipCreateInput.ts | 57 + .../membership/base/MembershipFindManyArgs.ts | 62 + .../base/MembershipFindUniqueArgs.ts | 30 + .../base/MembershipListRelationFilter.ts | 56 + .../membership/base/MembershipOrderByInput.ts | 78 + .../membership/base/MembershipUpdateInput.ts | 69 + .../membership/base/MembershipWhereInput.ts | 82 + .../base/MembershipWhereUniqueInput.ts | 31 + .../membership/base/UpdateMembershipArgs.ts | 40 + .../base/membership.controller.base.spec.ts | 168 ++ .../base/membership.controller.base.ts | 211 ++ .../membership/base/membership.module.base.ts | 18 + .../base/membership.resolver.base.ts | 147 ++ .../base/membership.service.base.ts | 71 + .../src/membership/membership.controller.ts | 12 + .../src/membership/membership.module.ts | 13 + .../src/membership/membership.resolver.ts | 11 + .../src/membership/membership.service.ts | 10 + .../src/payment/base/CreatePaymentArgs.ts | 30 + .../src/payment/base/DeletePaymentArgs.ts | 30 + .../src/payment/base/EnumPaymentType.ts | 20 + apps/roi-cacl-2/src/payment/base/Payment.ts | 122 ++ .../src/payment/base/PaymentCountArgs.ts | 28 + .../src/payment/base/PaymentCreateInput.ts | 115 ++ .../src/payment/base/PaymentFindManyArgs.ts | 62 + .../src/payment/base/PaymentFindUniqueArgs.ts | 30 + .../payment/base/PaymentListRelationFilter.ts | 56 + .../src/payment/base/PaymentOrderByInput.ts | 144 ++ .../src/payment/base/PaymentUpdateInput.ts | 142 ++ .../src/payment/base/PaymentWhereInput.ts | 148 ++ .../payment/base/PaymentWhereUniqueInput.ts | 31 + .../src/payment/base/UpdatePaymentArgs.ts | 40 + .../base/payment.controller.base.spec.ts | 192 ++ .../payment/base/payment.controller.base.ts | 217 ++ .../src/payment/base/payment.module.base.ts | 18 + .../src/payment/base/payment.resolver.base.ts | 129 ++ .../src/payment/base/payment.service.base.ts | 59 + .../src/payment/payment.controller.ts | 12 + apps/roi-cacl-2/src/payment/payment.module.ts | 13 + .../src/payment/payment.resolver.ts | 11 + .../roi-cacl-2/src/payment/payment.service.ts | 10 + apps/roi-cacl-2/src/prisma.util.spec.ts | 23 + apps/roi-cacl-2/src/prisma.util.ts | 29 + apps/roi-cacl-2/src/prisma/prisma.module.ts | 9 + apps/roi-cacl-2/src/prisma/prisma.service.ts | 9 + .../base/secretsManager.service.base.spec.ts | 41 + .../base/secretsManager.service.base.ts | 17 + .../secrets/secretsManager.module.ts | 8 + .../secrets/secretsManager.service.ts | 10 + .../providers/secrets/secretsNameKey.enum.ts | 1 + .../base/CreateReminderMailArgs.ts | 30 + .../base/DeleteReminderMailArgs.ts | 30 + .../base/EnumReminderMailReminderType.ts | 20 + .../src/reminderMail/base/ReminderMail.ts | 63 + .../base/ReminderMailCountArgs.ts | 28 + .../base/ReminderMailCreateInput.ts | 44 + .../base/ReminderMailFindManyArgs.ts | 62 + .../base/ReminderMailFindUniqueArgs.ts | 30 + .../base/ReminderMailListRelationFilter.ts | 56 + .../base/ReminderMailOrderByInput.ts | 78 + .../base/ReminderMailUpdateInput.ts | 53 + .../base/ReminderMailWhereInput.ts | 78 + .../base/ReminderMailWhereUniqueInput.ts | 31 + .../base/UpdateReminderMailArgs.ts | 40 + .../base/reminderMail.controller.base.spec.ts | 190 ++ .../base/reminderMail.controller.base.ts | 141 ++ .../base/reminderMail.module.base.ts | 18 + .../base/reminderMail.resolver.base.ts | 99 + .../base/reminderMail.service.base.ts | 51 + .../reminderMail/reminderMail.controller.ts | 12 + .../src/reminderMail/reminderMail.module.ts | 13 + .../src/reminderMail/reminderMail.resolver.ts | 11 + .../src/reminderMail/reminderMail.service.ts | 10 + .../base/CreateResetPasswordRequestArgs.ts | 30 + .../base/DeleteResetPasswordRequestArgs.ts | 30 + .../base/ResetPasswordRequest.ts | 60 + .../base/ResetPasswordRequestCountArgs.ts | 28 + .../base/ResetPasswordRequestCreateInput.ts | 36 + .../base/ResetPasswordRequestFindManyArgs.ts | 62 + .../ResetPasswordRequestFindUniqueArgs.ts | 30 + .../ResetPasswordRequestListRelationFilter.ts | 56 + .../base/ResetPasswordRequestOrderByInput.ts | 78 + .../base/ResetPasswordRequestUpdateInput.ts | 42 + .../base/ResetPasswordRequestWhereInput.ts | 77 + .../ResetPasswordRequestWhereUniqueInput.ts | 27 + .../base/UpdateResetPasswordRequestArgs.ts | 40 + ...setPasswordRequest.controller.base.spec.ts | 202 ++ .../resetPasswordRequest.controller.base.ts | 143 ++ .../base/resetPasswordRequest.module.base.ts | 18 + .../resetPasswordRequest.resolver.base.ts | 99 + .../base/resetPasswordRequest.service.base.ts | 64 + .../resetPasswordRequest.controller.ts | 12 + .../resetPasswordRequest.module.ts | 13 + .../resetPasswordRequest.resolver.ts | 11 + .../resetPasswordRequest.service.ts | 10 + ...tyCreateNestedManyWithoutSchedulesInput.ts | 28 + ...labilityUpdateManyWithoutSchedulesInput.ts | 46 + .../src/schedule/base/CreateScheduleArgs.ts | 30 + .../src/schedule/base/DeleteScheduleArgs.ts | 30 + ...peCreateNestedManyWithoutSchedulesInput.ts | 28 + ...ventTypeUpdateManyWithoutSchedulesInput.ts | 46 + apps/roi-cacl-2/src/schedule/base/Schedule.ts | 76 + .../src/schedule/base/ScheduleCountArgs.ts | 28 + .../src/schedule/base/ScheduleCreateInput.ts | 75 + .../src/schedule/base/ScheduleFindManyArgs.ts | 62 + .../schedule/base/ScheduleFindUniqueArgs.ts | 30 + .../base/ScheduleListRelationFilter.ts | 56 + .../src/schedule/base/ScheduleOrderByInput.ts | 67 + .../src/schedule/base/ScheduleUpdateInput.ts | 81 + .../src/schedule/base/ScheduleWhereInput.ts | 95 + .../schedule/base/ScheduleWhereUniqueInput.ts | 31 + .../src/schedule/base/UpdateScheduleArgs.ts | 40 + .../base/schedule.controller.base.spec.ts | 172 ++ .../schedule/base/schedule.controller.base.ts | 406 ++++ .../src/schedule/base/schedule.module.base.ts | 18 + .../schedule/base/schedule.resolver.base.ts | 157 ++ .../schedule/base/schedule.service.base.ts | 84 + .../src/schedule/schedule.controller.ts | 12 + .../src/schedule/schedule.module.ts | 13 + .../src/schedule/schedule.resolver.ts | 11 + .../src/schedule/schedule.service.ts | 10 + .../base/CreateSelectedCalendarArgs.ts | 30 + .../base/DeleteSelectedCalendarArgs.ts | 30 + .../selectedCalendar/base/SelectedCalendar.ts | 53 + .../base/SelectedCalendarCountArgs.ts | 28 + .../base/SelectedCalendarCreateInput.ts | 46 + .../base/SelectedCalendarFindManyArgs.ts | 62 + .../base/SelectedCalendarFindUniqueArgs.ts | 30 + .../SelectedCalendarListRelationFilter.ts | 56 + .../base/SelectedCalendarOrderByInput.ts | 67 + .../base/SelectedCalendarUpdateInput.ts | 55 + .../base/SelectedCalendarWhereInput.ts | 68 + .../base/SelectedCalendarWhereUniqueInput.ts | 31 + .../base/UpdateSelectedCalendarArgs.ts | 40 + .../selectedCalendar.controller.base.spec.ts | 172 ++ .../base/selectedCalendar.controller.base.ts | 180 ++ .../base/selectedCalendar.module.base.ts | 18 + .../base/selectedCalendar.resolver.base.ts | 127 ++ .../base/selectedCalendar.service.base.ts | 63 + .../selectedCalendar.controller.ts | 12 + .../selectedCalendar.module.ts | 13 + .../selectedCalendar.resolver.ts | 11 + .../selectedCalendar.service.ts | 10 + .../src/serveStaticOptions.service.ts | 39 + .../src/session/base/CreateSessionArgs.ts | 30 + .../src/session/base/DeleteSessionArgs.ts | 30 + apps/roi-cacl-2/src/session/base/Session.ts | 54 + .../src/session/base/SessionCountArgs.ts | 28 + .../src/session/base/SessionCreateInput.ts | 49 + .../src/session/base/SessionFindManyArgs.ts | 62 + .../src/session/base/SessionFindUniqueArgs.ts | 30 + .../session/base/SessionListRelationFilter.ts | 56 + .../src/session/base/SessionOrderByInput.ts | 67 + .../src/session/base/SessionUpdateInput.ts | 55 + .../src/session/base/SessionWhereInput.ts | 68 + .../session/base/SessionWhereUniqueInput.ts | 27 + .../src/session/base/UpdateSessionArgs.ts | 40 + .../base/session.controller.base.spec.ts | 186 ++ .../session/base/session.controller.base.ts | 177 ++ .../src/session/base/session.module.base.ts | 18 + .../src/session/base/session.resolver.base.ts | 129 ++ .../src/session/base/session.service.base.ts | 59 + .../src/session/session.controller.ts | 12 + apps/roi-cacl-2/src/session/session.module.ts | 13 + .../src/session/session.resolver.ts | 11 + .../roi-cacl-2/src/session/session.service.ts | 10 + apps/roi-cacl-2/src/swagger.ts | 20 + apps/roi-cacl-2/src/swagger/favicon.png | Bin 0 -> 2498 bytes .../src/swagger/logo-amplication-white.svg | 15 + apps/roi-cacl-2/src/swagger/swagger.css | 321 +++ .../src/team/base/CreateTeamArgs.ts | 30 + .../src/team/base/DeleteTeamArgs.ts | 30 + ...ntTypeCreateNestedManyWithoutTeamsInput.ts | 28 + .../EventTypeUpdateManyWithoutTeamsInput.ts | 46 + ...ershipCreateNestedManyWithoutTeamsInput.ts | 28 + .../MembershipUpdateManyWithoutTeamsInput.ts | 46 + apps/roi-cacl-2/src/team/base/Team.ts | 106 + .../roi-cacl-2/src/team/base/TeamCountArgs.ts | 28 + .../src/team/base/TeamCreateInput.ts | 103 + .../src/team/base/TeamFindManyArgs.ts | 62 + .../src/team/base/TeamFindUniqueArgs.ts | 30 + .../src/team/base/TeamListRelationFilter.ts | 56 + .../src/team/base/TeamOrderByInput.ts | 89 + .../src/team/base/TeamUpdateInput.ts | 106 + .../src/team/base/TeamWhereInput.ts | 115 ++ .../src/team/base/TeamWhereUniqueInput.ts | 31 + .../src/team/base/UpdateTeamArgs.ts | 40 + .../team/base/team.controller.base.spec.ts | 184 ++ .../src/team/base/team.controller.base.ts | 363 ++++ .../src/team/base/team.module.base.ts | 18 + .../src/team/base/team.resolver.base.ts | 121 ++ .../src/team/base/team.service.base.ts | 75 + apps/roi-cacl-2/src/team/team.controller.ts | 12 + apps/roi-cacl-2/src/team/team.module.ts | 13 + apps/roi-cacl-2/src/team/team.resolver.ts | 11 + apps/roi-cacl-2/src/team/team.service.ts | 10 + .../src/tests/health/health.service.spec.ts | 36 + apps/roi-cacl-2/src/types.ts | 3 + ...ccountCreateNestedManyWithoutUsersInput.ts | 28 + .../AccountUpdateManyWithoutUsersInput.ts | 46 + ...ApiKeyCreateNestedManyWithoutUsersInput.ts | 28 + .../base/ApiKeyUpdateManyWithoutUsersInput.ts | 46 + ...bilityCreateNestedManyWithoutUsersInput.ts | 28 + ...AvailabilityUpdateManyWithoutUsersInput.ts | 46 + ...ookingCreateNestedManyWithoutUsersInput.ts | 28 + .../BookingUpdateManyWithoutUsersInput.ts | 46 + .../src/user/base/CreateUserArgs.ts | 30 + ...entialCreateNestedManyWithoutUsersInput.ts | 28 + .../CredentialUpdateManyWithoutUsersInput.ts | 46 + .../src/user/base/DeleteUserArgs.ts | 30 + .../src/user/base/EnumUserIdentityProvider.ts | 22 + apps/roi-cacl-2/src/user/base/EnumUserPlan.ts | 22 + apps/roi-cacl-2/src/user/base/EnumUserRole.ts | 22 + ...ntTypeCreateNestedManyWithoutUsersInput.ts | 28 + .../EventTypeUpdateManyWithoutUsersInput.ts | 46 + ...edbackCreateNestedManyWithoutUsersInput.ts | 28 + .../FeedbackUpdateManyWithoutUsersInput.ts | 46 + ...nationCreateNestedManyWithoutUsersInput.ts | 28 + ...mpersonationUpdateManyWithoutUsersInput.ts | 46 + ...ershipCreateNestedManyWithoutUsersInput.ts | 28 + .../MembershipUpdateManyWithoutUsersInput.ts | 46 + ...heduleCreateNestedManyWithoutUsersInput.ts | 28 + .../ScheduleUpdateManyWithoutUsersInput.ts | 46 + ...lendarCreateNestedManyWithoutUsersInput.ts | 28 + ...ctedCalendarUpdateManyWithoutUsersInput.ts | 46 + ...essionCreateNestedManyWithoutUsersInput.ts | 28 + .../SessionUpdateManyWithoutUsersInput.ts | 46 + .../src/user/base/UpdateUserArgs.ts | 40 + apps/roi-cacl-2/src/user/base/User.ts | 529 +++++ .../roi-cacl-2/src/user/base/UserCountArgs.ts | 28 + .../src/user/base/UserCreateInput.ts | 555 ++++++ .../src/user/base/UserFindManyArgs.ts | 62 + .../src/user/base/UserFindUniqueArgs.ts | 30 + .../src/user/base/UserListRelationFilter.ts | 56 + .../src/user/base/UserOrderByInput.ts | 419 ++++ .../src/user/base/UserUpdateInput.ts | 603 ++++++ .../src/user/base/UserWhereInput.ts | 624 ++++++ .../src/user/base/UserWhereUniqueInput.ts | 31 + ...ebhookCreateNestedManyWithoutUsersInput.ts | 28 + .../WebhookUpdateManyWithoutUsersInput.ts | 46 + ...rkflowCreateNestedManyWithoutUsersInput.ts | 28 + .../WorkflowUpdateManyWithoutUsersInput.ts | 46 + .../user/base/user.controller.base.spec.ts | 306 +++ .../src/user/base/user.controller.base.ts | 1738 +++++++++++++++++ .../src/user/base/user.module.base.ts | 18 + .../src/user/base/user.resolver.base.ts | 359 ++++ .../src/user/base/user.service.base.ts | 241 +++ apps/roi-cacl-2/src/user/user.controller.ts | 12 + apps/roi-cacl-2/src/user/user.module.ts | 13 + apps/roi-cacl-2/src/user/user.resolver.ts | 11 + apps/roi-cacl-2/src/user/user.service.ts | 10 + apps/roi-cacl-2/src/util/BooleanFilter.ts | 32 + .../src/util/BooleanNullableFilter.ts | 31 + apps/roi-cacl-2/src/util/DateTimeFilter.ts | 97 + .../src/util/DateTimeNullableFilter.ts | 97 + apps/roi-cacl-2/src/util/FloatFilter.ts | 98 + .../src/util/FloatNullableFilter.ts | 98 + apps/roi-cacl-2/src/util/IntFilter.ts | 98 + apps/roi-cacl-2/src/util/IntNullableFilter.ts | 98 + apps/roi-cacl-2/src/util/JsonFilter.ts | 31 + .../roi-cacl-2/src/util/JsonNullableFilter.ts | 31 + apps/roi-cacl-2/src/util/MetaQueryPayload.ts | 13 + apps/roi-cacl-2/src/util/QueryMode.ts | 10 + apps/roi-cacl-2/src/util/SortOrder.ts | 10 + apps/roi-cacl-2/src/util/StringFilter.ts | 141 ++ .../src/util/StringNullableFilter.ts | 141 ++ apps/roi-cacl-2/src/validators/index.ts | 1 + .../is-json-value-validator.spec.ts | 44 + .../src/validators/is-json-value-validator.ts | 29 + .../base/CreateVerificationTokenArgs.ts | 30 + .../base/DeleteVerificationTokenArgs.ts | 30 + .../base/UpdateVerificationTokenArgs.ts | 40 + .../base/VerificationToken.ts | 68 + .../base/VerificationTokenCountArgs.ts | 28 + .../base/VerificationTokenCreateInput.ts | 44 + .../base/VerificationTokenFindManyArgs.ts | 62 + .../base/VerificationTokenFindUniqueArgs.ts | 30 + .../VerificationTokenListRelationFilter.ts | 56 + .../base/VerificationTokenOrderByInput.ts | 89 + .../base/VerificationTokenUpdateInput.ts | 53 + .../base/VerificationTokenWhereInput.ts | 89 + .../base/VerificationTokenWhereUniqueInput.ts | 31 + .../verificationToken.controller.base.spec.ts | 206 ++ .../base/verificationToken.controller.base.ts | 148 ++ .../base/verificationToken.module.base.ts | 18 + .../base/verificationToken.resolver.base.ts | 99 + .../base/verificationToken.service.base.ts | 54 + .../verificationToken.controller.ts | 12 + .../verificationToken.module.ts | 13 + .../verificationToken.resolver.ts | 11 + .../verificationToken.service.ts | 10 + .../src/webhook/base/CreateWebhookArgs.ts | 30 + .../src/webhook/base/DeleteWebhookArgs.ts | 30 + .../webhook/base/EnumWebhookEventTriggers.ts | 22 + .../src/webhook/base/UpdateWebhookArgs.ts | 40 + apps/roi-cacl-2/src/webhook/base/Webhook.ts | 128 ++ .../src/webhook/base/WebhookCountArgs.ts | 28 + .../src/webhook/base/WebhookCreateInput.ts | 120 ++ .../src/webhook/base/WebhookFindManyArgs.ts | 62 + .../src/webhook/base/WebhookFindUniqueArgs.ts | 30 + .../webhook/base/WebhookListRelationFilter.ts | 56 + .../src/webhook/base/WebhookOrderByInput.ts | 133 ++ .../src/webhook/base/WebhookUpdateInput.ts | 126 ++ .../src/webhook/base/WebhookWhereInput.ts | 129 ++ .../webhook/base/WebhookWhereUniqueInput.ts | 27 + .../base/webhook.controller.base.spec.ts | 198 ++ .../webhook/base/webhook.controller.base.ts | 286 +++ .../src/webhook/base/webhook.module.base.ts | 18 + .../src/webhook/base/webhook.resolver.base.ts | 185 ++ .../src/webhook/base/webhook.service.base.ts | 78 + .../src/webhook/webhook.controller.ts | 12 + apps/roi-cacl-2/src/webhook/webhook.module.ts | 13 + .../src/webhook/webhook.resolver.ts | 11 + .../roi-cacl-2/src/webhook/webhook.service.ts | 10 + .../src/workflow/base/CreateWorkflowArgs.ts | 30 + .../src/workflow/base/DeleteWorkflowArgs.ts | 30 + .../src/workflow/base/EnumWorkflowTimeUnit.ts | 22 + .../src/workflow/base/EnumWorkflowTrigger.ts | 22 + .../src/workflow/base/UpdateWorkflowArgs.ts | 40 + apps/roi-cacl-2/src/workflow/base/Workflow.ts | 105 + .../src/workflow/base/WorkflowCountArgs.ts | 28 + .../src/workflow/base/WorkflowCreateInput.ts | 102 + .../src/workflow/base/WorkflowFindManyArgs.ts | 62 + .../workflow/base/WorkflowFindUniqueArgs.ts | 30 + .../base/WorkflowListRelationFilter.ts | 56 + .../src/workflow/base/WorkflowOrderByInput.ts | 89 + ...epCreateNestedManyWithoutWorkflowsInput.ts | 28 + ...flowStepUpdateManyWithoutWorkflowsInput.ts | 46 + .../src/workflow/base/WorkflowUpdateInput.ts | 111 ++ .../src/workflow/base/WorkflowWhereInput.ts | 119 ++ .../workflow/base/WorkflowWhereUniqueInput.ts | 31 + ...peCreateNestedManyWithoutWorkflowsInput.ts | 28 + ...ventTypeUpdateManyWithoutWorkflowsInput.ts | 46 + .../base/workflow.controller.base.spec.ts | 172 ++ .../workflow/base/workflow.controller.base.ts | 363 ++++ .../src/workflow/base/workflow.module.base.ts | 18 + .../workflow/base/workflow.resolver.base.ts | 157 ++ .../workflow/base/workflow.service.base.ts | 84 + .../src/workflow/workflow.controller.ts | 12 + .../src/workflow/workflow.module.ts | 13 + .../src/workflow/workflow.resolver.ts | 11 + .../src/workflow/workflow.service.ts | 10 + .../base/CreateWorkflowReminderArgs.ts | 30 + .../base/DeleteWorkflowReminderArgs.ts | 30 + .../base/EnumWorkflowReminderMethod.ts | 21 + .../base/UpdateWorkflowReminderArgs.ts | 40 + .../workflowReminder/base/WorkflowReminder.ts | 93 + .../base/WorkflowReminderCountArgs.ts | 28 + .../base/WorkflowReminderCreateInput.ts | 86 + .../base/WorkflowReminderFindManyArgs.ts | 62 + .../base/WorkflowReminderFindUniqueArgs.ts | 30 + .../WorkflowReminderListRelationFilter.ts | 56 + .../base/WorkflowReminderOrderByInput.ts | 100 + .../base/WorkflowReminderUpdateInput.ts | 98 + .../base/WorkflowReminderWhereInput.ts | 106 + .../base/WorkflowReminderWhereUniqueInput.ts | 31 + .../workflowReminder.controller.base.spec.ts | 190 ++ .../base/workflowReminder.controller.base.ts | 232 +++ .../base/workflowReminder.module.base.ts | 18 + .../base/workflowReminder.resolver.base.ts | 155 ++ .../base/workflowReminder.service.base.ts | 73 + .../workflowReminder.controller.ts | 12 + .../workflowReminder.module.ts | 13 + .../workflowReminder.resolver.ts | 11 + .../workflowReminder.service.ts | 10 + .../base/CreateWorkflowStepArgs.ts | 30 + .../base/DeleteWorkflowStepArgs.ts | 30 + .../base/EnumWorkflowStepAction.ts | 23 + .../base/EnumWorkflowStepTemplate.ts | 21 + .../base/UpdateWorkflowStepArgs.ts | 40 + ...eateNestedManyWithoutWorkflowStepsInput.ts | 28 + ...nderUpdateManyWithoutWorkflowStepsInput.ts | 46 + .../src/workflowStep/base/WorkflowStep.ts | 116 ++ .../base/WorkflowStepCountArgs.ts | 28 + .../base/WorkflowStepCreateInput.ts | 108 + .../base/WorkflowStepFindManyArgs.ts | 62 + .../base/WorkflowStepFindUniqueArgs.ts | 30 + .../base/WorkflowStepListRelationFilter.ts | 56 + .../base/WorkflowStepOrderByInput.ts | 111 ++ .../base/WorkflowStepUpdateInput.ts | 120 ++ .../base/WorkflowStepWhereInput.ts | 127 ++ .../base/WorkflowStepWhereUniqueInput.ts | 31 + .../base/workflowStep.controller.base.spec.ts | 180 ++ .../base/workflowStep.controller.base.ts | 290 +++ .../base/workflowStep.module.base.ts | 18 + .../base/workflowStep.resolver.base.ts | 143 ++ .../base/workflowStep.service.base.ts | 76 + .../workflowStep/workflowStep.controller.ts | 12 + .../src/workflowStep/workflowStep.module.ts | 13 + .../src/workflowStep/workflowStep.resolver.ts | 11 + .../src/workflowStep/workflowStep.service.ts | 10 + .../base/CreateWorkflowsOnEventTypeArgs.ts | 30 + .../base/DeleteWorkflowsOnEventTypeArgs.ts | 30 + .../base/UpdateWorkflowsOnEventTypeArgs.ts | 40 + .../base/WorkflowsOnEventType.ts | 46 + .../base/WorkflowsOnEventTypeCountArgs.ts | 28 + .../base/WorkflowsOnEventTypeCreateInput.ts | 40 + .../base/WorkflowsOnEventTypeFindManyArgs.ts | 62 + .../WorkflowsOnEventTypeFindUniqueArgs.ts | 30 + .../WorkflowsOnEventTypeListRelationFilter.ts | 56 + .../base/WorkflowsOnEventTypeOrderByInput.ts | 56 + .../base/WorkflowsOnEventTypeUpdateInput.ts | 46 + .../base/WorkflowsOnEventTypeWhereInput.ts | 58 + .../WorkflowsOnEventTypeWhereUniqueInput.ts | 31 + ...rkflowsOnEventType.controller.base.spec.ts | 164 ++ .../workflowsOnEventType.controller.base.ts | 203 ++ .../base/workflowsOnEventType.module.base.ts | 18 + .../workflowsOnEventType.resolver.base.ts | 151 ++ .../base/workflowsOnEventType.service.base.ts | 83 + .../workflowsOnEventType.controller.ts | 12 + .../workflowsOnEventType.module.ts | 13 + .../workflowsOnEventType.resolver.ts | 11 + .../workflowsOnEventType.service.ts | 10 + apps/roi-cacl-2/tsconfig.build.json | 4 + apps/roi-cacl-2/tsconfig.json | 21 + 1484 files changed, 70663 insertions(+) create mode 100644 apps/roi-cacl-2-admin/.dockerignore create mode 100644 apps/roi-cacl-2-admin/.env create mode 100644 apps/roi-cacl-2-admin/.gitignore create mode 100644 apps/roi-cacl-2-admin/Dockerfile create mode 100644 apps/roi-cacl-2-admin/README.md create mode 100644 apps/roi-cacl-2-admin/configuration/nginx.conf create mode 100644 apps/roi-cacl-2-admin/package.json create mode 100644 apps/roi-cacl-2-admin/public/favicon.ico create mode 100644 apps/roi-cacl-2-admin/public/index.html create mode 100644 apps/roi-cacl-2-admin/public/logo192.png create mode 100644 apps/roi-cacl-2-admin/public/logo512.png create mode 100644 apps/roi-cacl-2-admin/public/manifest.json create mode 100644 apps/roi-cacl-2-admin/public/robots.txt create mode 100644 apps/roi-cacl-2-admin/src/App.scss create mode 100644 apps/roi-cacl-2-admin/src/App.tsx create mode 100644 apps/roi-cacl-2-admin/src/Components/Pagination.tsx create mode 100644 apps/roi-cacl-2-admin/src/Login.tsx create mode 100644 apps/roi-cacl-2-admin/src/account/AccountCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/account/AccountEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/account/AccountList.tsx create mode 100644 apps/roi-cacl-2-admin/src/account/AccountShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/account/AccountTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/Account.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/AccountWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/CreateAccountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/DeleteAccountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/account/UpdateAccountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKey.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/CreateApiKeyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/DeleteApiKeyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/apiKey/UpdateApiKeyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/ApiKeyCreateNestedManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/ApiKeyUpdateManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModel.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/CreateAppModelArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/CredentialCreateNestedManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/CredentialUpdateManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/DeleteAppModelArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/EnumAppModelCategories.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/UpdateAppModelArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/WebhookCreateNestedManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/appModel/WebhookUpdateManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/Attendee.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/CreateAttendeeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/DeleteAttendeeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/attendee/UpdateAttendeeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/Availability.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/CreateAvailabilityArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/DeleteAvailabilityArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/availability/UpdateAvailabilityArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/AttendeeCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/AttendeeUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/Booking.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingReferenceCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingReferenceUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/BookingWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/CreateBookingArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/DeleteBookingArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/EnumBookingStatus.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/PaymentCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/PaymentUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/UpdateBookingArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReference.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/CreateBookingReferenceArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/DeleteBookingReferenceArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/bookingReference/UpdateBookingReferenceArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CreateCredentialArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/Credential.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/CredentialWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/DeleteCredentialArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarUpdateManyWithoutCredentialsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/credential/UpdateCredentialArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/CreateDailyEventReferenceArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReference.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/DeleteDailyEventReferenceArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/dailyEventReference/UpdateDailyEventReferenceArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/CreateDestinationCalendarArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DeleteDestinationCalendarArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendar.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/destinationCalendar/UpdateDestinationCalendarArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/AvailabilityCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/AvailabilityUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/BookingCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/BookingUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/CreateEventTypeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/DeleteEventTypeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypePeriodType.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypeSchedulingType.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventType.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/UpdateEventTypeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/UserCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/UserUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/WebhookCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/WebhookUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/CreateEventTypeCustomInputArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/DeleteEventTypeCustomInputArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EnumEventTypeCustomInputType.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/UpdateEventTypeCustomInputArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/CreateFeedbackArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/DeleteFeedbackArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/Feedback.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/feedback/UpdateFeedbackArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/CreateHashedLinkArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/DeleteHashedLinkArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLink.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/hashedLink/UpdateHashedLinkArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/CreateImpersonationArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/DeleteImpersonationArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/Impersonation.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/impersonation/UpdateImpersonationArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/CreateMembershipArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/DeleteMembershipArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/EnumMembershipRole.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/Membership.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/MembershipWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/membership/UpdateMembershipArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/CreatePaymentArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/DeletePaymentArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/EnumPaymentType.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/Payment.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/PaymentWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/payment/UpdatePaymentArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/CreateReminderMailArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/DeleteReminderMailArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/EnumReminderMailReminderType.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMail.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/reminderMail/UpdateReminderMailArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/CreateResetPasswordRequestArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/DeleteResetPasswordRequestArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequest.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/resetPasswordRequest/UpdateResetPasswordRequestArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/AvailabilityCreateNestedManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/AvailabilityUpdateManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/CreateScheduleArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/DeleteScheduleArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/EventTypeCreateNestedManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/EventTypeUpdateManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/Schedule.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/schedule/UpdateScheduleArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/CreateSelectedCalendarArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/DeleteSelectedCalendarArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendar.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/selectedCalendar/UpdateSelectedCalendarArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/CreateSessionArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/DeleteSessionArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/Session.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/SessionWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/session/UpdateSessionArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/CreateTeamArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/DeleteTeamArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/EventTypeCreateNestedManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/EventTypeUpdateManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/MembershipCreateNestedManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/MembershipUpdateManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/Team.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/TeamWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/team/UpdateTeamArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/AccountCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/AccountUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/ApiKeyCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/ApiKeyUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/AvailabilityCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/AvailabilityUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/BookingCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/BookingUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/CreateUserArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/CredentialCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/CredentialUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/DeleteUserArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/EnumUserIdentityProvider.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/EnumUserPlan.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/EnumUserRole.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/EventTypeCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/EventTypeUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/FeedbackCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/FeedbackUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/ImpersonationCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/ImpersonationUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/MembershipCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/MembershipUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/ScheduleCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/ScheduleUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/SelectedCalendarCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/SelectedCalendarUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/SessionCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/SessionUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UpdateUserArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/User.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/UserWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/WebhookCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/WebhookUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/WorkflowCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/user/WorkflowUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/CreateVerificationTokenArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/DeleteVerificationTokenArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/UpdateVerificationTokenArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationToken.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/CreateWebhookArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/DeleteWebhookArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/EnumWebhookEventTriggers.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/UpdateWebhookArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/Webhook.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/CreateWorkflowArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/DeleteWorkflowArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTimeUnit.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTrigger.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/UpdateWorkflowArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/Workflow.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepUpdateManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/CreateWorkflowReminderArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/DeleteWorkflowReminderArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/EnumWorkflowReminderMethod.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/UpdateWorkflowReminderArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminder.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/CreateWorkflowStepArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/DeleteWorkflowStepArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepAction.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepTemplate.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/UpdateWorkflowStepArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStep.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/CreateWorkflowsOnEventTypeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/DeleteWorkflowsOnEventTypeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/UpdateWorkflowsOnEventTypeArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventType.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCountArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCreateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindManyArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeListRelationFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeOrderByInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeUpdateInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereInput.ts create mode 100644 apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2-admin/src/apiKey/ApiKeyCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/apiKey/ApiKeyEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/apiKey/ApiKeyList.tsx create mode 100644 apps/roi-cacl-2-admin/src/apiKey/ApiKeyShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/apiKey/ApiKeyTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/appModel/AppModelCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/appModel/AppModelEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/appModel/AppModelList.tsx create mode 100644 apps/roi-cacl-2-admin/src/appModel/AppModelShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/appModel/AppModelTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/attendee/AttendeeCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/attendee/AttendeeEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/attendee/AttendeeList.tsx create mode 100644 apps/roi-cacl-2-admin/src/attendee/AttendeeShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/attendee/AttendeeTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/auth-provider/ra-auth-http.ts create mode 100644 apps/roi-cacl-2-admin/src/auth-provider/ra-auth-jwt.ts create mode 100644 apps/roi-cacl-2-admin/src/auth.ts create mode 100644 apps/roi-cacl-2-admin/src/availability/AvailabilityCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/availability/AvailabilityEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/availability/AvailabilityList.tsx create mode 100644 apps/roi-cacl-2-admin/src/availability/AvailabilityShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/availability/AvailabilityTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/booking/BookingCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/booking/BookingEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/booking/BookingList.tsx create mode 100644 apps/roi-cacl-2-admin/src/booking/BookingShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/booking/BookingTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceList.tsx create mode 100644 apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/constants.ts create mode 100644 apps/roi-cacl-2-admin/src/credential/CredentialCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/credential/CredentialEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/credential/CredentialList.tsx create mode 100644 apps/roi-cacl-2-admin/src/credential/CredentialShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/credential/CredentialTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceList.tsx create mode 100644 apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/data-provider/graphqlDataProvider.ts create mode 100644 apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarList.tsx create mode 100644 apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/eventType/EventTypeCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventType/EventTypeEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventType/EventTypeList.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventType/EventTypeShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventType/EventTypeTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputList.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/feedback/FeedbackCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/feedback/FeedbackEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/feedback/FeedbackList.tsx create mode 100644 apps/roi-cacl-2-admin/src/feedback/FeedbackShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/feedback/FeedbackTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/hashedLink/HashedLinkCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/hashedLink/HashedLinkEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/hashedLink/HashedLinkList.tsx create mode 100644 apps/roi-cacl-2-admin/src/hashedLink/HashedLinkShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/hashedLink/HashedLinkTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/impersonation/ImpersonationCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/impersonation/ImpersonationEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/impersonation/ImpersonationList.tsx create mode 100644 apps/roi-cacl-2-admin/src/impersonation/ImpersonationShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/impersonation/ImpersonationTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/index.css create mode 100644 apps/roi-cacl-2-admin/src/index.tsx create mode 100644 apps/roi-cacl-2-admin/src/login.scss create mode 100644 apps/roi-cacl-2-admin/src/membership/MembershipCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/membership/MembershipEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/membership/MembershipList.tsx create mode 100644 apps/roi-cacl-2-admin/src/membership/MembershipShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/membership/MembershipTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/pages/Dashboard.tsx create mode 100644 apps/roi-cacl-2-admin/src/payment/PaymentCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/payment/PaymentEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/payment/PaymentList.tsx create mode 100644 apps/roi-cacl-2-admin/src/payment/PaymentShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/payment/PaymentTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/reminderMail/ReminderMailCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/reminderMail/ReminderMailEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/reminderMail/ReminderMailList.tsx create mode 100644 apps/roi-cacl-2-admin/src/reminderMail/ReminderMailShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/reminderMail/ReminderMailTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/reportWebVitals.ts create mode 100644 apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestList.tsx create mode 100644 apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/schedule/ScheduleCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/schedule/ScheduleEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/schedule/ScheduleList.tsx create mode 100644 apps/roi-cacl-2-admin/src/schedule/ScheduleShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/schedule/ScheduleTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarList.tsx create mode 100644 apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/session/SessionCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/session/SessionEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/session/SessionList.tsx create mode 100644 apps/roi-cacl-2-admin/src/session/SessionShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/session/SessionTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/setupTests.ts create mode 100644 apps/roi-cacl-2-admin/src/team/TeamCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/team/TeamEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/team/TeamList.tsx create mode 100644 apps/roi-cacl-2-admin/src/team/TeamShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/team/TeamTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/theme/theme.ts create mode 100644 apps/roi-cacl-2-admin/src/types.ts create mode 100644 apps/roi-cacl-2-admin/src/user/EnumRoles.ts create mode 100644 apps/roi-cacl-2-admin/src/user/RolesOptions.ts create mode 100644 apps/roi-cacl-2-admin/src/user/UserCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/user/UserEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/user/UserList.tsx create mode 100644 apps/roi-cacl-2-admin/src/user/UserShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/user/UserTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/user/roles.ts create mode 100644 apps/roi-cacl-2-admin/src/util/BooleanFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/BooleanNullableFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/DateTimeFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/DateTimeNullableFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/FloatFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/FloatNullableFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/IntFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/IntNullableFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/JsonFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/JsonNullableFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/MetaQueryPayload.ts create mode 100644 apps/roi-cacl-2-admin/src/util/QueryMode.ts create mode 100644 apps/roi-cacl-2-admin/src/util/SortOrder.ts create mode 100644 apps/roi-cacl-2-admin/src/util/StringFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/util/StringNullableFilter.ts create mode 100644 apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenList.tsx create mode 100644 apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/webhook/WebhookCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/webhook/WebhookEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/webhook/WebhookList.tsx create mode 100644 apps/roi-cacl-2-admin/src/webhook/WebhookShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/webhook/WebhookTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/workflow/WorkflowCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflow/WorkflowEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflow/WorkflowList.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflow/WorkflowShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflow/WorkflowTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderList.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepList.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepTitle.ts create mode 100644 apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeCreate.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeEdit.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeList.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeShow.tsx create mode 100644 apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeTitle.ts create mode 100644 apps/roi-cacl-2-admin/tsconfig.json create mode 100644 apps/roi-cacl-2/.dockerignore create mode 100644 apps/roi-cacl-2/.env create mode 100644 apps/roi-cacl-2/.gitignore create mode 100644 apps/roi-cacl-2/.prettierignore create mode 100644 apps/roi-cacl-2/Dockerfile create mode 100644 apps/roi-cacl-2/README.md create mode 100644 apps/roi-cacl-2/docker-compose.dev.yml create mode 100644 apps/roi-cacl-2/docker-compose.yml create mode 100644 apps/roi-cacl-2/nest-cli.json create mode 100644 apps/roi-cacl-2/package.json create mode 100644 apps/roi-cacl-2/prisma/schema.prisma create mode 100644 apps/roi-cacl-2/scripts/customSeed.ts create mode 100644 apps/roi-cacl-2/scripts/seed.ts create mode 100644 apps/roi-cacl-2/src/account/account.controller.ts create mode 100644 apps/roi-cacl-2/src/account/account.module.ts create mode 100644 apps/roi-cacl-2/src/account/account.resolver.ts create mode 100644 apps/roi-cacl-2/src/account/account.service.ts create mode 100644 apps/roi-cacl-2/src/account/base/Account.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountCountArgs.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountCreateInput.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountWhereInput.ts create mode 100644 apps/roi-cacl-2/src/account/base/AccountWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/account/base/CreateAccountArgs.ts create mode 100644 apps/roi-cacl-2/src/account/base/DeleteAccountArgs.ts create mode 100644 apps/roi-cacl-2/src/account/base/UpdateAccountArgs.ts create mode 100644 apps/roi-cacl-2/src/account/base/account.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/account/base/account.controller.base.ts create mode 100644 apps/roi-cacl-2/src/account/base/account.module.base.ts create mode 100644 apps/roi-cacl-2/src/account/base/account.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/account/base/account.service.base.ts create mode 100644 apps/roi-cacl-2/src/apiKey/apiKey.controller.ts create mode 100644 apps/roi-cacl-2/src/apiKey/apiKey.module.ts create mode 100644 apps/roi-cacl-2/src/apiKey/apiKey.resolver.ts create mode 100644 apps/roi-cacl-2/src/apiKey/apiKey.service.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKey.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyCountArgs.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyCreateInput.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereInput.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/CreateApiKeyArgs.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/DeleteApiKeyArgs.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/UpdateApiKeyArgs.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/apiKey.module.base.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/apiKey.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/apiKey/base/apiKey.service.base.ts create mode 100644 apps/roi-cacl-2/src/app.module.ts create mode 100644 apps/roi-cacl-2/src/appModel/appModel.controller.ts create mode 100644 apps/roi-cacl-2/src/appModel/appModel.module.ts create mode 100644 apps/roi-cacl-2/src/appModel/appModel.resolver.ts create mode 100644 apps/roi-cacl-2/src/appModel/appModel.service.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/ApiKeyCreateNestedManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/ApiKeyUpdateManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModel.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelCountArgs.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelCreateInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelWhereInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/AppModelWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/CreateAppModelArgs.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/CredentialCreateNestedManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/CredentialUpdateManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/DeleteAppModelArgs.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/EnumAppModelCategories.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/UpdateAppModelArgs.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/WebhookCreateNestedManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/WebhookUpdateManyWithoutAppModelsInput.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/appModel.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/appModel.controller.base.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/appModel.module.base.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/appModel.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/appModel/base/appModel.service.base.ts create mode 100644 apps/roi-cacl-2/src/attendee/attendee.controller.ts create mode 100644 apps/roi-cacl-2/src/attendee/attendee.module.ts create mode 100644 apps/roi-cacl-2/src/attendee/attendee.resolver.ts create mode 100644 apps/roi-cacl-2/src/attendee/attendee.service.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/Attendee.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeCountArgs.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeCreateInput.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeWhereInput.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/AttendeeWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/CreateAttendeeArgs.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/DeleteAttendeeArgs.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/UpdateAttendeeArgs.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/attendee.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/attendee.controller.base.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/attendee.module.base.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/attendee.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/attendee/base/attendee.service.base.ts create mode 100644 apps/roi-cacl-2/src/availability/availability.controller.ts create mode 100644 apps/roi-cacl-2/src/availability/availability.module.ts create mode 100644 apps/roi-cacl-2/src/availability/availability.resolver.ts create mode 100644 apps/roi-cacl-2/src/availability/availability.service.ts create mode 100644 apps/roi-cacl-2/src/availability/base/Availability.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityCountArgs.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityCreateInput.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityWhereInput.ts create mode 100644 apps/roi-cacl-2/src/availability/base/AvailabilityWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/availability/base/CreateAvailabilityArgs.ts create mode 100644 apps/roi-cacl-2/src/availability/base/DeleteAvailabilityArgs.ts create mode 100644 apps/roi-cacl-2/src/availability/base/UpdateAvailabilityArgs.ts create mode 100644 apps/roi-cacl-2/src/availability/base/availability.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/availability/base/availability.controller.base.ts create mode 100644 apps/roi-cacl-2/src/availability/base/availability.module.base.ts create mode 100644 apps/roi-cacl-2/src/availability/base/availability.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/availability/base/availability.service.base.ts create mode 100644 apps/roi-cacl-2/src/booking/base/AttendeeCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/AttendeeUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/Booking.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingCountArgs.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingCreateInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingReferenceCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingReferenceUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingWhereInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/BookingWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/CreateBookingArgs.ts create mode 100644 apps/roi-cacl-2/src/booking/base/DeleteBookingArgs.ts create mode 100644 apps/roi-cacl-2/src/booking/base/EnumBookingStatus.ts create mode 100644 apps/roi-cacl-2/src/booking/base/PaymentCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/PaymentUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/UpdateBookingArgs.ts create mode 100644 apps/roi-cacl-2/src/booking/base/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/WorkflowReminderUpdateManyWithoutBookingsInput.ts create mode 100644 apps/roi-cacl-2/src/booking/base/booking.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/booking/base/booking.controller.base.ts create mode 100644 apps/roi-cacl-2/src/booking/base/booking.module.base.ts create mode 100644 apps/roi-cacl-2/src/booking/base/booking.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/booking/base/booking.service.base.ts create mode 100644 apps/roi-cacl-2/src/booking/booking.controller.ts create mode 100644 apps/roi-cacl-2/src/booking/booking.module.ts create mode 100644 apps/roi-cacl-2/src/booking/booking.resolver.ts create mode 100644 apps/roi-cacl-2/src/booking/booking.service.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReference.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCountArgs.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCreateInput.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereInput.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/CreateBookingReferenceArgs.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/DeleteBookingReferenceArgs.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/UpdateBookingReferenceArgs.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/bookingReference.module.base.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/bookingReference.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/base/bookingReference.service.base.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/bookingReference.controller.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/bookingReference.module.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/bookingReference.resolver.ts create mode 100644 apps/roi-cacl-2/src/bookingReference/bookingReference.service.ts create mode 100644 apps/roi-cacl-2/src/connectMicroservices.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CreateCredentialArgs.ts create mode 100644 apps/roi-cacl-2/src/credential/base/Credential.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialCountArgs.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialCreateInput.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialWhereInput.ts create mode 100644 apps/roi-cacl-2/src/credential/base/CredentialWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/credential/base/DeleteCredentialArgs.ts create mode 100644 apps/roi-cacl-2/src/credential/base/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts create mode 100644 apps/roi-cacl-2/src/credential/base/DestinationCalendarUpdateManyWithoutCredentialsInput.ts create mode 100644 apps/roi-cacl-2/src/credential/base/UpdateCredentialArgs.ts create mode 100644 apps/roi-cacl-2/src/credential/base/credential.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/credential/base/credential.controller.base.ts create mode 100644 apps/roi-cacl-2/src/credential/base/credential.module.base.ts create mode 100644 apps/roi-cacl-2/src/credential/base/credential.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/credential/base/credential.service.base.ts create mode 100644 apps/roi-cacl-2/src/credential/credential.controller.ts create mode 100644 apps/roi-cacl-2/src/credential/credential.module.ts create mode 100644 apps/roi-cacl-2/src/credential/credential.resolver.ts create mode 100644 apps/roi-cacl-2/src/credential/credential.service.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/CreateDailyEventReferenceArgs.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReference.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCountArgs.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCreateInput.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereInput.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/DeleteDailyEventReferenceArgs.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/UpdateDailyEventReferenceArgs.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.module.base.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.service.base.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.controller.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.module.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.resolver.ts create mode 100644 apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.service.ts create mode 100644 apps/roi-cacl-2/src/decorators/api-nested-query.decorator.ts create mode 100644 apps/roi-cacl-2/src/decorators/public.decorator.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/CreateDestinationCalendarArgs.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DeleteDestinationCalendarArgs.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendar.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCountArgs.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCreateInput.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereInput.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/UpdateDestinationCalendarArgs.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.module.base.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.service.base.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.controller.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.module.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.resolver.ts create mode 100644 apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.service.ts create mode 100644 apps/roi-cacl-2/src/errors.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/AvailabilityCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/AvailabilityUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/BookingCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/BookingUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/CreateEventTypeArgs.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/DeleteEventTypeArgs.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EnumEventTypePeriodType.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EnumEventTypeSchedulingType.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventType.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeCountArgs.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeCreateInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeWhereInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/EventTypeWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/UpdateEventTypeArgs.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/UserCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/UserUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/WebhookCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/WebhookUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/eventType.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/eventType.module.base.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts create mode 100644 apps/roi-cacl-2/src/eventType/eventType.controller.ts create mode 100644 apps/roi-cacl-2/src/eventType/eventType.module.ts create mode 100644 apps/roi-cacl-2/src/eventType/eventType.resolver.ts create mode 100644 apps/roi-cacl-2/src/eventType/eventType.service.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/CreateEventTypeCustomInputArgs.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/DeleteEventTypeCustomInputArgs.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EnumEventTypeCustomInputType.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInput.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCountArgs.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCreateInput.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereInput.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/UpdateEventTypeCustomInputArgs.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.module.base.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.service.base.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.controller.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.module.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.resolver.ts create mode 100644 apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.service.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/CreateFeedbackArgs.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/DeleteFeedbackArgs.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/Feedback.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackCountArgs.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackCreateInput.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackWhereInput.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/FeedbackWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/UpdateFeedbackArgs.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/feedback.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/feedback.controller.base.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/feedback.module.base.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/feedback.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/feedback/base/feedback.service.base.ts create mode 100644 apps/roi-cacl-2/src/feedback/feedback.controller.ts create mode 100644 apps/roi-cacl-2/src/feedback/feedback.module.ts create mode 100644 apps/roi-cacl-2/src/feedback/feedback.resolver.ts create mode 100644 apps/roi-cacl-2/src/feedback/feedback.service.ts create mode 100644 apps/roi-cacl-2/src/filters/HttpExceptions.filter.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/CreateHashedLinkArgs.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/DeleteHashedLinkArgs.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLink.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkCountArgs.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkCreateInput.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereInput.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/UpdateHashedLinkArgs.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/hashedLink.module.base.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/hashedLink.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/base/hashedLink.service.base.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/hashedLink.controller.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/hashedLink.module.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/hashedLink.resolver.ts create mode 100644 apps/roi-cacl-2/src/hashedLink/hashedLink.service.ts create mode 100644 apps/roi-cacl-2/src/health/base/health.controller.base.ts create mode 100644 apps/roi-cacl-2/src/health/base/health.service.base.ts create mode 100644 apps/roi-cacl-2/src/health/health.controller.ts create mode 100644 apps/roi-cacl-2/src/health/health.module.ts create mode 100644 apps/roi-cacl-2/src/health/health.service.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/CreateImpersonationArgs.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/DeleteImpersonationArgs.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/Impersonation.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationCountArgs.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationCreateInput.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereInput.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/UpdateImpersonationArgs.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/impersonation.module.base.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/impersonation.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/impersonation/base/impersonation.service.base.ts create mode 100644 apps/roi-cacl-2/src/impersonation/impersonation.controller.ts create mode 100644 apps/roi-cacl-2/src/impersonation/impersonation.module.ts create mode 100644 apps/roi-cacl-2/src/impersonation/impersonation.resolver.ts create mode 100644 apps/roi-cacl-2/src/impersonation/impersonation.service.ts create mode 100644 apps/roi-cacl-2/src/main.ts create mode 100644 apps/roi-cacl-2/src/membership/base/CreateMembershipArgs.ts create mode 100644 apps/roi-cacl-2/src/membership/base/DeleteMembershipArgs.ts create mode 100644 apps/roi-cacl-2/src/membership/base/EnumMembershipRole.ts create mode 100644 apps/roi-cacl-2/src/membership/base/Membership.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipCountArgs.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipCreateInput.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipWhereInput.ts create mode 100644 apps/roi-cacl-2/src/membership/base/MembershipWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/membership/base/UpdateMembershipArgs.ts create mode 100644 apps/roi-cacl-2/src/membership/base/membership.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/membership/base/membership.controller.base.ts create mode 100644 apps/roi-cacl-2/src/membership/base/membership.module.base.ts create mode 100644 apps/roi-cacl-2/src/membership/base/membership.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/membership/base/membership.service.base.ts create mode 100644 apps/roi-cacl-2/src/membership/membership.controller.ts create mode 100644 apps/roi-cacl-2/src/membership/membership.module.ts create mode 100644 apps/roi-cacl-2/src/membership/membership.resolver.ts create mode 100644 apps/roi-cacl-2/src/membership/membership.service.ts create mode 100644 apps/roi-cacl-2/src/payment/base/CreatePaymentArgs.ts create mode 100644 apps/roi-cacl-2/src/payment/base/DeletePaymentArgs.ts create mode 100644 apps/roi-cacl-2/src/payment/base/EnumPaymentType.ts create mode 100644 apps/roi-cacl-2/src/payment/base/Payment.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentCountArgs.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentCreateInput.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentWhereInput.ts create mode 100644 apps/roi-cacl-2/src/payment/base/PaymentWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/payment/base/UpdatePaymentArgs.ts create mode 100644 apps/roi-cacl-2/src/payment/base/payment.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/payment/base/payment.controller.base.ts create mode 100644 apps/roi-cacl-2/src/payment/base/payment.module.base.ts create mode 100644 apps/roi-cacl-2/src/payment/base/payment.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/payment/base/payment.service.base.ts create mode 100644 apps/roi-cacl-2/src/payment/payment.controller.ts create mode 100644 apps/roi-cacl-2/src/payment/payment.module.ts create mode 100644 apps/roi-cacl-2/src/payment/payment.resolver.ts create mode 100644 apps/roi-cacl-2/src/payment/payment.service.ts create mode 100644 apps/roi-cacl-2/src/prisma.util.spec.ts create mode 100644 apps/roi-cacl-2/src/prisma.util.ts create mode 100644 apps/roi-cacl-2/src/prisma/prisma.module.ts create mode 100644 apps/roi-cacl-2/src/prisma/prisma.service.ts create mode 100644 apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.spec.ts create mode 100644 apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.ts create mode 100644 apps/roi-cacl-2/src/providers/secrets/secretsManager.module.ts create mode 100644 apps/roi-cacl-2/src/providers/secrets/secretsManager.service.ts create mode 100644 apps/roi-cacl-2/src/providers/secrets/secretsNameKey.enum.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/CreateReminderMailArgs.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/DeleteReminderMailArgs.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/EnumReminderMailReminderType.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMail.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailCountArgs.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailCreateInput.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereInput.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/UpdateReminderMailArgs.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/reminderMail.module.base.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/reminderMail.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/base/reminderMail.service.base.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/reminderMail.controller.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/reminderMail.module.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/reminderMail.resolver.ts create mode 100644 apps/roi-cacl-2/src/reminderMail/reminderMail.service.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/CreateResetPasswordRequestArgs.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/DeleteResetPasswordRequestArgs.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequest.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCountArgs.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCreateInput.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereInput.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/UpdateResetPasswordRequestArgs.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.module.base.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.service.base.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.controller.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.module.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.resolver.ts create mode 100644 apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.service.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/AvailabilityCreateNestedManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/AvailabilityUpdateManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/CreateScheduleArgs.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/DeleteScheduleArgs.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/EventTypeCreateNestedManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/EventTypeUpdateManyWithoutSchedulesInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/Schedule.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleCountArgs.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleCreateInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleWhereInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/ScheduleWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/UpdateScheduleArgs.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/schedule.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/schedule.controller.base.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/schedule.module.base.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/schedule.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/schedule/base/schedule.service.base.ts create mode 100644 apps/roi-cacl-2/src/schedule/schedule.controller.ts create mode 100644 apps/roi-cacl-2/src/schedule/schedule.module.ts create mode 100644 apps/roi-cacl-2/src/schedule/schedule.resolver.ts create mode 100644 apps/roi-cacl-2/src/schedule/schedule.service.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/CreateSelectedCalendarArgs.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/DeleteSelectedCalendarArgs.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendar.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCountArgs.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCreateInput.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereInput.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/UpdateSelectedCalendarArgs.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.module.base.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.service.base.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.controller.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.module.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.resolver.ts create mode 100644 apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.service.ts create mode 100644 apps/roi-cacl-2/src/serveStaticOptions.service.ts create mode 100644 apps/roi-cacl-2/src/session/base/CreateSessionArgs.ts create mode 100644 apps/roi-cacl-2/src/session/base/DeleteSessionArgs.ts create mode 100644 apps/roi-cacl-2/src/session/base/Session.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionCountArgs.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionCreateInput.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionWhereInput.ts create mode 100644 apps/roi-cacl-2/src/session/base/SessionWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/session/base/UpdateSessionArgs.ts create mode 100644 apps/roi-cacl-2/src/session/base/session.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/session/base/session.controller.base.ts create mode 100644 apps/roi-cacl-2/src/session/base/session.module.base.ts create mode 100644 apps/roi-cacl-2/src/session/base/session.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/session/base/session.service.base.ts create mode 100644 apps/roi-cacl-2/src/session/session.controller.ts create mode 100644 apps/roi-cacl-2/src/session/session.module.ts create mode 100644 apps/roi-cacl-2/src/session/session.resolver.ts create mode 100644 apps/roi-cacl-2/src/session/session.service.ts create mode 100644 apps/roi-cacl-2/src/swagger.ts create mode 100644 apps/roi-cacl-2/src/swagger/favicon.png create mode 100644 apps/roi-cacl-2/src/swagger/logo-amplication-white.svg create mode 100644 apps/roi-cacl-2/src/swagger/swagger.css create mode 100644 apps/roi-cacl-2/src/team/base/CreateTeamArgs.ts create mode 100644 apps/roi-cacl-2/src/team/base/DeleteTeamArgs.ts create mode 100644 apps/roi-cacl-2/src/team/base/EventTypeCreateNestedManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/EventTypeUpdateManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/MembershipCreateNestedManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/MembershipUpdateManyWithoutTeamsInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/Team.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamCountArgs.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamCreateInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamWhereInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/TeamWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/team/base/UpdateTeamArgs.ts create mode 100644 apps/roi-cacl-2/src/team/base/team.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/team/base/team.controller.base.ts create mode 100644 apps/roi-cacl-2/src/team/base/team.module.base.ts create mode 100644 apps/roi-cacl-2/src/team/base/team.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/team/base/team.service.base.ts create mode 100644 apps/roi-cacl-2/src/team/team.controller.ts create mode 100644 apps/roi-cacl-2/src/team/team.module.ts create mode 100644 apps/roi-cacl-2/src/team/team.resolver.ts create mode 100644 apps/roi-cacl-2/src/team/team.service.ts create mode 100644 apps/roi-cacl-2/src/tests/health/health.service.spec.ts create mode 100644 apps/roi-cacl-2/src/types.ts create mode 100644 apps/roi-cacl-2/src/user/base/AccountCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/AccountUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/ApiKeyCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/ApiKeyUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/AvailabilityCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/AvailabilityUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/BookingCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/BookingUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/CreateUserArgs.ts create mode 100644 apps/roi-cacl-2/src/user/base/CredentialCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/CredentialUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/DeleteUserArgs.ts create mode 100644 apps/roi-cacl-2/src/user/base/EnumUserIdentityProvider.ts create mode 100644 apps/roi-cacl-2/src/user/base/EnumUserPlan.ts create mode 100644 apps/roi-cacl-2/src/user/base/EnumUserRole.ts create mode 100644 apps/roi-cacl-2/src/user/base/EventTypeCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/EventTypeUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/FeedbackCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/FeedbackUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/ImpersonationCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/ImpersonationUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/MembershipCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/MembershipUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/ScheduleCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/ScheduleUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/SelectedCalendarCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/SelectedCalendarUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/SessionCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/SessionUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/UpdateUserArgs.ts create mode 100644 apps/roi-cacl-2/src/user/base/User.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserCountArgs.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserCreateInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserWhereInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/UserWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/WebhookCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/WebhookUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/WorkflowCreateNestedManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/WorkflowUpdateManyWithoutUsersInput.ts create mode 100644 apps/roi-cacl-2/src/user/base/user.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/user/base/user.controller.base.ts create mode 100644 apps/roi-cacl-2/src/user/base/user.module.base.ts create mode 100644 apps/roi-cacl-2/src/user/base/user.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/user/base/user.service.base.ts create mode 100644 apps/roi-cacl-2/src/user/user.controller.ts create mode 100644 apps/roi-cacl-2/src/user/user.module.ts create mode 100644 apps/roi-cacl-2/src/user/user.resolver.ts create mode 100644 apps/roi-cacl-2/src/user/user.service.ts create mode 100644 apps/roi-cacl-2/src/util/BooleanFilter.ts create mode 100644 apps/roi-cacl-2/src/util/BooleanNullableFilter.ts create mode 100644 apps/roi-cacl-2/src/util/DateTimeFilter.ts create mode 100644 apps/roi-cacl-2/src/util/DateTimeNullableFilter.ts create mode 100644 apps/roi-cacl-2/src/util/FloatFilter.ts create mode 100644 apps/roi-cacl-2/src/util/FloatNullableFilter.ts create mode 100644 apps/roi-cacl-2/src/util/IntFilter.ts create mode 100644 apps/roi-cacl-2/src/util/IntNullableFilter.ts create mode 100644 apps/roi-cacl-2/src/util/JsonFilter.ts create mode 100644 apps/roi-cacl-2/src/util/JsonNullableFilter.ts create mode 100644 apps/roi-cacl-2/src/util/MetaQueryPayload.ts create mode 100644 apps/roi-cacl-2/src/util/QueryMode.ts create mode 100644 apps/roi-cacl-2/src/util/SortOrder.ts create mode 100644 apps/roi-cacl-2/src/util/StringFilter.ts create mode 100644 apps/roi-cacl-2/src/util/StringNullableFilter.ts create mode 100644 apps/roi-cacl-2/src/validators/index.ts create mode 100644 apps/roi-cacl-2/src/validators/is-json-value-validator.spec.ts create mode 100644 apps/roi-cacl-2/src/validators/is-json-value-validator.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/CreateVerificationTokenArgs.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/DeleteVerificationTokenArgs.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/UpdateVerificationTokenArgs.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationToken.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCountArgs.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCreateInput.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereInput.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/verificationToken.module.base.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/verificationToken.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/base/verificationToken.service.base.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/verificationToken.controller.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/verificationToken.module.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/verificationToken.resolver.ts create mode 100644 apps/roi-cacl-2/src/verificationToken/verificationToken.service.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/CreateWebhookArgs.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/DeleteWebhookArgs.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/EnumWebhookEventTriggers.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/UpdateWebhookArgs.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/Webhook.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookCountArgs.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookCreateInput.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookWhereInput.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/WebhookWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/webhook.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/webhook.controller.base.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/webhook.module.base.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/webhook.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/webhook/base/webhook.service.base.ts create mode 100644 apps/roi-cacl-2/src/webhook/webhook.controller.ts create mode 100644 apps/roi-cacl-2/src/webhook/webhook.module.ts create mode 100644 apps/roi-cacl-2/src/webhook/webhook.resolver.ts create mode 100644 apps/roi-cacl-2/src/webhook/webhook.service.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/CreateWorkflowArgs.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/DeleteWorkflowArgs.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/EnumWorkflowTimeUnit.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/EnumWorkflowTrigger.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/UpdateWorkflowArgs.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/Workflow.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowCountArgs.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowCreateInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowStepUpdateManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowWhereInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/workflow.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/workflow.controller.base.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/workflow.module.base.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/workflow.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/workflow/base/workflow.service.base.ts create mode 100644 apps/roi-cacl-2/src/workflow/workflow.controller.ts create mode 100644 apps/roi-cacl-2/src/workflow/workflow.module.ts create mode 100644 apps/roi-cacl-2/src/workflow/workflow.resolver.ts create mode 100644 apps/roi-cacl-2/src/workflow/workflow.service.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/CreateWorkflowReminderArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/DeleteWorkflowReminderArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/EnumWorkflowReminderMethod.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/UpdateWorkflowReminderArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminder.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCountArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCreateInput.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereInput.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.module.base.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.service.base.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/workflowReminder.controller.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/workflowReminder.module.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/workflowReminder.resolver.ts create mode 100644 apps/roi-cacl-2/src/workflowReminder/workflowReminder.service.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/CreateWorkflowStepArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/DeleteWorkflowStepArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepAction.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepTemplate.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/UpdateWorkflowStepArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStep.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCountArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCreateInput.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereInput.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/workflowStep.module.base.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/workflowStep.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/base/workflowStep.service.base.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/workflowStep.controller.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/workflowStep.module.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/workflowStep.resolver.ts create mode 100644 apps/roi-cacl-2/src/workflowStep/workflowStep.service.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/CreateWorkflowsOnEventTypeArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/DeleteWorkflowsOnEventTypeArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/UpdateWorkflowsOnEventTypeArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventType.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCountArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCreateInput.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindUniqueArgs.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeListRelationFilter.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeOrderByInput.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeUpdateInput.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereInput.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.spec.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.module.base.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.resolver.base.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.service.base.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.controller.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.module.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.resolver.ts create mode 100644 apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.service.ts create mode 100644 apps/roi-cacl-2/tsconfig.build.json create mode 100644 apps/roi-cacl-2/tsconfig.json diff --git a/apps/roi-cacl-2-admin/.dockerignore b/apps/roi-cacl-2-admin/.dockerignore new file mode 100644 index 0000000..1194b4f --- /dev/null +++ b/apps/roi-cacl-2-admin/.dockerignore @@ -0,0 +1,7 @@ +.dockerignore +docker-compose.yml +Dockerfile +build/ +node_modules +.env +.gitignore diff --git a/apps/roi-cacl-2-admin/.env b/apps/roi-cacl-2-admin/.env new file mode 100644 index 0000000..4eef91c --- /dev/null +++ b/apps/roi-cacl-2-admin/.env @@ -0,0 +1,2 @@ +PORT=3001 +REACT_APP_SERVER_URL=http://localhost:3000 \ No newline at end of file diff --git a/apps/roi-cacl-2-admin/.gitignore b/apps/roi-cacl-2-admin/.gitignore new file mode 100644 index 0000000..590b2e0 --- /dev/null +++ b/apps/roi-cacl-2-admin/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/apps/roi-cacl-2-admin/Dockerfile b/apps/roi-cacl-2-admin/Dockerfile new file mode 100644 index 0000000..0911e21 --- /dev/null +++ b/apps/roi-cacl-2-admin/Dockerfile @@ -0,0 +1,51 @@ +# multi-stage: base (build) +FROM node:18.13.0-slim AS base + +# instantiate environment variable +ARG REACT_APP_SERVER_URL=http://localhost:3000 + +# set the environment variable that points to the server +ENV REACT_APP_SERVER_URL=$REACT_APP_SERVER_URL + +# create directory where the application will be built +WORKDIR /app + +# copy over the dependency manifests, both the package.json +# and the package-lock.json are copied over +COPY package*.json ./ + +# installs packages and their dependencies +RUN npm install + +# copy over the code base +COPY . . + +# create the bundle of the application +RUN npm run build + +# multi-stage: production (runtime) +FROM nginx:1.22-alpine AS production + +# copy over the bundled code from the build stage +COPY --from=base /app/build /usr/share/nginx/html +COPY --from=base /app/configuration/nginx.conf /etc/nginx/conf.d/default.conf + +# create a new process indication file +RUN touch /var/run/nginx.pid + +# change ownership of nginx related directories and files +RUN chown -R nginx:nginx /var/run/nginx.pid \ + /usr/share/nginx/html \ + /var/cache/nginx \ + /var/log/nginx \ + /etc/nginx/conf.d + +# set user to the created non-privileged user +USER nginx + +# expose a specific port on the docker container +ENV PORT=3001 +EXPOSE ${PORT} + +# start the server using the previously build application +ENTRYPOINT [ "nginx", "-g", "daemon off;" ] diff --git a/apps/roi-cacl-2-admin/README.md b/apps/roi-cacl-2-admin/README.md new file mode 100644 index 0000000..cc7c387 --- /dev/null +++ b/apps/roi-cacl-2-admin/README.md @@ -0,0 +1,47 @@ +

+ + amplication-logo + +

+ +# Introduction + +This service was generated with Amplication. It serves as the client-side for the generated server component. The client-side consist of a React application with ready-made forms for creating and editing the different data models of the application. It is pre-conffigured to work with the server and comes with the boilerplate and foundation for the client - i.e., routing, navigation, authentication, permissions, menu, breadcrumbs, error handling and much more. Additional information about the admin component and the architecture around it, can be found on the [documentation](https://docs.amplication.com/guides/getting-started) site. This side of the generated project was bootstrapped with [create-react-app](https://github.com/facebook/create-react-app) and built with [react-admin](https://marmelab.com/react-admin/). + + +

+ +

+ +# Getting started + +## Step 1: Configuration + +Configuration for the client component can be provided through the use of environment variables. These can be passed to the application via the use of the `.env` file in the base directory of the generated service. Below a table can be found which show the different variables that can be passed. These values are provided default values after generation, change them to the desired values. + +| Variable | Description | Value | +| -------------------- | ------------------------------------------------ | ------------------------------ | +| PORT | the port on which to run the client | 3001 | +| REACT_APP_SERVER_URL | the url on which the server component is running | http://localhost:[server-port] | + +> **Note** +> Amplication generates default values and stores them under the .env file. It is advised to use some form of secrets manager/vault solution when using in production. + + +## Step 2: Scripts + +After configuration of the client the next step would be to run the application. Before running the client side of the component, make sure that the different pre-requisites are met - i.e., npm, docker. Make sure that the server-side of the application is running. + +```sh +# installation of the dependencies +$ npm install + +# starts the application in development mode - available by default under http://localhost:3001 with a pre-configured user with the username "admin" and password "admin" +$ npm run start + +# builds the application in production mode - available under 'build' +$ npm run build + +# removes the single build dependency from the project +$ npm run eject +``` diff --git a/apps/roi-cacl-2-admin/configuration/nginx.conf b/apps/roi-cacl-2-admin/configuration/nginx.conf new file mode 100644 index 0000000..c907b5c --- /dev/null +++ b/apps/roi-cacl-2-admin/configuration/nginx.conf @@ -0,0 +1,11 @@ +server_tokens off; + +server { + listen 3001; + server_name localhost; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html; + } +} \ No newline at end of file diff --git a/apps/roi-cacl-2-admin/package.json b/apps/roi-cacl-2-admin/package.json new file mode 100644 index 0000000..8babaa6 --- /dev/null +++ b/apps/roi-cacl-2-admin/package.json @@ -0,0 +1,60 @@ +{ + "name": "@roi-cacl-2/admin", + "private": true, + "dependencies": { + "@apollo/client": "3.6.9", + "@material-ui/core": "4.12.4", + "graphql": "15.6.1", + "lodash": "4.17.21", + "pluralize": "8.0.0", + "ra-data-graphql-amplication": "0.0.14", + "react": "16.14.0", + "react-admin": "3.19.12", + "react-dom": "16.14.0", + "react-scripts": "5.0.0", + "sass": "^1.39.0", + "web-vitals": "1.1.2" + }, + "overrides": { + "react-scripts": { + "@svgr/webpack": "6.5.1" + } + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "package:container": "docker build ." + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@testing-library/jest-dom": "5.14.1", + "@testing-library/react": "11.2.7", + "@testing-library/user-event": "13.2.0", + "@types/jest": "26.0.16", + "@types/lodash": "4.14.178", + "@types/node": "12.20.16", + "@types/react": "16.14.11", + "@types/react-dom": "17.0.0", + "type-fest": "0.13.1", + "typescript": "4.3.5" + } +} \ No newline at end of file diff --git a/apps/roi-cacl-2-admin/public/favicon.ico b/apps/roi-cacl-2-admin/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..fcbdcf2d26233c47420d1e8d0f47f0aede4c1130 GIT binary patch literal 6548 zcma)A`EOj+6@K2G#EugH`3D$$Xw$;Z~QgJFxm{m$jTB+N}OR7#~Ma%uGBrK*CZH*-*0`9Xc%kB z2EQHXYfn9V>M%Y}?d)hBg2cE+dNRH-9A#<45bV`663V~puX14A_aIt}>%1imO&!oc zWx@84X!Y~!HRE%&lMCHaS5eVB>RH;X8lLJDbHmbBk-N&ji`tl2MnnYmq9*?i^xCP# zJCn3@>eo7#)9bIBjnvJaZ%d$I5EBnWtjR9RmL1AI5bg-AY zbOD@){=hjTYz_4dtC_1=&>~0F*%}zR5~CALgaRpO1%3YFAyMqQa;c4sEJJCRN~s8N zUmRE_%09{}$|B_&c>u+R(v-(OODLcYm7%Yn`sd4gv4;}Bd{r8RUr3+7*Q$4|AG7o- zXg&GrQp*Zu5QVdVZoGDSkrQ)uH4#tj$q#-GjYpYNz8Z{$1YK6)ZB2#dECk~@9v3q> z9lD<3fA6Is^&F3Lef5+p>Gq3BP~kkIGt|d!!LwkXyHf&*Wn`HtaqD-|2br|+|C2(p zq;hCN14%boH8iPOagFBz8N}T^Tz%#&w+zx4K#;h*hKg$&kQN%E`2_`LxQ$B3X70Ih zZMU$jT*pD!HAF52d1hwL1ei-2w&k4z8jHRSST*uyp@MWyo1@sfa#iC)Geo^LAswqm zXOOm4Bhy;f)^TZV6M@XvsgU!f{!q=teE*%64(;mn1vJl)f~u(l%sr|JIbmjeet~UD zhNwOhR!wuw<|uK6dS;|mfunYMxxi-Es4gfh@}9q}EoCj8x>?0^_518x8K>?jI?-^Y(w{!$$$;dG(AVUtY1g>FtaPt&I zB=yEq5bEj7G0uF%V8#}sEOA^A0SJ^HyOjV@7TJ^fF$gZdS#x+LI1#?_QuQvK{;wxq zon5Ghvh&VE;Gok)5{?RLMp^XMyCAsiEfgP$_voPph?>g9{cbL4f8`!<&}Tmb^RRn? z7-9pE%o3r@#M7c^44w7G#o5HttPz457r(&};Xqxsw8PCa(IIZr53apZaL}fRl$6<# zt*wt=H;z{n5Q56-zp}|hU6!H{1y9GKiPQ5nRs{;TyD-Ncef4OBlY>&yPl9jUeAvl@ ziP?Me34UT;;gItv8b_w}2OwWA;xX4mKKfq>F&H5Bq3NzCLDT>QRKKaOM&)bs#Q?-9 zs;rq7i-r~Q1*xMrp~BrY=(~7brv~Qfh#~n98L4BdL4l}4nmzLuwOI{{TG|UB^(|N9 z69tI!_TGalE^=2Yu0_FA*H>6x;a%AQw(CghU1kVqN<>&hMgJKf`QQPYVy+3zIs`xs zAgLn&wiK~}X6h$JF5L_sE_hm~&BPr>1PJ)3z@&|Mgy?iY)r!8cirx`*tOC8eDB14SA#M}i`zC%r}BJL>eY>lLgE;QkYA^S$ z@h5iX{0ToF19f5$-Us2kClfryGQaoyrPRGoe~-Eoh0X~_Hgcu8u2!UQ-*PGx4JK$g zD?A&nXAdRuy%)eIxuQ-FopZsH2rk40a>>MIkmuf;&q8bj^`Ln$LZeJH4Nqe-NsLD? zi`-?XC2fOcQv)$r?h^XdA{sWNy&MVE zWS~u4OZw_@$f%Fc>rukEmIfxI+F2V>hhA>)x7tdeU9oC(=y=IBUW{4vLPFYn8uH}( z-=ltX@|&n^jRnOpVjI36m!k;%!!$fdO$<;+XpZQi4a@wBOn3p6)HiBqhNVe`zM=50 zQ-k&@u-ny%ioSTunsC%DpX+qyvsQZm_02m3FDG+h2bY4^wTY$*PKrW6JT)jL<6==H z1}1AK{QOejH{Wq4=;{1wuX*4cP#o`Cz$YGlcoO4xC+-U!w8YztpS8vHjkx>t3qbj_ z>;&&!yorIRc=gwXS2QMYN7aW{&CCc%KV2u27lgY9uWlWpnW2NHxVpP`YDrg)OF$tQ zKY|rG7=0kUCe;796wGI~rnMeIS)d)yX1y)y&#kMbC$6*MzBWItpIft+IQ1-amH0;h z{s(}Y+EG)l$D!N6vt9kH$Bdidpg|Xir@JovPRE{Mq6^5gu%W(Dfqx%pldcVyqaJ~t z7w%>Jvmhwnn?HwiaP_34x(?5A{L`YuDGD&idB4tmS7a%dfqC`vMZ6QR=u;}BbOD!FWk5d{(e2R5R zzW;JeOP&$WPLKTryoJ|D0;>=+J44fudiwp;EpqelDy=G%{A}JNLJs%XacG3x2kZl_ zBW2eetJ0DO(Vap&%JJ)B1m{66?n?Evi15Bh;d&kPUo1pD=O4cktHGcK6`-6K^@~?H zl}>lAcv>}SEPngBrA4S2%NN7|{^2jcmX^TY`KcJW5vPVX)Ju__gt1%CLyLYi#V~K6 zcav+uK<97#Db)*^k3tF3A!49%QqVCG7FP(Adc6;F9YsHfX1)NV^`l=0IsJmvj!$JL z)LnEQ*c^|fQJNWS$Zx^Hz)dAe}+sjz?ghN&hg=Ia>08X#ta?y)1syYBUf ztp=hs1Xj)1szxc~TE?hFk3CbJvAwz2fQF^0vxADEHkhLx`{toXQ1>&~J7=5Y8t-GE zCu_y@5p56m~86_*Rt(A@yahWpWaQJi5VMJ5fHLhs)i@#hBfBrBu zdi-y%f(bcRm&&cmw-si?BuaAD$vLr~U?PADKlx*lXf{Ui)ps8|0TJKP6o%*?snGE% z`lS)KyV`uih1r+^s250`;8-G1CMjDPY==zCxP7Cc3)UY&?XN_TFH8T=+Qzk-=> zQNO=%Tj!n?;}pbE6iQc`*qmHXoHr*UCNGhIm69%Ya63wF7gx!pzxiYlN1NtYUKI8# d$}i+n)((Y_4MNTsC&AAV=X77V%?~`&{|DHLP-*}G literal 0 HcmV?d00001 diff --git a/apps/roi-cacl-2-admin/public/index.html b/apps/roi-cacl-2-admin/public/index.html new file mode 100644 index 0000000..9ea981c --- /dev/null +++ b/apps/roi-cacl-2-admin/public/index.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + ROICacl-2 + + + +
+ + + diff --git a/apps/roi-cacl-2-admin/public/logo192.png b/apps/roi-cacl-2-admin/public/logo192.png new file mode 100644 index 0000000000000000000000000000000000000000..1918ff2edeedb1a1cfb429c71deb46b3cb71427e GIT binary patch literal 9721 zcmc&)`EOj;bskbAhx;N9N92%0QWCcriu*p?H*qKq$>ApM`ywvlPKu<&AtS@JQAdsA z*!3dEjuXRjyeo+lwT%n|w&h5cEm?IWtG1+|DT20gPyjd(Ni1Ab*p;PNxg1x7V~nfBXJ>!oItp$35Za$$-<*UJGjsBf#+g zs~Y+!I|E<6en?1j?l!ol@5mF?>?*bB7;$qY^Rj6RwkU0eny0x|^=ln<8k^%5VZ|7=5g3IK z?pi|@tY-0&p;(zfiKw9UP%#)`o{xv-q7@Dh5N_cMx1ad({JsJi5l*;$N{kFq^-wbq ztGM8H$lBGP@O6IvFvK&oireFeO4K&&ZoUhoLjvO?RLa9VGvVj8**${f@n+zyw_)*n z-s6R($3|9R_2tP!lPFlTs=%bB(uKM=Q*cJY~idg^(ZpRe-| zu5RN-bAneH-bMRpzS@)}1%4c4Hv|ZQ@SK2yN76(1ChJgeK!x_&!(aZ0rM7S!#9V&y zqD)}10mkkY@J5eHK(*~RKN$97>D8D)7k&-eg!DmTcYzuqEj(wgcfNjv!D=qz5Tpwt z;7)T^e6J1(DQ=2TK)H9&xZYR(kYH-Gk4nz}Z$K^XPn+ZLv9NFBJLxmy=*y7`yc zOXV2l5q9}kv$z2^rHPg8Zt=#={6ckm=~V(FB4a;)OJ1mfvUb>7#S=E&dJKkIp-#p+ zq0(pD_p=Y!dBrTjUdYvlN-R)-L48F$z5ukToH3Bx?hMN&$qW)?L0Nj)ECBBT=eGLd zP|29hi$@W#*JjfARW1YcKw7tQ#R-C9+A|<}NU;ak0(uKNz)QvVT`PuujD;l3vuS`u z2y2Yjvf~Iyjl%*$ec1Lu05b@5{o(vCgH4yta_a(P`={S$hB_B!v@sY#_XPw4F83?& z;$?0UR2=&S;9dc}Cn!PeD)vq##HNnGmgP>P)nYk3JHR`P`Qol+T$c177>g?VKkp=QRi0|Hlan_%$uiu_G0lz?qnd-usVC!n(-^R0df%kpS# zW|2);dgp0(!`ys+hM5?fb2?XBVDKcYpKvbja`2+s;7Nn^Oda5ELr(31>{%&}cR@SN zMy~KbVxo)L2QHom?W!td3a_67Z9$k^pv)&xH7Xo_zaKIO5v)NqMz*XmJVk3GF&@F% zqX!IUI0igNL3-Y{KyQXm^3c_j;%ti&W;GYycuOUC&09uQ*^0x`u@s999)Ro?Zy=*6 zq=PX4qK|+5_;EfPjdY&^u4)IF6QVWbBY(*Bqa0b?#85U z?xY2E>?|+k6O%)19TAB5%nr#o&0DsWUU3R}gCy-~t`Pi=RFTeH;>P z1_5E|dVX_}<;s*My0@*ajb4lb_Z<|zM+#`B%c$0oNxYJd@IAJ!UNtGpA7GsM(*fW~ zO_0utv|%V8MuDdj1gQ#VW&y(*>%4k^?{ciV5op? zFV?rw2gFSREX&GeZ?hwcQ`Q(tz-F|nGE}!#8iOcU<371LTQrZBN~)e?3vpTQGUD#Z zXQ7zsC6_CpW2~JS2CCIs>y2>wvwgw24F&s?gLp)DqTx7M1mOwXIDd*+nXGw8?=Cyo| zE+oPjvVHcr`WoxAD8OBOmGF7xE({)S5ApVZ#U&#kz}A5R@DwB~+z{IiU3U-!Skkh= zUIvvW+nnkWUcW^KCWXEI0GL4@sckG1%tlCp{3*2W{DPNxSe~im|a1$|DnHOGXpaCZzfD&%s6r5Vy!(OslS8+1uGV z%;VtI^DT)tAEMQl0Db`K4<#673W52Y>Q6WuNW1&vzk=dTu?{icmo}zjvsL{lferAN zK<;wjXbSkZFMt3}G}(A_0MoOqXa>WdWh1!rB7Y1pe!xu4g;!a}F_6{9=^-d*kE1k3 zx4hg3oBi&)=H3YlylFI|a>f&e&k;~DWaO)NIT6^2!-@9DUT#30pVw&V8mLW8idujp zD1}mCWRzJO5rLWV47?k{Qa$S5W~mtu(#wMgQDeP@VyNwLZ@_M@mzN4kIzjWBmmXH{ z!P!jP`Gc6+2nO=^^2orI=R~t-#(I|u-0yH?xhvC`d*zY557zoI=RjT#D8;8A%uMjm zmFg-Fo`4frb>a|z{psFp8-M~F?I0I~edjknlo(nHLtQYiVsE|95*)Oas#6_h^Oz?-F~awl2x(9^4%wc;L)CL zyEy!D$YNqeEDdy;;!~KaaJGKP!G_S|Y++yBbO5)awgW3@{qyIc`cyhfcw;aW` z>iUDd?(ZdDd-VXG09-9!%ma&B5TNO0u^(TmzhAS^Zk1#oXA%%S?)uBx*n+l~p$oNC-*_O`{qJ1YYcK9SV1 zxkt4p^DS6reU*A}2GF8POgu~K6b#*PkhneLqPcz)cXC*K;qGO7VIz;Su8lUrI@Z5s zhRTz{a67}SX7~lwfBhG5b0FOrhIJw;)l@pgZrN7Y~}p3Z#nHaIx!+Sx1~ScP~V zrm8RQl+jkD3JVA{&80!91Vo$coAV2@j^QXb-5PHT-XGfr-4(70i!*9M0wukPNi3_IS_Ya>cOJ&LhLH?S_ z%Z}FpZx7C2=h5gy_9PTLSzFwJ^~$4VP|Pg9J9bz_BR_5uE)T;r`4=W1f(oom_1hE8 zID4%zM+YGshHwFgm$7-xeY5zKMHxFV%p7qxKMCxIj8_KfR8r`wBHmC%CG*dZFt`W!JZGyq=xQkhyfV0IiYXh3WuC%fU`eleIRnr)rRtUAa zTCKUP!?EKxzY7IaLP9+@7ogZ;f~A-b&-;vO?!_lz?k}DJN6Vn9<9I8ty}*H{c{Uc1 zC<@GVfrt#zbIs6!K4mT9g1eVN`#s1#;J6?HI4|TYRoG$}B+c@J6=r?=8 zo;LAlLii^EAoI6Ri(wVD(^Tq55=H`;wuABrta8Hlxm}+@UVGoZaTc5%qt3CK8Ok;R z7-t?Em}4dmnZ+@P;-`4Ks447jpsYq|s3r)%bNd{Znr5(p65e`1z*jGdF_gdw?*?|@Lczze9S}KV&0YA4i$pSf2~b2i}i1>Jf;oh+KjMS!Mqew zAxkC@!{dSgy90S$PBU*jCOgA-MP-^(HCTE40dbjNLALXf^wbUPCR7w{maBPc#(_bfkI+79aR0clvs6w}3y0X8c^{!=U$ zfRzKp@)9`=>9uytNN$_c7ZzK!AHu3))B)=X_t9Lq&K5I6^nswti@)FrnTOhB5Kji| z{OwlF+@WyRKhV>~;&4I?wIHwQu?Z-JH$=!Jq^e8_lmgU$?o2Uz0~Zhdd(Z@;)xRcrDPT*1LI zh>rJu`L&akQ|@ZO2=`sS%7U!i3IH!dfR!Om_aA0C@tdk7iW$t3B9Mlo{;Qm%lYy9$ z=|pZ}|Kzu?{2esw@DP{M5L#8gZ|y{QSe1+{LGggAkl{6U0aqVnHU)K>)pUYIs?N>% z8!@1--dU*$TWB;Mfo*HuV&=JKT(t{)FN#u`fsfv}@iVAuNDG8Dw`l17-grkC~z#_~6BKBv}8t?Oci za|3|K*2ZqAfE97Opm>Lua7#H`6Sz2l|jlpaZ_W>SYPy~z-i?}SkYP7fT zi)Y8%tPF5*F30T2)BL~(JUH;>bG&}{igPdb1ymd1|NiAuVE@xawq$tLna$Ec0xM}72@ zm-<@GJaqXn5Wt!TRN1R-)CZ{pM&S`>11UM>E~qAhxNRRiDF(x4X=cH&bY~zcudENA TglphG9_i|9n`&TI@kIX#FLjTn literal 0 HcmV?d00001 diff --git a/apps/roi-cacl-2-admin/public/logo512.png b/apps/roi-cacl-2-admin/public/logo512.png new file mode 100644 index 0000000000000000000000000000000000000000..7e7dc74f2a9aa690a5420ac9d4bcf4fbad6c67b6 GIT binary patch literal 17361 zcma)k2a{dZmG14no#X8sZ|9uUIk!68+d1c))9s+nIf`Tqc41>vt_p)$T6A zE;^mgy|%{OrqkI%wbeQ4A>MvA<{xkU4$4+bLq{d#D2BkDV(9CPBVru;y16?aS1a!{ zj{m=(yYqqJ|L^_od`^wN_7GpY@=hamEs&kzo%pr3rgohS!JV%^5AF|Y03~;BgS$@_ zW!k(P2Ed20t^@Xi$HU>i~r7NelS7H^4N^L*ums^K{hhh}8zRdG(?fduTQ&=H~yt z|4}h;f4d1rme<%*4seBj>1@Rg#8N-l!5A+G^cS1$M5}hR6$Sh_C>_;eOe}6H7<7T2 zmo5g&UcEDKB}kovq<`OiQ5kjlHp(%1vP5M~xq1MCp=!PKAUP;~uBmBuq>rcD?~NV# zT@v zdKt&gdpGSH66`UW-8c>&!$~Jr_*gTyc+``z2U6(d+u^>ubM;IbEOy+=8{`P8pzmU` ze86i!Lrs5t6+&PX!Q)+f6U+$|BDQI!ZyL}0*B8GDev0*ZN6j6)|9wWt=mr*>?Y9W= zC3x0~;e#{o)R@!x$pB-8dNyxI$#{6 zLe02qP|>d2liSAHEsk2cgUEpWNc?PD!@4cHbA@z&!Qo#CPnm9N$Q&F(s8@6FEu*m zK-8P{JfIUJ#J4asiJ)m-VlFs=c@PJ(fZRbE^w1cWb7u{+5M!V_8c84wT*I>uPysHy z>dW1ZIvddGjp{tggqW0cv?UJpyDh04Ke`3?S}d9|qPj!EMh!4OZFJ z1r9LJ1O~O~&=$MuDl0^#mALqVwnvsnALaY!cVrMVF4b{QuYv=GBEb7XSV1$hiOm0LG28H_JDq$H75bF7Spf}PeaaI8IL?da zg}HuzSo&qchHtv@!^7V4U^BEFm+GpEPi!=(kH?@aic0N+QpK(%uzmLxQFvMnj)ob! zD$S5oBR0Bsw{b2BqPv+v>kAB|Bco5XfwM!9D*18&52HbUf|(CQ?+1%w1K}2{Jj*IB z6ni-Y8#&`XUNZ)sF|-{Iq2^h@S)E+Pk`PSUn3?Q#paFV^-5{Zu59Q_>SqcUau)zxR zQsJkofv%an&!5VJl78zhwjDK_WP~1m0M=~Z+YslQ%k0%q#tB1Hc~ys@Pcx4E>0aoz z>j#xnTe+7WfSwh;56-s=8b%Gh(9ZwXXZedW4=mFqo1lJ`FFj19L6Ax*Xv{N!L00|N zvsz3VXBAl3PXr?ngSs9W40%B6L0(Lec`*t<<-~U8-h1v5h%6Ixi`|cYoa$r00RGSY zcY}9_fYIT=HYib48;JZC(V5~G&gj4+*W$(@=C^qN;xNv`1}v?Uo86hZd7u$(F*#iY*3MgnYr z+>*Lxc>`bjUS|k~+ZYPgekz`k1-ME**PaQT@#6~mh5b{5k*>Dv%DB$<;*Yc$>(B4J z8nb^Qn|(vTg5zmb;_xO8ZQKN4r43eqaieHZL=YI;pJkZQ`C2gL`8i#x=H-WE4Ic(n zLTvIifMG=><8#gW^FNd=S22S7BxGqi6f@WHatsqt&DUkAclAT(Q32&D8SIFlV+4GN z=_42{TpaLRZt$GNkgry$!b?m|sLJEv8A8Ev=U-*l3jr;F!sx`wb1yJm1QEd@;m42l z7Q$LSx=25dfVw_^9Nf!=oAOb;FPJqQ?9!o?^mT&+hd%Y2N)5p9e;#@6+fFP)pl31C z0?}uqJJDDVC9N`-IlB$YiO2?@iDeg@i3L+74-E(~jETZqH;DTA>yQbegKzU(lg-Dm zptjt|(isY-t_PKa0B;d>-8NhO!BHvd&MKiW7t$H-0x>>OiTX6& zO}`K33wq}jFe8W?Tih5XKnZ9imVEvQs9~?O&zCRYl{C;VgX>`VV&WMCOkmj&GhzW> z=?6O%^~HU^h3t(GdtFC>uKD9%VBirWmKiP+B(+1Tj#DhA(H(8};)_t}5%taAl$qgu zZ3RENtA2yv(_9BI^?+2iE+)^Hz^L|#%_t%lLb(}Q4~PyG@WOMV=Be5%!BF{*$t++; zRM$QCQ}uJ?aY6panKPK@O#x;H5J~TvZ~g|n8N|iszXdjBsQQezzVswmnhTFBNH&Q4 z+uc7F<=Q!5)BG-16u^~=~y|?P3&;RxV=4mi1Kq7^ z^!h^>Xb9pJ1lRA=R8bfgN01F@F%Qi8yYwLL=Dl<`=*EF;k%R_xIB`Ms6&) zqhwk%Gqs>5o?tQR*pawKl3**Cknh8q&I!|)KE#n^{0n0*aiWNTCk{tBKY1* z&j)XHLsqvq(^+9MGbO^@DiYjivRz<1VzOQRXD}V;!`BjnGS#){4ZxRq)UPsA`EX07 z7+qS*WXPi7`xjjfj=ZM)0AqrWEE0Yg>)V^cM|s4X_c9;{G2B;uC|lhpGBE`VeJOK3l|)sXxHdi()x6gO=%U-?*5ykYyL{Zanl4j|oHX0kfDOa(%$`}cy! zx{Dy?Ac4Q?QcMw`{^oajW^X<3R1V!qOs%%exgfRyfznLvMNG}E zbI)iqg+5SMc?R`5XqBLhe|z<(afZWX7B65_SuUebf2j-1ZV=rKf*B(SVjbFo>KuG? zAe;=mFJKyqv4=?VV<9>&mV#%11Pq{teI_j%1HceR1gl$laHOH^+{4i63gr%H`t`Se zeTr^mMF8)=0QS*c`r$iHU&YTI;|WxQ#vR+h+Y(vTK!D1FNp(I?+u(CQT2kvV@5mYh zcyXt(PHsnw+iVXrtn?5JSWX65Satx0X}(`<=@3C6 z_f{FZpAtEcCenTzGE(&XuBzSMBGFwd)dI#eviq{yg0JU=@-1wTwJZ=oIeseA#1ah! zRSeF_6u93+=VF>u22&<9l*!G!6}Ms%qw zz2lKT=M?D&MGz;#+qYsLnt!8x7q7I#v|6T<)ZL+3KtNP27^j&BfTweN`ShN;?A2$N z%UF@^#R2S?8f+OH4Xe;B`C#-qkR<}#1JrTu=`4oTPCetu5_(_z-qF`b#ZVR(DL>lV*Qp%!sPjw2Txh8S4cA`+yL1;< zF{8c1z>-z}gDSZ6^Jpk#^vL|j-#hW=$4&>!L^T9`N;lAP-aJ;We{n$)B78+Q5%Z%2rj+<1g!+PeF%aS}1 zbo6?NgD!zip3MR41M#3hIIDER%9udDT(i3hwz$DIG-mys$vF=j=)ht1AD%So`uLHz zqwB)>ri$|~&zg&%w32z-gW0-Sz*UabLghr|jwlUG^G@}H0@SSFWtjjEWxJ&>d&lVv z9zn38bGq_PQC(v7)}H{>>jL7v8!_QL&8XeBEk+|CQwhI{i(5gP=A$o4q!AXwmAmgK z5|{uw0$9+AjAU?5q}#Et=Fq*fyrPaVR81Ay#h-%#`?lfM;EqH0{P(wBfoNhDAC#HY zJ-Y03*BVYKe?&QU`5t{#D%*px5ZDB%GeBc7rcM@lL#*!P1p9dJLkj_^KB79PJDb9_ z2k0wu82UDQf)PyC{)!jT59n)A4+z!DE0E$7g2OZ2PUJ5w; zcYst1hWBS-Ah6|v*hJQ(pasHW{d1L`)$M+oM z=FtS3nUE@-D^Ie#_bSGlBGiu>ZmgBg#U$5m-hH{irMPs_u7+peYqMRV%NqTipaEl` zzyJJKHia_mhDc&z0BQ5gA5YLBMH;?n&g2;dvD0Lv^CLP^P$LZ)%RsJiSTu{VG2arb(qXTSKj`K!eMIXN& z`ydu5g9`)&ue5}y1m;_2FTS=TGk^Kk^HH9~*%MJkUwrShyV&yHdxZhk;1$EyMHck7 z_Wk+p)0+8qh1aJ8*~X?UHId#lVH1fSEzd@#KuWNo5QVwciQG0IxTI0a>XN z;3=RDF9Q?1p5JdaBfy2O5S-Gqj$BdcQ=1VoKbL$4B3|s^`pFpZYM&nPQf}J}@?*~} z;~Nv!yrSDYY&?RY1G?N&V;~R8DNx=guU5$j+?$SKe1S2?bRKLE#N|9Vi!-LVFrb>j z3)lVk3ujel9pDMLGISCwx1XT^^de}}PLGe(KSc{0W70Y=Ke+$MO#nxtGN zX~#&}hfhGRg5p4vTw(TW1TSawcn(HRkes2aUxxImfZsepjtyi@I#{n}YjrDNq)PvI zRx|ZMvmIj7WN98S&fBqI9yR2HAa>_zkYMuCo1#=`CKbIR6N|_^*g5B`dN76|+A5FD zl8^uuB|fV@Uky-sQl=8%IG5GV&FIiI5ZxhgtA}Js=P}(`BxRLg%=hVpmfqqhC}DG8 z038)A>Q0=Ws|Bih(GoihlVoCjUlxGRM1T#-aDvZX`_8dP#az-QGF*f;WVY&>yRg0g z3NHbC{Ov2sxgHoXYrSN`lIdh{;qJgP$W_!K?oHhPUGR~FqoG6`CigT;-RjX_i(1Tq zrD&lyU-01p*qt9f1{434=FK%dO}zx7Zka%bdCh zGk!fWtOcSQ1k4mnfvbKrvdIC^1RC%KV}?>RPq`oa0tQ=|7Mp@G5NfSAKPD2f*1+DlgHcy0rqru z|FDa^k*UG0_XFpnM0gtm@i%)&|hA_1+KNOGh~+ z@P$ZKmEmB|-mnOwr^afXn6QF$h>3QFd7Y`tgqQ(^8sgk0x4WSUvKh@}kPcJ_@(a%e z2ly(LvOK+wX=XU>%30;;cm4&YE~h~=gn$WSmwe+PO9zX2Jcw~;^8u0vx4>1h{r$Cj z#0vhG=YGmW0JyWjWDn`ZYi043F~>*6i066x8(f^jR|1}(IDSkt98@q2{3!S*w2O7D zWL}$g7A**(nx{YiOh+a+0*2@_z)uAIumfTPSn-%TcI{$8(r9X6fUL5ls90dwT`D&4 zswBpVFII7c7N_xaRPcb2(XGv6lgPlC(?&Btjrd)8S1jr)Ip@->qKt22Lg3ETj>@m#=> zf7~!^0cqG5ZELxO-;F`dPA>zIy5cp>R>JUP`X2ptUCmyvYFiA|CE5fOAMg5Q<=Z?T z2EzKcQDjAVNt1p5@v}^FAG%ObwprW9h61QKF)>vvKluT@7E}qgl;Ny$Fl{~sV?ed4 z=~dNjY$~}zor}TIFkco$f3vMro3~iW`g+fpYcJbFWGp@ceb<=r|vCnj6fcv$xne|z}}h(A3In&23l%$6nOS@bvg4oH69G; zQ%&0&dZd@X7&k?f7Z!`cI3V&+5_;g^pWCPVP!-7!$*zdXWMe+jz_F!0r3D)KVV z@R#zQfaA2tJifGK&%Bn#n+r}d&H|PbFg(Utl?~zanCk>sDd@8wY=hT>4y}uzs0%=2 zzY*Me5t3(K;482HOsshf$r`(q26wtq@L!Mr&hfbVBT}2`kyvfoiJc4xVV$UK)Fz?) z^~ux9*ZaG5%K0!))_?d<5bQDsyaeF7&<)Pl0OOY*?Gz3Cux{p$k3%Ml<>ITfiQezV zPzz#92iFVe2LU(h0M-5eWijkStbo`mB0x;M5fHF`oW2+x@9gQ^{EzSb{G{~{pk<}A ziH=t*^6C3;5Cfof>u+}qr>hq1(!=Kfwb&l&s;ZL>=z5SfmuFNu)$g+B9{rfXm4zT6 z;R5*`Suk1#i;3|DHkmg7y{93<`cGT5p?MrCJB@~-d8liArp%2F0ydjP8Ui7MQU}(1 znL=zAU&X#=>KcaXPk%FPpZ+=p+z$k#IktDZ@Egr5hVBd|_MLxz)!itQbcoL;-`)%Q z+iOoVbj6@09z&J&2K#NBt+hcgyg-Qv@bYa2%=FQ{V%gIsvU5W}dno3(6flv?o@zdE z@%!2$O}V29z?upwa%cXvgM8M&K79a81r{2x5o}1}IoUKW{jd+5{oM57W8k`KFcnoZ z)NvjY7|@9XXKRn82d+LC=L=Dt3ue1i?o&tiIi}HRd{j`!mlcYB<&h=_6>uh)`gy60 z>9H*-3eXW< z-2C0|unvJC5bwaP_co`-FW+Zdwn~@M03?CffC5XvS`Pm6yWe$zq9#v56?8x_TCC(C z1`FuorYdhfe{-U3(+y*WMT05{dNQ14TOHx28;MOE>#XC4dK1LNisg<43|g(|)$oP+SKw%?tW=PlD5zod(n1I^^{yb?M1GxP2cO zlQ11rxot8+9Q_+FZ|H)fzbcB+1So~w&#gp_AOOZx9e(t)pI~6*J^;^8=S}(>RiCo{ zB9Qw5Je~?TG*#@%H?gqzgB-)bTz8AujXrv2Xr}d}({@ZQ!OeTJyP!G9NFNblgvK!S zG$<29q9dIbx{@iTFkN$jE@9Ag;lV-})UiBtNiqwrB4zz^7z_i=``}D;euWq)Kow8e zomPw%x!7j!+H;xKzr5tZ;CA|?W<>K0{i9%1+yZsJBV|6&npm^I`7>b589}`2Gi$*Z z=ZBY_tiN$DG$RW`&oBsB_!DKK)04KKk6#BnWfUVf0}|rF%95`=yATn#!XKb`EWi(x zd}V&&{7!zwk#kFRLCR)T10r*isY1F zBLi|vbnCAtB1U9j*z{zOfiR!9Ut^f_9Ld9d^Y~6PC}M0M9LNVHF$`_ze_LA3=|$EK z5P9zPl8v-6UPjO}0e2*?$>2H*E8v$4<{D7v&Y%J2RImbi3~=^jB?H!fTc-}m zq|Te>QRlo@=z>UQ3*#6FV%O5JcvLyCr~nzEUi^-%xN#4I0dQ|W5c|nWZY)0(8r+P& zqTlvUJYm=qW9)8~wvw+FOnU?sLre4x(@dh6=6PT?osFtkenKZqyzd++0^~UpykOg_ z+=($j2MX-c_k0*yCKkYK_jKsxKETmVOh~^Ov9U7>3>jI4AO0v}f(|O88|}!JWHOr$ z74#Sx=^19s|33EYqlGO{dJT3m>5&v$PX_@EF~F*ys$tld+uB(0BQ9V-V>*~BA3wG- zYvml+@UZ$iyGWI=d_9ZaxnQCJLJ+5EV~lZ95Dn*_F$J>mEYkw=(rGD2 zBO=rjaxxpNC7qu}AX|B~e*5af|M9PH?9knepPfpm^g0aa8lczVgL`>^FMjg?BcCVM z74=uaX6&CFg&!9oX$v?TE2DB{Y^fJ#aftFtygl#ME3XGK6Pnu9m?`PG%3KdXz)b zQ?m@+SHTypveit2-g*2>3+i{5YWP2Jpof4telKqOA37*?!DjGFg#l}&6U6)cMX E3vX#zv;Y7A literal 0 HcmV?d00001 diff --git a/apps/roi-cacl-2-admin/public/manifest.json b/apps/roi-cacl-2-admin/public/manifest.json new file mode 100644 index 0000000..5778bc8 --- /dev/null +++ b/apps/roi-cacl-2-admin/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "ROICacl-2", + "name": "ROICacl-2", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} \ No newline at end of file diff --git a/apps/roi-cacl-2-admin/public/robots.txt b/apps/roi-cacl-2-admin/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/apps/roi-cacl-2-admin/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/apps/roi-cacl-2-admin/src/App.scss b/apps/roi-cacl-2-admin/src/App.scss new file mode 100644 index 0000000..4c1cbb0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/App.scss @@ -0,0 +1,59 @@ +// .App { +// .MuiAppBar-colorSecondary { +// background-color: black; + +// .RaAppBar-menuButton-13 { +// background-color: yellow; +// } +// } + +// .MuiDrawer-paper { +// background-color: red; + +// .MuiListItemIcon-root { +// color: white; +// } +// } + +// .MuiButton-textPrimary { +// background-color: purple; +// margin: 0 0.5rem; +// color: white; +// padding: 0.5rem 1rem; + +// &:hover { +// background-color: blue; +// } +// } + +// .MuiTableRow-head { +// .MuiTableCell-head { +// background-color: black; +// color: white; +// } + +// .MuiTableSortLabel-root { +// &:hover { +// color: red; + +// .MuiTableSortLabel-icon { +// color: red !important; +// } +// } +// .MuiTableSortLabel-icon { +// color: white !important; +// } +// } +// .MuiTableSortLabel-active { +// color: green; + +// .MuiTableSortLabel-icon { +// color: green !important; +// } +// } +// } + +// .MuiFormLabel-root { +// color: magenta; +// } +// } diff --git a/apps/roi-cacl-2-admin/src/App.tsx b/apps/roi-cacl-2-admin/src/App.tsx new file mode 100644 index 0000000..0be6642 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/App.tsx @@ -0,0 +1,369 @@ +import React, { useEffect, useState } from "react"; +import { Admin, DataProvider, Resource } from "react-admin"; +import buildGraphQLProvider from "./data-provider/graphqlDataProvider"; +import { theme } from "./theme/theme"; +import Login from "./Login"; +import "./App.scss"; +import Dashboard from "./pages/Dashboard"; +import { EventTypeList } from "./eventType/EventTypeList"; +import { EventTypeCreate } from "./eventType/EventTypeCreate"; +import { EventTypeEdit } from "./eventType/EventTypeEdit"; +import { EventTypeShow } from "./eventType/EventTypeShow"; +import { CredentialList } from "./credential/CredentialList"; +import { CredentialCreate } from "./credential/CredentialCreate"; +import { CredentialEdit } from "./credential/CredentialEdit"; +import { CredentialShow } from "./credential/CredentialShow"; +import { DestinationCalendarList } from "./destinationCalendar/DestinationCalendarList"; +import { DestinationCalendarCreate } from "./destinationCalendar/DestinationCalendarCreate"; +import { DestinationCalendarEdit } from "./destinationCalendar/DestinationCalendarEdit"; +import { DestinationCalendarShow } from "./destinationCalendar/DestinationCalendarShow"; +import { UserList } from "./user/UserList"; +import { UserCreate } from "./user/UserCreate"; +import { UserEdit } from "./user/UserEdit"; +import { UserShow } from "./user/UserShow"; +import { TeamList } from "./team/TeamList"; +import { TeamCreate } from "./team/TeamCreate"; +import { TeamEdit } from "./team/TeamEdit"; +import { TeamShow } from "./team/TeamShow"; +import { MembershipList } from "./membership/MembershipList"; +import { MembershipCreate } from "./membership/MembershipCreate"; +import { MembershipEdit } from "./membership/MembershipEdit"; +import { MembershipShow } from "./membership/MembershipShow"; +import { VerificationTokenList } from "./verificationToken/VerificationTokenList"; +import { VerificationTokenCreate } from "./verificationToken/VerificationTokenCreate"; +import { VerificationTokenEdit } from "./verificationToken/VerificationTokenEdit"; +import { VerificationTokenShow } from "./verificationToken/VerificationTokenShow"; +import { BookingReferenceList } from "./bookingReference/BookingReferenceList"; +import { BookingReferenceCreate } from "./bookingReference/BookingReferenceCreate"; +import { BookingReferenceEdit } from "./bookingReference/BookingReferenceEdit"; +import { BookingReferenceShow } from "./bookingReference/BookingReferenceShow"; +import { AttendeeList } from "./attendee/AttendeeList"; +import { AttendeeCreate } from "./attendee/AttendeeCreate"; +import { AttendeeEdit } from "./attendee/AttendeeEdit"; +import { AttendeeShow } from "./attendee/AttendeeShow"; +import { DailyEventReferenceList } from "./dailyEventReference/DailyEventReferenceList"; +import { DailyEventReferenceCreate } from "./dailyEventReference/DailyEventReferenceCreate"; +import { DailyEventReferenceEdit } from "./dailyEventReference/DailyEventReferenceEdit"; +import { DailyEventReferenceShow } from "./dailyEventReference/DailyEventReferenceShow"; +import { BookingList } from "./booking/BookingList"; +import { BookingCreate } from "./booking/BookingCreate"; +import { BookingEdit } from "./booking/BookingEdit"; +import { BookingShow } from "./booking/BookingShow"; +import { ScheduleList } from "./schedule/ScheduleList"; +import { ScheduleCreate } from "./schedule/ScheduleCreate"; +import { ScheduleEdit } from "./schedule/ScheduleEdit"; +import { ScheduleShow } from "./schedule/ScheduleShow"; +import { AvailabilityList } from "./availability/AvailabilityList"; +import { AvailabilityCreate } from "./availability/AvailabilityCreate"; +import { AvailabilityEdit } from "./availability/AvailabilityEdit"; +import { AvailabilityShow } from "./availability/AvailabilityShow"; +import { SelectedCalendarList } from "./selectedCalendar/SelectedCalendarList"; +import { SelectedCalendarCreate } from "./selectedCalendar/SelectedCalendarCreate"; +import { SelectedCalendarEdit } from "./selectedCalendar/SelectedCalendarEdit"; +import { SelectedCalendarShow } from "./selectedCalendar/SelectedCalendarShow"; +import { EventTypeCustomInputList } from "./eventTypeCustomInput/EventTypeCustomInputList"; +import { EventTypeCustomInputCreate } from "./eventTypeCustomInput/EventTypeCustomInputCreate"; +import { EventTypeCustomInputEdit } from "./eventTypeCustomInput/EventTypeCustomInputEdit"; +import { EventTypeCustomInputShow } from "./eventTypeCustomInput/EventTypeCustomInputShow"; +import { ResetPasswordRequestList } from "./resetPasswordRequest/ResetPasswordRequestList"; +import { ResetPasswordRequestCreate } from "./resetPasswordRequest/ResetPasswordRequestCreate"; +import { ResetPasswordRequestEdit } from "./resetPasswordRequest/ResetPasswordRequestEdit"; +import { ResetPasswordRequestShow } from "./resetPasswordRequest/ResetPasswordRequestShow"; +import { ReminderMailList } from "./reminderMail/ReminderMailList"; +import { ReminderMailCreate } from "./reminderMail/ReminderMailCreate"; +import { ReminderMailEdit } from "./reminderMail/ReminderMailEdit"; +import { ReminderMailShow } from "./reminderMail/ReminderMailShow"; +import { PaymentList } from "./payment/PaymentList"; +import { PaymentCreate } from "./payment/PaymentCreate"; +import { PaymentEdit } from "./payment/PaymentEdit"; +import { PaymentShow } from "./payment/PaymentShow"; +import { WebhookList } from "./webhook/WebhookList"; +import { WebhookCreate } from "./webhook/WebhookCreate"; +import { WebhookEdit } from "./webhook/WebhookEdit"; +import { WebhookShow } from "./webhook/WebhookShow"; +import { ImpersonationList } from "./impersonation/ImpersonationList"; +import { ImpersonationCreate } from "./impersonation/ImpersonationCreate"; +import { ImpersonationEdit } from "./impersonation/ImpersonationEdit"; +import { ImpersonationShow } from "./impersonation/ImpersonationShow"; +import { ApiKeyList } from "./apiKey/ApiKeyList"; +import { ApiKeyCreate } from "./apiKey/ApiKeyCreate"; +import { ApiKeyEdit } from "./apiKey/ApiKeyEdit"; +import { ApiKeyShow } from "./apiKey/ApiKeyShow"; +import { HashedLinkList } from "./hashedLink/HashedLinkList"; +import { HashedLinkCreate } from "./hashedLink/HashedLinkCreate"; +import { HashedLinkEdit } from "./hashedLink/HashedLinkEdit"; +import { HashedLinkShow } from "./hashedLink/HashedLinkShow"; +import { AccountList } from "./account/AccountList"; +import { AccountCreate } from "./account/AccountCreate"; +import { AccountEdit } from "./account/AccountEdit"; +import { AccountShow } from "./account/AccountShow"; +import { SessionList } from "./session/SessionList"; +import { SessionCreate } from "./session/SessionCreate"; +import { SessionEdit } from "./session/SessionEdit"; +import { SessionShow } from "./session/SessionShow"; +import { AppModelList } from "./appModel/AppModelList"; +import { AppModelCreate } from "./appModel/AppModelCreate"; +import { AppModelEdit } from "./appModel/AppModelEdit"; +import { AppModelShow } from "./appModel/AppModelShow"; +import { FeedbackList } from "./feedback/FeedbackList"; +import { FeedbackCreate } from "./feedback/FeedbackCreate"; +import { FeedbackEdit } from "./feedback/FeedbackEdit"; +import { FeedbackShow } from "./feedback/FeedbackShow"; +import { WorkflowStepList } from "./workflowStep/WorkflowStepList"; +import { WorkflowStepCreate } from "./workflowStep/WorkflowStepCreate"; +import { WorkflowStepEdit } from "./workflowStep/WorkflowStepEdit"; +import { WorkflowStepShow } from "./workflowStep/WorkflowStepShow"; +import { WorkflowList } from "./workflow/WorkflowList"; +import { WorkflowCreate } from "./workflow/WorkflowCreate"; +import { WorkflowEdit } from "./workflow/WorkflowEdit"; +import { WorkflowShow } from "./workflow/WorkflowShow"; +import { WorkflowsOnEventTypeList } from "./workflowsOnEventType/WorkflowsOnEventTypeList"; +import { WorkflowsOnEventTypeCreate } from "./workflowsOnEventType/WorkflowsOnEventTypeCreate"; +import { WorkflowsOnEventTypeEdit } from "./workflowsOnEventType/WorkflowsOnEventTypeEdit"; +import { WorkflowsOnEventTypeShow } from "./workflowsOnEventType/WorkflowsOnEventTypeShow"; +import { WorkflowReminderList } from "./workflowReminder/WorkflowReminderList"; +import { WorkflowReminderCreate } from "./workflowReminder/WorkflowReminderCreate"; +import { WorkflowReminderEdit } from "./workflowReminder/WorkflowReminderEdit"; +import { WorkflowReminderShow } from "./workflowReminder/WorkflowReminderShow"; +import { jwtAuthProvider } from "./auth-provider/ra-auth-jwt"; + +const App = (): React.ReactElement => { + const [dataProvider, setDataProvider] = useState(null); + useEffect(() => { + buildGraphQLProvider + .then((provider: any) => { + setDataProvider(() => provider); + }) + .catch((error: any) => { + console.log(error); + }); + }, []); + if (!dataProvider) { + return
Loading
; + } + return ( +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ); +}; + +export default App; diff --git a/apps/roi-cacl-2-admin/src/Components/Pagination.tsx b/apps/roi-cacl-2-admin/src/Components/Pagination.tsx new file mode 100644 index 0000000..2de2ebf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/Components/Pagination.tsx @@ -0,0 +1,10 @@ +import React from "react"; +import { Pagination as RAPagination, PaginationProps } from "react-admin"; + +const PAGINATION_OPTIONS = [10, 25, 50, 100, 200]; + +const Pagination = (props: PaginationProps) => ( + +); + +export default Pagination; diff --git a/apps/roi-cacl-2-admin/src/Login.tsx b/apps/roi-cacl-2-admin/src/Login.tsx new file mode 100644 index 0000000..f7ec8ed --- /dev/null +++ b/apps/roi-cacl-2-admin/src/Login.tsx @@ -0,0 +1,117 @@ +import * as React from "react"; +import { useState } from "react"; +import { useLogin, useNotify, Notification, defaultTheme } from "react-admin"; +import { ThemeProvider } from "@material-ui/styles"; +import { createTheme } from "@material-ui/core/styles"; +import { Button } from "@material-ui/core"; +import "./login.scss"; + +const CLASS_NAME = "login-page"; + +const Login = ({ theme }: any) => { + const [username, setUsername] = useState(""); + const [password, setPassword] = useState(""); + const login = useLogin(); + const notify = useNotify(); + const BASE_URI = process.env.REACT_APP_SERVER_URL; + const submit = (e: any) => { + e.preventDefault(); + login({ username, password }).catch(() => + notify("Invalid username or password") + ); + }; + + return ( + +
+
+
+ GraphQL API +

Connect via GraphQL

+
+ Connect to the server using GraphQL API with a complete and + understandable description of the data in your API +
+ +
+
+ React-Admin +

Admin UI

+
+ Sign in to a React-Admin client with ready-made forms for creating + and editing all the data models of your application +
+
+ + + +
+
+
+ REST API +

Connect via REST API

+
+ Connect to the server using REST API with a built-in Swagger + documentation +
+ +
+ + +
+
+ Read + + Amplication docs + + to learn more +
+
+
+ ); +}; + +export default Login; diff --git a/apps/roi-cacl-2-admin/src/account/AccountCreate.tsx b/apps/roi-cacl-2-admin/src/account/AccountCreate.tsx new file mode 100644 index 0000000..9818a9d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/account/AccountCreate.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + NumberInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; + +export const AccountCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/account/AccountEdit.tsx b/apps/roi-cacl-2-admin/src/account/AccountEdit.tsx new file mode 100644 index 0000000..e2eb8a6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/account/AccountEdit.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + NumberInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; + +export const AccountEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/account/AccountList.tsx b/apps/roi-cacl-2-admin/src/account/AccountList.tsx new file mode 100644 index 0000000..778cf5e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/account/AccountList.tsx @@ -0,0 +1,39 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const AccountList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/account/AccountShow.tsx b/apps/roi-cacl-2-admin/src/account/AccountShow.tsx new file mode 100644 index 0000000..bb70897 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/account/AccountShow.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const AccountShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/account/AccountTitle.ts b/apps/roi-cacl-2-admin/src/account/AccountTitle.ts new file mode 100644 index 0000000..c6fefdd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/account/AccountTitle.ts @@ -0,0 +1,7 @@ +import { Account as TAccount } from "../api/account/Account"; + +export const ACCOUNT_TITLE_FIELD = "typeField"; + +export const AccountTitle = (record: TAccount): string => { + return record.typeField?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/Account.ts b/apps/roi-cacl-2-admin/src/api/account/Account.ts new file mode 100644 index 0000000..427a4bd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/Account.ts @@ -0,0 +1,16 @@ +import { User } from "../user/User"; + +export type Account = { + id: string; + typeField: string; + provider: string; + providerAccountId: string; + refreshToken: string | null; + accessToken: string | null; + expiresAt: number | null; + tokenType: string | null; + scope: string | null; + idToken: string | null; + sessionState: string | null; + user?: User | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountCountArgs.ts b/apps/roi-cacl-2-admin/src/api/account/AccountCountArgs.ts new file mode 100644 index 0000000..0120da7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountCountArgs.ts @@ -0,0 +1,5 @@ +import { AccountWhereInput } from "./AccountWhereInput"; + +export type AccountCountArgs = { + where?: AccountWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountCreateInput.ts b/apps/roi-cacl-2-admin/src/api/account/AccountCreateInput.ts new file mode 100644 index 0000000..6248d28 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountCreateInput.ts @@ -0,0 +1,15 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type AccountCreateInput = { + typeField: string; + provider: string; + providerAccountId: string; + refreshToken?: string | null; + accessToken?: string | null; + expiresAt?: number | null; + tokenType?: string | null; + scope?: string | null; + idToken?: string | null; + sessionState?: string | null; + user?: UserWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/account/AccountFindManyArgs.ts new file mode 100644 index 0000000..5f09b6d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountFindManyArgs.ts @@ -0,0 +1,9 @@ +import { AccountWhereInput } from "./AccountWhereInput"; +import { AccountOrderByInput } from "./AccountOrderByInput"; + +export type AccountFindManyArgs = { + where?: AccountWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/account/AccountFindUniqueArgs.ts new file mode 100644 index 0000000..5c0366e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { AccountWhereUniqueInput } from "./AccountWhereUniqueInput"; + +export type AccountFindUniqueArgs = { + where: AccountWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/account/AccountListRelationFilter.ts new file mode 100644 index 0000000..af6de77 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountListRelationFilter.ts @@ -0,0 +1,7 @@ +import { AccountWhereInput } from "./AccountWhereInput"; + +export type AccountListRelationFilter = { + every?: AccountWhereInput; + some?: AccountWhereInput; + none?: AccountWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/account/AccountOrderByInput.ts new file mode 100644 index 0000000..c6b2fcf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountOrderByInput.ts @@ -0,0 +1,16 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type AccountOrderByInput = { + id?: SortOrder; + typeField?: SortOrder; + provider?: SortOrder; + providerAccountId?: SortOrder; + refreshToken?: SortOrder; + accessToken?: SortOrder; + expiresAt?: SortOrder; + tokenType?: SortOrder; + scope?: SortOrder; + idToken?: SortOrder; + sessionState?: SortOrder; + userId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/account/AccountUpdateInput.ts new file mode 100644 index 0000000..1cb0263 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountUpdateInput.ts @@ -0,0 +1,15 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type AccountUpdateInput = { + typeField?: string; + provider?: string; + providerAccountId?: string; + refreshToken?: string | null; + accessToken?: string | null; + expiresAt?: number | null; + tokenType?: string | null; + scope?: string | null; + idToken?: string | null; + sessionState?: string | null; + user?: UserWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountWhereInput.ts b/apps/roi-cacl-2-admin/src/api/account/AccountWhereInput.ts new file mode 100644 index 0000000..47c717e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountWhereInput.ts @@ -0,0 +1,19 @@ +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type AccountWhereInput = { + id?: StringFilter; + typeField?: StringFilter; + provider?: StringFilter; + providerAccountId?: StringFilter; + refreshToken?: StringNullableFilter; + accessToken?: StringNullableFilter; + expiresAt?: IntNullableFilter; + tokenType?: StringNullableFilter; + scope?: StringNullableFilter; + idToken?: StringNullableFilter; + sessionState?: StringNullableFilter; + user?: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/AccountWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/account/AccountWhereUniqueInput.ts new file mode 100644 index 0000000..db983cb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/AccountWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type AccountWhereUniqueInput = { + id: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/CreateAccountArgs.ts b/apps/roi-cacl-2-admin/src/api/account/CreateAccountArgs.ts new file mode 100644 index 0000000..fc80c84 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/CreateAccountArgs.ts @@ -0,0 +1,5 @@ +import { AccountCreateInput } from "./AccountCreateInput"; + +export type CreateAccountArgs = { + data: AccountCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/DeleteAccountArgs.ts b/apps/roi-cacl-2-admin/src/api/account/DeleteAccountArgs.ts new file mode 100644 index 0000000..8b17e0c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/DeleteAccountArgs.ts @@ -0,0 +1,5 @@ +import { AccountWhereUniqueInput } from "./AccountWhereUniqueInput"; + +export type DeleteAccountArgs = { + where: AccountWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/account/UpdateAccountArgs.ts b/apps/roi-cacl-2-admin/src/api/account/UpdateAccountArgs.ts new file mode 100644 index 0000000..fcf2420 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/account/UpdateAccountArgs.ts @@ -0,0 +1,7 @@ +import { AccountWhereUniqueInput } from "./AccountWhereUniqueInput"; +import { AccountUpdateInput } from "./AccountUpdateInput"; + +export type UpdateAccountArgs = { + where: AccountWhereUniqueInput; + data: AccountUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKey.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKey.ts new file mode 100644 index 0000000..1bcf8a5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKey.ts @@ -0,0 +1,13 @@ +import { User } from "../user/User"; +import { AppModel } from "../appModel/AppModel"; + +export type ApiKey = { + id: string; + note: string | null; + createdAt: Date; + expiresAt: Date | null; + lastUsedAt: Date | null; + hashedKey: string; + user?: User | null; + appField?: AppModel | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCountArgs.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCountArgs.ts new file mode 100644 index 0000000..1735180 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCountArgs.ts @@ -0,0 +1,5 @@ +import { ApiKeyWhereInput } from "./ApiKeyWhereInput"; + +export type ApiKeyCountArgs = { + where?: ApiKeyWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCreateInput.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCreateInput.ts new file mode 100644 index 0000000..7f31f38 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyCreateInput.ts @@ -0,0 +1,11 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; + +export type ApiKeyCreateInput = { + note?: string | null; + expiresAt?: Date | null; + lastUsedAt?: Date | null; + hashedKey: string; + user?: UserWhereUniqueInput | null; + appField?: AppModelWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindManyArgs.ts new file mode 100644 index 0000000..2f192f6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindManyArgs.ts @@ -0,0 +1,9 @@ +import { ApiKeyWhereInput } from "./ApiKeyWhereInput"; +import { ApiKeyOrderByInput } from "./ApiKeyOrderByInput"; + +export type ApiKeyFindManyArgs = { + where?: ApiKeyWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindUniqueArgs.ts new file mode 100644 index 0000000..92f3e46 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { ApiKeyWhereUniqueInput } from "./ApiKeyWhereUniqueInput"; + +export type ApiKeyFindUniqueArgs = { + where: ApiKeyWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyListRelationFilter.ts new file mode 100644 index 0000000..7985497 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyListRelationFilter.ts @@ -0,0 +1,7 @@ +import { ApiKeyWhereInput } from "./ApiKeyWhereInput"; + +export type ApiKeyListRelationFilter = { + every?: ApiKeyWhereInput; + some?: ApiKeyWhereInput; + none?: ApiKeyWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyOrderByInput.ts new file mode 100644 index 0000000..ca1f2d0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyOrderByInput.ts @@ -0,0 +1,12 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type ApiKeyOrderByInput = { + id?: SortOrder; + note?: SortOrder; + createdAt?: SortOrder; + expiresAt?: SortOrder; + lastUsedAt?: SortOrder; + hashedKey?: SortOrder; + userId?: SortOrder; + appId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyUpdateInput.ts new file mode 100644 index 0000000..34204e2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyUpdateInput.ts @@ -0,0 +1,11 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; + +export type ApiKeyUpdateInput = { + note?: string | null; + expiresAt?: Date | null; + lastUsedAt?: Date | null; + hashedKey?: string; + user?: UserWhereUniqueInput | null; + appField?: AppModelWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereInput.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereInput.ts new file mode 100644 index 0000000..b3ced3f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereInput.ts @@ -0,0 +1,17 @@ +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; + +export type ApiKeyWhereInput = { + id?: StringFilter; + note?: StringNullableFilter; + createdAt?: DateTimeFilter; + expiresAt?: DateTimeNullableFilter; + lastUsedAt?: DateTimeNullableFilter; + hashedKey?: StringFilter; + user?: UserWhereUniqueInput; + appField?: AppModelWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereUniqueInput.ts new file mode 100644 index 0000000..154fd1d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/ApiKeyWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type ApiKeyWhereUniqueInput = { + id: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/CreateApiKeyArgs.ts b/apps/roi-cacl-2-admin/src/api/apiKey/CreateApiKeyArgs.ts new file mode 100644 index 0000000..6ef6562 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/CreateApiKeyArgs.ts @@ -0,0 +1,5 @@ +import { ApiKeyCreateInput } from "./ApiKeyCreateInput"; + +export type CreateApiKeyArgs = { + data: ApiKeyCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/DeleteApiKeyArgs.ts b/apps/roi-cacl-2-admin/src/api/apiKey/DeleteApiKeyArgs.ts new file mode 100644 index 0000000..ff7ec80 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/DeleteApiKeyArgs.ts @@ -0,0 +1,5 @@ +import { ApiKeyWhereUniqueInput } from "./ApiKeyWhereUniqueInput"; + +export type DeleteApiKeyArgs = { + where: ApiKeyWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/apiKey/UpdateApiKeyArgs.ts b/apps/roi-cacl-2-admin/src/api/apiKey/UpdateApiKeyArgs.ts new file mode 100644 index 0000000..e86b47c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/apiKey/UpdateApiKeyArgs.ts @@ -0,0 +1,7 @@ +import { ApiKeyWhereUniqueInput } from "./ApiKeyWhereUniqueInput"; +import { ApiKeyUpdateInput } from "./ApiKeyUpdateInput"; + +export type UpdateApiKeyArgs = { + where: ApiKeyWhereUniqueInput; + data: ApiKeyUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/ApiKeyCreateNestedManyWithoutAppModelsInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/ApiKeyCreateNestedManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..6873cd7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/ApiKeyCreateNestedManyWithoutAppModelsInput.ts @@ -0,0 +1,5 @@ +import { ApiKeyWhereUniqueInput } from "../apiKey/ApiKeyWhereUniqueInput"; + +export type ApiKeyCreateNestedManyWithoutAppModelsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/ApiKeyUpdateManyWithoutAppModelsInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/ApiKeyUpdateManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..f28c67f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/ApiKeyUpdateManyWithoutAppModelsInput.ts @@ -0,0 +1,7 @@ +import { ApiKeyWhereUniqueInput } from "../apiKey/ApiKeyWhereUniqueInput"; + +export type ApiKeyUpdateManyWithoutAppModelsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModel.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModel.ts new file mode 100644 index 0000000..4825153 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModel.ts @@ -0,0 +1,18 @@ +import { JsonValue } from "type-fest"; +import { Credential } from "../credential/Credential"; +import { Webhook } from "../webhook/Webhook"; +import { ApiKey } from "../apiKey/ApiKey"; + +export type AppModel = { + id: string; + dirName: string; + keys: JsonValue; + categories?: Array< + "calendar" | "messaging" | "other" | "payment" | "video" | "web3" + >; + createdAt: Date; + updatedAt: Date; + credentials?: Array; + webhook?: Array; + apiKey?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelCountArgs.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelCountArgs.ts new file mode 100644 index 0000000..0758c1e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelCountArgs.ts @@ -0,0 +1,5 @@ +import { AppModelWhereInput } from "./AppModelWhereInput"; + +export type AppModelCountArgs = { + where?: AppModelWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelCreateInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelCreateInput.ts new file mode 100644 index 0000000..2fadef1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelCreateInput.ts @@ -0,0 +1,15 @@ +import { InputJsonValue } from "../../types"; +import { CredentialCreateNestedManyWithoutAppModelsInput } from "./CredentialCreateNestedManyWithoutAppModelsInput"; +import { WebhookCreateNestedManyWithoutAppModelsInput } from "./WebhookCreateNestedManyWithoutAppModelsInput"; +import { ApiKeyCreateNestedManyWithoutAppModelsInput } from "./ApiKeyCreateNestedManyWithoutAppModelsInput"; + +export type AppModelCreateInput = { + dirName: string; + keys?: InputJsonValue; + categories?: Array< + "calendar" | "messaging" | "other" | "payment" | "video" | "web3" + >; + credentials?: CredentialCreateNestedManyWithoutAppModelsInput; + webhook?: WebhookCreateNestedManyWithoutAppModelsInput; + apiKey?: ApiKeyCreateNestedManyWithoutAppModelsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelFindManyArgs.ts new file mode 100644 index 0000000..afe3c47 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelFindManyArgs.ts @@ -0,0 +1,9 @@ +import { AppModelWhereInput } from "./AppModelWhereInput"; +import { AppModelOrderByInput } from "./AppModelOrderByInput"; + +export type AppModelFindManyArgs = { + where?: AppModelWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelFindUniqueArgs.ts new file mode 100644 index 0000000..6df2222 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { AppModelWhereUniqueInput } from "./AppModelWhereUniqueInput"; + +export type AppModelFindUniqueArgs = { + where: AppModelWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelListRelationFilter.ts new file mode 100644 index 0000000..fa395f5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelListRelationFilter.ts @@ -0,0 +1,7 @@ +import { AppModelWhereInput } from "./AppModelWhereInput"; + +export type AppModelListRelationFilter = { + every?: AppModelWhereInput; + some?: AppModelWhereInput; + none?: AppModelWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelOrderByInput.ts new file mode 100644 index 0000000..c5002c4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelOrderByInput.ts @@ -0,0 +1,10 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type AppModelOrderByInput = { + id?: SortOrder; + dirName?: SortOrder; + keys?: SortOrder; + categories?: SortOrder; + createdAt?: SortOrder; + updatedAt?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelUpdateInput.ts new file mode 100644 index 0000000..7217c55 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelUpdateInput.ts @@ -0,0 +1,15 @@ +import { InputJsonValue } from "../../types"; +import { CredentialUpdateManyWithoutAppModelsInput } from "./CredentialUpdateManyWithoutAppModelsInput"; +import { WebhookUpdateManyWithoutAppModelsInput } from "./WebhookUpdateManyWithoutAppModelsInput"; +import { ApiKeyUpdateManyWithoutAppModelsInput } from "./ApiKeyUpdateManyWithoutAppModelsInput"; + +export type AppModelUpdateInput = { + dirName?: string; + keys?: InputJsonValue; + categories?: Array< + "calendar" | "messaging" | "other" | "payment" | "video" | "web3" + >; + credentials?: CredentialUpdateManyWithoutAppModelsInput; + webhook?: WebhookUpdateManyWithoutAppModelsInput; + apiKey?: ApiKeyUpdateManyWithoutAppModelsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereInput.ts new file mode 100644 index 0000000..37013c1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereInput.ts @@ -0,0 +1,17 @@ +import { StringFilter } from "../../util/StringFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { CredentialListRelationFilter } from "../credential/CredentialListRelationFilter"; +import { WebhookListRelationFilter } from "../webhook/WebhookListRelationFilter"; +import { ApiKeyListRelationFilter } from "../apiKey/ApiKeyListRelationFilter"; + +export type AppModelWhereInput = { + id?: StringFilter; + dirName?: StringFilter; + keys?: JsonFilter; + createdAt?: DateTimeFilter; + updatedAt?: DateTimeFilter; + credentials?: CredentialListRelationFilter; + webhook?: WebhookListRelationFilter; + apiKey?: ApiKeyListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereUniqueInput.ts new file mode 100644 index 0000000..ee9ea81 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/AppModelWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type AppModelWhereUniqueInput = { + id: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/CreateAppModelArgs.ts b/apps/roi-cacl-2-admin/src/api/appModel/CreateAppModelArgs.ts new file mode 100644 index 0000000..92aa9e9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/CreateAppModelArgs.ts @@ -0,0 +1,5 @@ +import { AppModelCreateInput } from "./AppModelCreateInput"; + +export type CreateAppModelArgs = { + data: AppModelCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/CredentialCreateNestedManyWithoutAppModelsInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/CredentialCreateNestedManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..2fd6763 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/CredentialCreateNestedManyWithoutAppModelsInput.ts @@ -0,0 +1,5 @@ +import { CredentialWhereUniqueInput } from "../credential/CredentialWhereUniqueInput"; + +export type CredentialCreateNestedManyWithoutAppModelsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/CredentialUpdateManyWithoutAppModelsInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/CredentialUpdateManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..5afc23a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/CredentialUpdateManyWithoutAppModelsInput.ts @@ -0,0 +1,7 @@ +import { CredentialWhereUniqueInput } from "../credential/CredentialWhereUniqueInput"; + +export type CredentialUpdateManyWithoutAppModelsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/DeleteAppModelArgs.ts b/apps/roi-cacl-2-admin/src/api/appModel/DeleteAppModelArgs.ts new file mode 100644 index 0000000..46ab2f4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/DeleteAppModelArgs.ts @@ -0,0 +1,5 @@ +import { AppModelWhereUniqueInput } from "./AppModelWhereUniqueInput"; + +export type DeleteAppModelArgs = { + where: AppModelWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/EnumAppModelCategories.ts b/apps/roi-cacl-2-admin/src/api/appModel/EnumAppModelCategories.ts new file mode 100644 index 0000000..b4eebee --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/EnumAppModelCategories.ts @@ -0,0 +1,10 @@ +import { Payment } from "../payment/Payment"; + +export enum EnumAppModelCategories { + Calendar = "calendar", + Messaging = "messaging", + Other = "other", + Payment = "payment", + Video = "video", + Web3 = "web3", +} diff --git a/apps/roi-cacl-2-admin/src/api/appModel/UpdateAppModelArgs.ts b/apps/roi-cacl-2-admin/src/api/appModel/UpdateAppModelArgs.ts new file mode 100644 index 0000000..6b24c23 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/UpdateAppModelArgs.ts @@ -0,0 +1,7 @@ +import { AppModelWhereUniqueInput } from "./AppModelWhereUniqueInput"; +import { AppModelUpdateInput } from "./AppModelUpdateInput"; + +export type UpdateAppModelArgs = { + where: AppModelWhereUniqueInput; + data: AppModelUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/WebhookCreateNestedManyWithoutAppModelsInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/WebhookCreateNestedManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..62b6da3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/WebhookCreateNestedManyWithoutAppModelsInput.ts @@ -0,0 +1,5 @@ +import { WebhookWhereUniqueInput } from "../webhook/WebhookWhereUniqueInput"; + +export type WebhookCreateNestedManyWithoutAppModelsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/appModel/WebhookUpdateManyWithoutAppModelsInput.ts b/apps/roi-cacl-2-admin/src/api/appModel/WebhookUpdateManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..2405a93 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/appModel/WebhookUpdateManyWithoutAppModelsInput.ts @@ -0,0 +1,7 @@ +import { WebhookWhereUniqueInput } from "../webhook/WebhookWhereUniqueInput"; + +export type WebhookUpdateManyWithoutAppModelsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/Attendee.ts b/apps/roi-cacl-2-admin/src/api/attendee/Attendee.ts new file mode 100644 index 0000000..367baca --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/Attendee.ts @@ -0,0 +1,10 @@ +import { Booking } from "../booking/Booking"; + +export type Attendee = { + id: number; + email: string; + name: string; + timeZone: string; + locale: string | null; + booking?: Booking | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeCountArgs.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeCountArgs.ts new file mode 100644 index 0000000..681bbe3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeCountArgs.ts @@ -0,0 +1,5 @@ +import { AttendeeWhereInput } from "./AttendeeWhereInput"; + +export type AttendeeCountArgs = { + where?: AttendeeWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeCreateInput.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeCreateInput.ts new file mode 100644 index 0000000..9eb09ce --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeCreateInput.ts @@ -0,0 +1,9 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type AttendeeCreateInput = { + email: string; + name: string; + timeZone: string; + locale?: string | null; + booking?: BookingWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindManyArgs.ts new file mode 100644 index 0000000..c49291b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindManyArgs.ts @@ -0,0 +1,9 @@ +import { AttendeeWhereInput } from "./AttendeeWhereInput"; +import { AttendeeOrderByInput } from "./AttendeeOrderByInput"; + +export type AttendeeFindManyArgs = { + where?: AttendeeWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindUniqueArgs.ts new file mode 100644 index 0000000..1a7bc2f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { AttendeeWhereUniqueInput } from "./AttendeeWhereUniqueInput"; + +export type AttendeeFindUniqueArgs = { + where: AttendeeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeListRelationFilter.ts new file mode 100644 index 0000000..87f61d8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeListRelationFilter.ts @@ -0,0 +1,7 @@ +import { AttendeeWhereInput } from "./AttendeeWhereInput"; + +export type AttendeeListRelationFilter = { + every?: AttendeeWhereInput; + some?: AttendeeWhereInput; + none?: AttendeeWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeOrderByInput.ts new file mode 100644 index 0000000..86443a4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeOrderByInput.ts @@ -0,0 +1,10 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type AttendeeOrderByInput = { + id?: SortOrder; + email?: SortOrder; + name?: SortOrder; + timeZone?: SortOrder; + locale?: SortOrder; + bookingId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeUpdateInput.ts new file mode 100644 index 0000000..8d9cfbf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeUpdateInput.ts @@ -0,0 +1,9 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type AttendeeUpdateInput = { + email?: string; + name?: string; + timeZone?: string; + locale?: string | null; + booking?: BookingWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereInput.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereInput.ts new file mode 100644 index 0000000..284e1c7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereInput.ts @@ -0,0 +1,13 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type AttendeeWhereInput = { + id?: IntFilter; + email?: StringFilter; + name?: StringFilter; + timeZone?: StringFilter; + locale?: StringNullableFilter; + booking?: BookingWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereUniqueInput.ts new file mode 100644 index 0000000..1957955 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/AttendeeWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type AttendeeWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/CreateAttendeeArgs.ts b/apps/roi-cacl-2-admin/src/api/attendee/CreateAttendeeArgs.ts new file mode 100644 index 0000000..be01bd1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/CreateAttendeeArgs.ts @@ -0,0 +1,5 @@ +import { AttendeeCreateInput } from "./AttendeeCreateInput"; + +export type CreateAttendeeArgs = { + data: AttendeeCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/DeleteAttendeeArgs.ts b/apps/roi-cacl-2-admin/src/api/attendee/DeleteAttendeeArgs.ts new file mode 100644 index 0000000..02960b3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/DeleteAttendeeArgs.ts @@ -0,0 +1,5 @@ +import { AttendeeWhereUniqueInput } from "./AttendeeWhereUniqueInput"; + +export type DeleteAttendeeArgs = { + where: AttendeeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/attendee/UpdateAttendeeArgs.ts b/apps/roi-cacl-2-admin/src/api/attendee/UpdateAttendeeArgs.ts new file mode 100644 index 0000000..0b1e699 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/attendee/UpdateAttendeeArgs.ts @@ -0,0 +1,7 @@ +import { AttendeeWhereUniqueInput } from "./AttendeeWhereUniqueInput"; +import { AttendeeUpdateInput } from "./AttendeeUpdateInput"; + +export type UpdateAttendeeArgs = { + where: AttendeeWhereUniqueInput; + data: AttendeeUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/Availability.ts b/apps/roi-cacl-2-admin/src/api/availability/Availability.ts new file mode 100644 index 0000000..ff9c334 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/Availability.ts @@ -0,0 +1,14 @@ +import { User } from "../user/User"; +import { EventType } from "../eventType/EventType"; +import { Schedule } from "../schedule/Schedule"; + +export type Availability = { + id: number; + user?: User | null; + eventType?: EventType | null; + days: number; + startTime: Date; + endTime: Date; + date: Date | null; + schedule?: Schedule | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityCountArgs.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityCountArgs.ts new file mode 100644 index 0000000..a1245f7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityCountArgs.ts @@ -0,0 +1,5 @@ +import { AvailabilityWhereInput } from "./AvailabilityWhereInput"; + +export type AvailabilityCountArgs = { + where?: AvailabilityWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityCreateInput.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityCreateInput.ts new file mode 100644 index 0000000..3e5998e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityCreateInput.ts @@ -0,0 +1,13 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; + +export type AvailabilityCreateInput = { + user?: UserWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + days: number; + startTime: Date; + endTime: Date; + date?: Date | null; + schedule?: ScheduleWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindManyArgs.ts new file mode 100644 index 0000000..eafb9bd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindManyArgs.ts @@ -0,0 +1,9 @@ +import { AvailabilityWhereInput } from "./AvailabilityWhereInput"; +import { AvailabilityOrderByInput } from "./AvailabilityOrderByInput"; + +export type AvailabilityFindManyArgs = { + where?: AvailabilityWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindUniqueArgs.ts new file mode 100644 index 0000000..e9647b0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { AvailabilityWhereUniqueInput } from "./AvailabilityWhereUniqueInput"; + +export type AvailabilityFindUniqueArgs = { + where: AvailabilityWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityListRelationFilter.ts new file mode 100644 index 0000000..09c7b81 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityListRelationFilter.ts @@ -0,0 +1,7 @@ +import { AvailabilityWhereInput } from "./AvailabilityWhereInput"; + +export type AvailabilityListRelationFilter = { + every?: AvailabilityWhereInput; + some?: AvailabilityWhereInput; + none?: AvailabilityWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityOrderByInput.ts new file mode 100644 index 0000000..1d612ab --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityOrderByInput.ts @@ -0,0 +1,12 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type AvailabilityOrderByInput = { + id?: SortOrder; + userId?: SortOrder; + eventTypeId?: SortOrder; + days?: SortOrder; + startTime?: SortOrder; + endTime?: SortOrder; + date?: SortOrder; + scheduleId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityUpdateInput.ts new file mode 100644 index 0000000..3b50bfd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityUpdateInput.ts @@ -0,0 +1,13 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; + +export type AvailabilityUpdateInput = { + user?: UserWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + days?: number; + startTime?: Date; + endTime?: Date; + date?: Date | null; + schedule?: ScheduleWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereInput.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereInput.ts new file mode 100644 index 0000000..30509bd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereInput.ts @@ -0,0 +1,17 @@ +import { IntFilter } from "../../util/IntFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; + +export type AvailabilityWhereInput = { + id?: IntFilter; + user?: UserWhereUniqueInput; + eventType?: EventTypeWhereUniqueInput; + days?: IntFilter; + startTime?: DateTimeFilter; + endTime?: DateTimeFilter; + date?: DateTimeNullableFilter; + schedule?: ScheduleWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereUniqueInput.ts new file mode 100644 index 0000000..e4c390d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/AvailabilityWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type AvailabilityWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/CreateAvailabilityArgs.ts b/apps/roi-cacl-2-admin/src/api/availability/CreateAvailabilityArgs.ts new file mode 100644 index 0000000..8ae75ff --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/CreateAvailabilityArgs.ts @@ -0,0 +1,5 @@ +import { AvailabilityCreateInput } from "./AvailabilityCreateInput"; + +export type CreateAvailabilityArgs = { + data: AvailabilityCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/DeleteAvailabilityArgs.ts b/apps/roi-cacl-2-admin/src/api/availability/DeleteAvailabilityArgs.ts new file mode 100644 index 0000000..70422b9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/DeleteAvailabilityArgs.ts @@ -0,0 +1,5 @@ +import { AvailabilityWhereUniqueInput } from "./AvailabilityWhereUniqueInput"; + +export type DeleteAvailabilityArgs = { + where: AvailabilityWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/availability/UpdateAvailabilityArgs.ts b/apps/roi-cacl-2-admin/src/api/availability/UpdateAvailabilityArgs.ts new file mode 100644 index 0000000..3274cce --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/availability/UpdateAvailabilityArgs.ts @@ -0,0 +1,7 @@ +import { AvailabilityWhereUniqueInput } from "./AvailabilityWhereUniqueInput"; +import { AvailabilityUpdateInput } from "./AvailabilityUpdateInput"; + +export type UpdateAvailabilityArgs = { + where: AvailabilityWhereUniqueInput; + data: AvailabilityUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/AttendeeCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/AttendeeCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..f1b4e16 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/AttendeeCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,5 @@ +import { AttendeeWhereUniqueInput } from "../attendee/AttendeeWhereUniqueInput"; + +export type AttendeeCreateNestedManyWithoutBookingsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/AttendeeUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/AttendeeUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..9d0a56a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/AttendeeUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,7 @@ +import { AttendeeWhereUniqueInput } from "../attendee/AttendeeWhereUniqueInput"; + +export type AttendeeUpdateManyWithoutBookingsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/Booking.ts b/apps/roi-cacl-2-admin/src/api/booking/Booking.ts new file mode 100644 index 0000000..9b3112b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/Booking.ts @@ -0,0 +1,40 @@ +import { User } from "../user/User"; +import { EventType } from "../eventType/EventType"; +import { JsonValue } from "type-fest"; +import { DestinationCalendar } from "../destinationCalendar/DestinationCalendar"; +import { BookingReference } from "../bookingReference/BookingReference"; +import { Attendee } from "../attendee/Attendee"; +import { DailyEventReference } from "../dailyEventReference/DailyEventReference"; +import { Payment } from "../payment/Payment"; +import { WorkflowReminder } from "../workflowReminder/WorkflowReminder"; + +export type Booking = { + id: number; + uid: string; + user?: User | null; + eventType?: EventType | null; + title: string; + description: string | null; + customInputs: JsonValue; + startTime: Date; + endTime: Date; + location: string | null; + createdAt: Date; + updatedAt: Date | null; + status?: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + paid: boolean; + cancellationReason: string | null; + rejectionReason: string | null; + dynamicEventSlugRef: string | null; + dynamicGroupSlugRef: string | null; + rescheduled: boolean | null; + fromReschedule: string | null; + recurringEventId: string | null; + smsReminderNumber: string | null; + destinationCalendar?: DestinationCalendar | null; + references?: Array; + attendees?: Array; + dailyRef?: DailyEventReference | null; + payment?: Array; + workflowReminders?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingCountArgs.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingCountArgs.ts new file mode 100644 index 0000000..ecbd21d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingCountArgs.ts @@ -0,0 +1,5 @@ +import { BookingWhereInput } from "./BookingWhereInput"; + +export type BookingCountArgs = { + where?: BookingWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingCreateInput.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingCreateInput.ts new file mode 100644 index 0000000..f89cd3b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingCreateInput.ts @@ -0,0 +1,38 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { InputJsonValue } from "../../types"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { BookingReferenceCreateNestedManyWithoutBookingsInput } from "./BookingReferenceCreateNestedManyWithoutBookingsInput"; +import { AttendeeCreateNestedManyWithoutBookingsInput } from "./AttendeeCreateNestedManyWithoutBookingsInput"; +import { DailyEventReferenceWhereUniqueInput } from "../dailyEventReference/DailyEventReferenceWhereUniqueInput"; +import { PaymentCreateNestedManyWithoutBookingsInput } from "./PaymentCreateNestedManyWithoutBookingsInput"; +import { WorkflowReminderCreateNestedManyWithoutBookingsInput } from "./WorkflowReminderCreateNestedManyWithoutBookingsInput"; + +export type BookingCreateInput = { + uid: string; + user?: UserWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + title: string; + description?: string | null; + customInputs?: InputJsonValue; + startTime: Date; + endTime: Date; + location?: string | null; + updatedAt?: Date | null; + status: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + paid: boolean; + cancellationReason?: string | null; + rejectionReason?: string | null; + dynamicEventSlugRef?: string | null; + dynamicGroupSlugRef?: string | null; + rescheduled?: boolean | null; + fromReschedule?: string | null; + recurringEventId?: string | null; + smsReminderNumber?: string | null; + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + references?: BookingReferenceCreateNestedManyWithoutBookingsInput; + attendees?: AttendeeCreateNestedManyWithoutBookingsInput; + dailyRef?: DailyEventReferenceWhereUniqueInput | null; + payment?: PaymentCreateNestedManyWithoutBookingsInput; + workflowReminders?: WorkflowReminderCreateNestedManyWithoutBookingsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingFindManyArgs.ts new file mode 100644 index 0000000..7de1ead --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingFindManyArgs.ts @@ -0,0 +1,9 @@ +import { BookingWhereInput } from "./BookingWhereInput"; +import { BookingOrderByInput } from "./BookingOrderByInput"; + +export type BookingFindManyArgs = { + where?: BookingWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingFindUniqueArgs.ts new file mode 100644 index 0000000..a643956 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { BookingWhereUniqueInput } from "./BookingWhereUniqueInput"; + +export type BookingFindUniqueArgs = { + where: BookingWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingListRelationFilter.ts new file mode 100644 index 0000000..19ec90f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingListRelationFilter.ts @@ -0,0 +1,7 @@ +import { BookingWhereInput } from "./BookingWhereInput"; + +export type BookingListRelationFilter = { + every?: BookingWhereInput; + some?: BookingWhereInput; + none?: BookingWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingOrderByInput.ts new file mode 100644 index 0000000..7223050 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingOrderByInput.ts @@ -0,0 +1,28 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type BookingOrderByInput = { + id?: SortOrder; + uid?: SortOrder; + userId?: SortOrder; + eventTypeId?: SortOrder; + title?: SortOrder; + description?: SortOrder; + customInputs?: SortOrder; + startTime?: SortOrder; + endTime?: SortOrder; + location?: SortOrder; + createdAt?: SortOrder; + updatedAt?: SortOrder; + status?: SortOrder; + paid?: SortOrder; + cancellationReason?: SortOrder; + rejectionReason?: SortOrder; + dynamicEventSlugRef?: SortOrder; + dynamicGroupSlugRef?: SortOrder; + rescheduled?: SortOrder; + fromReschedule?: SortOrder; + recurringEventId?: SortOrder; + smsReminderNumber?: SortOrder; + destinationCalendarId?: SortOrder; + dailyRefId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingReferenceCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingReferenceCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..a04fe26 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingReferenceCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,5 @@ +import { BookingReferenceWhereUniqueInput } from "../bookingReference/BookingReferenceWhereUniqueInput"; + +export type BookingReferenceCreateNestedManyWithoutBookingsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingReferenceUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingReferenceUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..7f422e2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingReferenceUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,7 @@ +import { BookingReferenceWhereUniqueInput } from "../bookingReference/BookingReferenceWhereUniqueInput"; + +export type BookingReferenceUpdateManyWithoutBookingsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingUpdateInput.ts new file mode 100644 index 0000000..d9142a6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingUpdateInput.ts @@ -0,0 +1,38 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { InputJsonValue } from "../../types"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { BookingReferenceUpdateManyWithoutBookingsInput } from "./BookingReferenceUpdateManyWithoutBookingsInput"; +import { AttendeeUpdateManyWithoutBookingsInput } from "./AttendeeUpdateManyWithoutBookingsInput"; +import { DailyEventReferenceWhereUniqueInput } from "../dailyEventReference/DailyEventReferenceWhereUniqueInput"; +import { PaymentUpdateManyWithoutBookingsInput } from "./PaymentUpdateManyWithoutBookingsInput"; +import { WorkflowReminderUpdateManyWithoutBookingsInput } from "./WorkflowReminderUpdateManyWithoutBookingsInput"; + +export type BookingUpdateInput = { + uid?: string; + user?: UserWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + title?: string; + description?: string | null; + customInputs?: InputJsonValue; + startTime?: Date; + endTime?: Date; + location?: string | null; + updatedAt?: Date | null; + status?: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + paid?: boolean; + cancellationReason?: string | null; + rejectionReason?: string | null; + dynamicEventSlugRef?: string | null; + dynamicGroupSlugRef?: string | null; + rescheduled?: boolean | null; + fromReschedule?: string | null; + recurringEventId?: string | null; + smsReminderNumber?: string | null; + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + references?: BookingReferenceUpdateManyWithoutBookingsInput; + attendees?: AttendeeUpdateManyWithoutBookingsInput; + dailyRef?: DailyEventReferenceWhereUniqueInput | null; + payment?: PaymentUpdateManyWithoutBookingsInput; + workflowReminders?: WorkflowReminderUpdateManyWithoutBookingsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingWhereInput.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingWhereInput.ts new file mode 100644 index 0000000..73a8bc4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingWhereInput.ts @@ -0,0 +1,47 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { BookingReferenceListRelationFilter } from "../bookingReference/BookingReferenceListRelationFilter"; +import { AttendeeListRelationFilter } from "../attendee/AttendeeListRelationFilter"; +import { DailyEventReferenceWhereUniqueInput } from "../dailyEventReference/DailyEventReferenceWhereUniqueInput"; +import { PaymentListRelationFilter } from "../payment/PaymentListRelationFilter"; +import { WorkflowReminderListRelationFilter } from "../workflowReminder/WorkflowReminderListRelationFilter"; + +export type BookingWhereInput = { + id?: IntFilter; + uid?: StringFilter; + user?: UserWhereUniqueInput; + eventType?: EventTypeWhereUniqueInput; + title?: StringFilter; + description?: StringNullableFilter; + customInputs?: JsonFilter; + startTime?: DateTimeFilter; + endTime?: DateTimeFilter; + location?: StringNullableFilter; + createdAt?: DateTimeFilter; + updatedAt?: DateTimeNullableFilter; + status?: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + paid?: BooleanFilter; + cancellationReason?: StringNullableFilter; + rejectionReason?: StringNullableFilter; + dynamicEventSlugRef?: StringNullableFilter; + dynamicGroupSlugRef?: StringNullableFilter; + rescheduled?: BooleanNullableFilter; + fromReschedule?: StringNullableFilter; + recurringEventId?: StringNullableFilter; + smsReminderNumber?: StringNullableFilter; + destinationCalendar?: DestinationCalendarWhereUniqueInput; + references?: BookingReferenceListRelationFilter; + attendees?: AttendeeListRelationFilter; + dailyRef?: DailyEventReferenceWhereUniqueInput; + payment?: PaymentListRelationFilter; + workflowReminders?: WorkflowReminderListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/BookingWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/booking/BookingWhereUniqueInput.ts new file mode 100644 index 0000000..f839472 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/BookingWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type BookingWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/CreateBookingArgs.ts b/apps/roi-cacl-2-admin/src/api/booking/CreateBookingArgs.ts new file mode 100644 index 0000000..cbe8e39 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/CreateBookingArgs.ts @@ -0,0 +1,5 @@ +import { BookingCreateInput } from "./BookingCreateInput"; + +export type CreateBookingArgs = { + data: BookingCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/DeleteBookingArgs.ts b/apps/roi-cacl-2-admin/src/api/booking/DeleteBookingArgs.ts new file mode 100644 index 0000000..e300090 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/DeleteBookingArgs.ts @@ -0,0 +1,5 @@ +import { BookingWhereUniqueInput } from "./BookingWhereUniqueInput"; + +export type DeleteBookingArgs = { + where: BookingWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/EnumBookingStatus.ts b/apps/roi-cacl-2-admin/src/api/booking/EnumBookingStatus.ts new file mode 100644 index 0000000..890dd29 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/EnumBookingStatus.ts @@ -0,0 +1,6 @@ +export enum EnumBookingStatus { + Cancelled = "CANCELLED", + Accepted = "ACCEPTED", + Rejected = "REJECTED", + Pending = "PENDING", +} diff --git a/apps/roi-cacl-2-admin/src/api/booking/PaymentCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/PaymentCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..479528d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/PaymentCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,5 @@ +import { PaymentWhereUniqueInput } from "../payment/PaymentWhereUniqueInput"; + +export type PaymentCreateNestedManyWithoutBookingsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/PaymentUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/PaymentUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..eb27b72 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/PaymentUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,7 @@ +import { PaymentWhereUniqueInput } from "../payment/PaymentWhereUniqueInput"; + +export type PaymentUpdateManyWithoutBookingsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/UpdateBookingArgs.ts b/apps/roi-cacl-2-admin/src/api/booking/UpdateBookingArgs.ts new file mode 100644 index 0000000..dec11dc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/UpdateBookingArgs.ts @@ -0,0 +1,7 @@ +import { BookingWhereUniqueInput } from "./BookingWhereUniqueInput"; +import { BookingUpdateInput } from "./BookingUpdateInput"; + +export type UpdateBookingArgs = { + where: BookingWhereUniqueInput; + data: BookingUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..574c230 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,5 @@ +import { WorkflowReminderWhereUniqueInput } from "../workflowReminder/WorkflowReminderWhereUniqueInput"; + +export type WorkflowReminderCreateNestedManyWithoutBookingsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..b681094 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/booking/WorkflowReminderUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,7 @@ +import { WorkflowReminderWhereUniqueInput } from "../workflowReminder/WorkflowReminderWhereUniqueInput"; + +export type WorkflowReminderUpdateManyWithoutBookingsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReference.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReference.ts new file mode 100644 index 0000000..ade9b3b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReference.ts @@ -0,0 +1,13 @@ +import { Booking } from "../booking/Booking"; + +export type BookingReference = { + id: number; + typeField: string; + uid: string; + meetingId: string | null; + meetingPassword: string | null; + meetingUrl: string | null; + booking?: Booking | null; + externalCalendarId: string | null; + deleted: boolean | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCountArgs.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCountArgs.ts new file mode 100644 index 0000000..bbc6203 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCountArgs.ts @@ -0,0 +1,5 @@ +import { BookingReferenceWhereInput } from "./BookingReferenceWhereInput"; + +export type BookingReferenceCountArgs = { + where?: BookingReferenceWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCreateInput.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCreateInput.ts new file mode 100644 index 0000000..e703c70 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceCreateInput.ts @@ -0,0 +1,12 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type BookingReferenceCreateInput = { + typeField: string; + uid: string; + meetingId?: string | null; + meetingPassword?: string | null; + meetingUrl?: string | null; + booking?: BookingWhereUniqueInput | null; + externalCalendarId?: string | null; + deleted?: boolean | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindManyArgs.ts new file mode 100644 index 0000000..22c05d7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindManyArgs.ts @@ -0,0 +1,9 @@ +import { BookingReferenceWhereInput } from "./BookingReferenceWhereInput"; +import { BookingReferenceOrderByInput } from "./BookingReferenceOrderByInput"; + +export type BookingReferenceFindManyArgs = { + where?: BookingReferenceWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindUniqueArgs.ts new file mode 100644 index 0000000..631da1f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { BookingReferenceWhereUniqueInput } from "./BookingReferenceWhereUniqueInput"; + +export type BookingReferenceFindUniqueArgs = { + where: BookingReferenceWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceListRelationFilter.ts new file mode 100644 index 0000000..1529999 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceListRelationFilter.ts @@ -0,0 +1,7 @@ +import { BookingReferenceWhereInput } from "./BookingReferenceWhereInput"; + +export type BookingReferenceListRelationFilter = { + every?: BookingReferenceWhereInput; + some?: BookingReferenceWhereInput; + none?: BookingReferenceWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceOrderByInput.ts new file mode 100644 index 0000000..8fa3cd1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceOrderByInput.ts @@ -0,0 +1,13 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type BookingReferenceOrderByInput = { + id?: SortOrder; + typeField?: SortOrder; + uid?: SortOrder; + meetingId?: SortOrder; + meetingPassword?: SortOrder; + meetingUrl?: SortOrder; + bookingId?: SortOrder; + externalCalendarId?: SortOrder; + deleted?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceUpdateInput.ts new file mode 100644 index 0000000..fe4015a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceUpdateInput.ts @@ -0,0 +1,12 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type BookingReferenceUpdateInput = { + typeField?: string; + uid?: string; + meetingId?: string | null; + meetingPassword?: string | null; + meetingUrl?: string | null; + booking?: BookingWhereUniqueInput | null; + externalCalendarId?: string | null; + deleted?: boolean | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereInput.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereInput.ts new file mode 100644 index 0000000..c5c4dc4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereInput.ts @@ -0,0 +1,17 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; + +export type BookingReferenceWhereInput = { + id?: IntFilter; + typeField?: StringFilter; + uid?: StringFilter; + meetingId?: StringNullableFilter; + meetingPassword?: StringNullableFilter; + meetingUrl?: StringNullableFilter; + booking?: BookingWhereUniqueInput; + externalCalendarId?: StringNullableFilter; + deleted?: BooleanNullableFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereUniqueInput.ts new file mode 100644 index 0000000..4e93b4d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/BookingReferenceWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type BookingReferenceWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/CreateBookingReferenceArgs.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/CreateBookingReferenceArgs.ts new file mode 100644 index 0000000..272a9e1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/CreateBookingReferenceArgs.ts @@ -0,0 +1,5 @@ +import { BookingReferenceCreateInput } from "./BookingReferenceCreateInput"; + +export type CreateBookingReferenceArgs = { + data: BookingReferenceCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/DeleteBookingReferenceArgs.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/DeleteBookingReferenceArgs.ts new file mode 100644 index 0000000..34ea8f8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/DeleteBookingReferenceArgs.ts @@ -0,0 +1,5 @@ +import { BookingReferenceWhereUniqueInput } from "./BookingReferenceWhereUniqueInput"; + +export type DeleteBookingReferenceArgs = { + where: BookingReferenceWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/bookingReference/UpdateBookingReferenceArgs.ts b/apps/roi-cacl-2-admin/src/api/bookingReference/UpdateBookingReferenceArgs.ts new file mode 100644 index 0000000..7aef572 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/bookingReference/UpdateBookingReferenceArgs.ts @@ -0,0 +1,7 @@ +import { BookingReferenceWhereUniqueInput } from "./BookingReferenceWhereUniqueInput"; +import { BookingReferenceUpdateInput } from "./BookingReferenceUpdateInput"; + +export type UpdateBookingReferenceArgs = { + where: BookingReferenceWhereUniqueInput; + data: BookingReferenceUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CreateCredentialArgs.ts b/apps/roi-cacl-2-admin/src/api/credential/CreateCredentialArgs.ts new file mode 100644 index 0000000..7928c43 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CreateCredentialArgs.ts @@ -0,0 +1,5 @@ +import { CredentialCreateInput } from "./CredentialCreateInput"; + +export type CreateCredentialArgs = { + data: CredentialCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/Credential.ts b/apps/roi-cacl-2-admin/src/api/credential/Credential.ts new file mode 100644 index 0000000..038fe38 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/Credential.ts @@ -0,0 +1,13 @@ +import { JsonValue } from "type-fest"; +import { User } from "../user/User"; +import { AppModel } from "../appModel/AppModel"; +import { DestinationCalendar } from "../destinationCalendar/DestinationCalendar"; + +export type Credential = { + id: number; + typeField: string; + key: JsonValue; + user?: User | null; + appField?: AppModel | null; + destinationCalendars?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialCountArgs.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialCountArgs.ts new file mode 100644 index 0000000..44c2059 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialCountArgs.ts @@ -0,0 +1,5 @@ +import { CredentialWhereInput } from "./CredentialWhereInput"; + +export type CredentialCountArgs = { + where?: CredentialWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialCreateInput.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialCreateInput.ts new file mode 100644 index 0000000..cfd2dac --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialCreateInput.ts @@ -0,0 +1,12 @@ +import { InputJsonValue } from "../../types"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; +import { DestinationCalendarCreateNestedManyWithoutCredentialsInput } from "./DestinationCalendarCreateNestedManyWithoutCredentialsInput"; + +export type CredentialCreateInput = { + typeField: string; + key: InputJsonValue; + user?: UserWhereUniqueInput | null; + appField?: AppModelWhereUniqueInput | null; + destinationCalendars?: DestinationCalendarCreateNestedManyWithoutCredentialsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialFindManyArgs.ts new file mode 100644 index 0000000..70c087d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialFindManyArgs.ts @@ -0,0 +1,9 @@ +import { CredentialWhereInput } from "./CredentialWhereInput"; +import { CredentialOrderByInput } from "./CredentialOrderByInput"; + +export type CredentialFindManyArgs = { + where?: CredentialWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialFindUniqueArgs.ts new file mode 100644 index 0000000..b8c2c69 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { CredentialWhereUniqueInput } from "./CredentialWhereUniqueInput"; + +export type CredentialFindUniqueArgs = { + where: CredentialWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialListRelationFilter.ts new file mode 100644 index 0000000..47fe6be --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialListRelationFilter.ts @@ -0,0 +1,7 @@ +import { CredentialWhereInput } from "./CredentialWhereInput"; + +export type CredentialListRelationFilter = { + every?: CredentialWhereInput; + some?: CredentialWhereInput; + none?: CredentialWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialOrderByInput.ts new file mode 100644 index 0000000..a7a33e7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialOrderByInput.ts @@ -0,0 +1,9 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type CredentialOrderByInput = { + id?: SortOrder; + typeField?: SortOrder; + key?: SortOrder; + userId?: SortOrder; + appId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialUpdateInput.ts new file mode 100644 index 0000000..aaee496 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialUpdateInput.ts @@ -0,0 +1,12 @@ +import { InputJsonValue } from "../../types"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; +import { DestinationCalendarUpdateManyWithoutCredentialsInput } from "./DestinationCalendarUpdateManyWithoutCredentialsInput"; + +export type CredentialUpdateInput = { + typeField?: string; + key?: InputJsonValue; + user?: UserWhereUniqueInput | null; + appField?: AppModelWhereUniqueInput | null; + destinationCalendars?: DestinationCalendarUpdateManyWithoutCredentialsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialWhereInput.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialWhereInput.ts new file mode 100644 index 0000000..088d334 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialWhereInput.ts @@ -0,0 +1,15 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; +import { DestinationCalendarListRelationFilter } from "../destinationCalendar/DestinationCalendarListRelationFilter"; + +export type CredentialWhereInput = { + id?: IntFilter; + typeField?: StringFilter; + key?: JsonFilter; + user?: UserWhereUniqueInput; + appField?: AppModelWhereUniqueInput; + destinationCalendars?: DestinationCalendarListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/CredentialWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/credential/CredentialWhereUniqueInput.ts new file mode 100644 index 0000000..91d746d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/CredentialWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type CredentialWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/DeleteCredentialArgs.ts b/apps/roi-cacl-2-admin/src/api/credential/DeleteCredentialArgs.ts new file mode 100644 index 0000000..e7bc1b7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/DeleteCredentialArgs.ts @@ -0,0 +1,5 @@ +import { CredentialWhereUniqueInput } from "./CredentialWhereUniqueInput"; + +export type DeleteCredentialArgs = { + where: CredentialWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts b/apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts new file mode 100644 index 0000000..770a340 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts @@ -0,0 +1,5 @@ +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; + +export type DestinationCalendarCreateNestedManyWithoutCredentialsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarUpdateManyWithoutCredentialsInput.ts b/apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarUpdateManyWithoutCredentialsInput.ts new file mode 100644 index 0000000..f96c5f3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/DestinationCalendarUpdateManyWithoutCredentialsInput.ts @@ -0,0 +1,7 @@ +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; + +export type DestinationCalendarUpdateManyWithoutCredentialsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/credential/UpdateCredentialArgs.ts b/apps/roi-cacl-2-admin/src/api/credential/UpdateCredentialArgs.ts new file mode 100644 index 0000000..8925e08 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/credential/UpdateCredentialArgs.ts @@ -0,0 +1,7 @@ +import { CredentialWhereUniqueInput } from "./CredentialWhereUniqueInput"; +import { CredentialUpdateInput } from "./CredentialUpdateInput"; + +export type UpdateCredentialArgs = { + where: CredentialWhereUniqueInput; + data: CredentialUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/CreateDailyEventReferenceArgs.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/CreateDailyEventReferenceArgs.ts new file mode 100644 index 0000000..bcf439f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/CreateDailyEventReferenceArgs.ts @@ -0,0 +1,5 @@ +import { DailyEventReferenceCreateInput } from "./DailyEventReferenceCreateInput"; + +export type CreateDailyEventReferenceArgs = { + data: DailyEventReferenceCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReference.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReference.ts new file mode 100644 index 0000000..4ae53b3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReference.ts @@ -0,0 +1,8 @@ +import { Booking } from "../booking/Booking"; + +export type DailyEventReference = { + id: number; + dailyurl: string; + dailytoken: string; + booking?: Booking | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCountArgs.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCountArgs.ts new file mode 100644 index 0000000..0b05279 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCountArgs.ts @@ -0,0 +1,5 @@ +import { DailyEventReferenceWhereInput } from "./DailyEventReferenceWhereInput"; + +export type DailyEventReferenceCountArgs = { + where?: DailyEventReferenceWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCreateInput.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCreateInput.ts new file mode 100644 index 0000000..61d93a4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceCreateInput.ts @@ -0,0 +1,7 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type DailyEventReferenceCreateInput = { + dailyurl: string; + dailytoken: string; + booking?: BookingWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindManyArgs.ts new file mode 100644 index 0000000..fce5096 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindManyArgs.ts @@ -0,0 +1,9 @@ +import { DailyEventReferenceWhereInput } from "./DailyEventReferenceWhereInput"; +import { DailyEventReferenceOrderByInput } from "./DailyEventReferenceOrderByInput"; + +export type DailyEventReferenceFindManyArgs = { + where?: DailyEventReferenceWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindUniqueArgs.ts new file mode 100644 index 0000000..7ab496b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { DailyEventReferenceWhereUniqueInput } from "./DailyEventReferenceWhereUniqueInput"; + +export type DailyEventReferenceFindUniqueArgs = { + where: DailyEventReferenceWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceListRelationFilter.ts new file mode 100644 index 0000000..e46024b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceListRelationFilter.ts @@ -0,0 +1,7 @@ +import { DailyEventReferenceWhereInput } from "./DailyEventReferenceWhereInput"; + +export type DailyEventReferenceListRelationFilter = { + every?: DailyEventReferenceWhereInput; + some?: DailyEventReferenceWhereInput; + none?: DailyEventReferenceWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceOrderByInput.ts new file mode 100644 index 0000000..6c80d39 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceOrderByInput.ts @@ -0,0 +1,8 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type DailyEventReferenceOrderByInput = { + id?: SortOrder; + dailyurl?: SortOrder; + dailytoken?: SortOrder; + bookingId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceUpdateInput.ts new file mode 100644 index 0000000..7f7d81f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceUpdateInput.ts @@ -0,0 +1,7 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type DailyEventReferenceUpdateInput = { + dailyurl?: string; + dailytoken?: string; + booking?: BookingWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereInput.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereInput.ts new file mode 100644 index 0000000..ee09245 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereInput.ts @@ -0,0 +1,10 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type DailyEventReferenceWhereInput = { + id?: IntFilter; + dailyurl?: StringFilter; + dailytoken?: StringFilter; + booking?: BookingWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereUniqueInput.ts new file mode 100644 index 0000000..414f96f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DailyEventReferenceWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type DailyEventReferenceWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/DeleteDailyEventReferenceArgs.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DeleteDailyEventReferenceArgs.ts new file mode 100644 index 0000000..7685ae8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/DeleteDailyEventReferenceArgs.ts @@ -0,0 +1,5 @@ +import { DailyEventReferenceWhereUniqueInput } from "./DailyEventReferenceWhereUniqueInput"; + +export type DeleteDailyEventReferenceArgs = { + where: DailyEventReferenceWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/dailyEventReference/UpdateDailyEventReferenceArgs.ts b/apps/roi-cacl-2-admin/src/api/dailyEventReference/UpdateDailyEventReferenceArgs.ts new file mode 100644 index 0000000..7339400 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/dailyEventReference/UpdateDailyEventReferenceArgs.ts @@ -0,0 +1,7 @@ +import { DailyEventReferenceWhereUniqueInput } from "./DailyEventReferenceWhereUniqueInput"; +import { DailyEventReferenceUpdateInput } from "./DailyEventReferenceUpdateInput"; + +export type UpdateDailyEventReferenceArgs = { + where: DailyEventReferenceWhereUniqueInput; + data: DailyEventReferenceUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/CreateDestinationCalendarArgs.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/CreateDestinationCalendarArgs.ts new file mode 100644 index 0000000..84b233b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/CreateDestinationCalendarArgs.ts @@ -0,0 +1,5 @@ +import { DestinationCalendarCreateInput } from "./DestinationCalendarCreateInput"; + +export type CreateDestinationCalendarArgs = { + data: DestinationCalendarCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DeleteDestinationCalendarArgs.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DeleteDestinationCalendarArgs.ts new file mode 100644 index 0000000..856d51a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DeleteDestinationCalendarArgs.ts @@ -0,0 +1,5 @@ +import { DestinationCalendarWhereUniqueInput } from "./DestinationCalendarWhereUniqueInput"; + +export type DeleteDestinationCalendarArgs = { + where: DestinationCalendarWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendar.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendar.ts new file mode 100644 index 0000000..0c2de1c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendar.ts @@ -0,0 +1,14 @@ +import { User } from "../user/User"; +import { Booking } from "../booking/Booking"; +import { EventType } from "../eventType/EventType"; +import { Credential } from "../credential/Credential"; + +export type DestinationCalendar = { + id: number; + integration: string; + externalId: string; + user?: User | null; + booking?: Booking | null; + eventType?: EventType | null; + credential?: Credential | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCountArgs.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCountArgs.ts new file mode 100644 index 0000000..a2af77c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCountArgs.ts @@ -0,0 +1,5 @@ +import { DestinationCalendarWhereInput } from "./DestinationCalendarWhereInput"; + +export type DestinationCalendarCountArgs = { + where?: DestinationCalendarWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCreateInput.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCreateInput.ts new file mode 100644 index 0000000..fb5bc97 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarCreateInput.ts @@ -0,0 +1,13 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { CredentialWhereUniqueInput } from "../credential/CredentialWhereUniqueInput"; + +export type DestinationCalendarCreateInput = { + integration: string; + externalId: string; + user?: UserWhereUniqueInput | null; + booking?: BookingWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + credential?: CredentialWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindManyArgs.ts new file mode 100644 index 0000000..4fd3d6b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindManyArgs.ts @@ -0,0 +1,9 @@ +import { DestinationCalendarWhereInput } from "./DestinationCalendarWhereInput"; +import { DestinationCalendarOrderByInput } from "./DestinationCalendarOrderByInput"; + +export type DestinationCalendarFindManyArgs = { + where?: DestinationCalendarWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindUniqueArgs.ts new file mode 100644 index 0000000..b30c5a3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { DestinationCalendarWhereUniqueInput } from "./DestinationCalendarWhereUniqueInput"; + +export type DestinationCalendarFindUniqueArgs = { + where: DestinationCalendarWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarListRelationFilter.ts new file mode 100644 index 0000000..1db1850 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarListRelationFilter.ts @@ -0,0 +1,7 @@ +import { DestinationCalendarWhereInput } from "./DestinationCalendarWhereInput"; + +export type DestinationCalendarListRelationFilter = { + every?: DestinationCalendarWhereInput; + some?: DestinationCalendarWhereInput; + none?: DestinationCalendarWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarOrderByInput.ts new file mode 100644 index 0000000..a9a006a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarOrderByInput.ts @@ -0,0 +1,11 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type DestinationCalendarOrderByInput = { + id?: SortOrder; + integration?: SortOrder; + externalId?: SortOrder; + userId?: SortOrder; + bookingId?: SortOrder; + eventTypeId?: SortOrder; + credentialId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarUpdateInput.ts new file mode 100644 index 0000000..26d4a54 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarUpdateInput.ts @@ -0,0 +1,13 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { CredentialWhereUniqueInput } from "../credential/CredentialWhereUniqueInput"; + +export type DestinationCalendarUpdateInput = { + integration?: string; + externalId?: string; + user?: UserWhereUniqueInput | null; + booking?: BookingWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + credential?: CredentialWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereInput.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereInput.ts new file mode 100644 index 0000000..40a6cd3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereInput.ts @@ -0,0 +1,16 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { CredentialWhereUniqueInput } from "../credential/CredentialWhereUniqueInput"; + +export type DestinationCalendarWhereInput = { + id?: IntFilter; + integration?: StringFilter; + externalId?: StringFilter; + user?: UserWhereUniqueInput; + booking?: BookingWhereUniqueInput; + eventType?: EventTypeWhereUniqueInput; + credential?: CredentialWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereUniqueInput.ts new file mode 100644 index 0000000..bc14df4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/DestinationCalendarWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type DestinationCalendarWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/destinationCalendar/UpdateDestinationCalendarArgs.ts b/apps/roi-cacl-2-admin/src/api/destinationCalendar/UpdateDestinationCalendarArgs.ts new file mode 100644 index 0000000..f0060f6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/destinationCalendar/UpdateDestinationCalendarArgs.ts @@ -0,0 +1,7 @@ +import { DestinationCalendarWhereUniqueInput } from "./DestinationCalendarWhereUniqueInput"; +import { DestinationCalendarUpdateInput } from "./DestinationCalendarUpdateInput"; + +export type UpdateDestinationCalendarArgs = { + where: DestinationCalendarWhereUniqueInput; + data: DestinationCalendarUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/AvailabilityCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/AvailabilityCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..3419047 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/AvailabilityCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,5 @@ +import { AvailabilityWhereUniqueInput } from "../availability/AvailabilityWhereUniqueInput"; + +export type AvailabilityCreateNestedManyWithoutEventTypesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/AvailabilityUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/AvailabilityUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..8a70e39 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/AvailabilityUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,7 @@ +import { AvailabilityWhereUniqueInput } from "../availability/AvailabilityWhereUniqueInput"; + +export type AvailabilityUpdateManyWithoutEventTypesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/BookingCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/BookingCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..a699f3e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/BookingCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,5 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type BookingCreateNestedManyWithoutEventTypesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/BookingUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/BookingUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..ff319b0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/BookingUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,7 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type BookingUpdateManyWithoutEventTypesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/CreateEventTypeArgs.ts b/apps/roi-cacl-2-admin/src/api/eventType/CreateEventTypeArgs.ts new file mode 100644 index 0000000..0b7d670 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/CreateEventTypeArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeCreateInput } from "./EventTypeCreateInput"; + +export type CreateEventTypeArgs = { + data: EventTypeCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/DeleteEventTypeArgs.ts b/apps/roi-cacl-2-admin/src/api/eventType/DeleteEventTypeArgs.ts new file mode 100644 index 0000000..c5c5250 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/DeleteEventTypeArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeWhereUniqueInput } from "./EventTypeWhereUniqueInput"; + +export type DeleteEventTypeArgs = { + where: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypePeriodType.ts b/apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypePeriodType.ts new file mode 100644 index 0000000..36b2a69 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypePeriodType.ts @@ -0,0 +1,5 @@ +export enum EnumEventTypePeriodType { + Unlimited = "UNLIMITED", + Rolling = "ROLLING", + Range = "RANGE", +} diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypeSchedulingType.ts b/apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypeSchedulingType.ts new file mode 100644 index 0000000..b312294 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EnumEventTypeSchedulingType.ts @@ -0,0 +1,4 @@ +export enum EnumEventTypeSchedulingType { + RoundRobin = "ROUND_ROBIN", + Collective = "COLLECTIVE", +} diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventType.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventType.ts new file mode 100644 index 0000000..59a8b82 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventType.ts @@ -0,0 +1,54 @@ +import { JsonValue } from "type-fest"; +import { User } from "../user/User"; +import { Team } from "../team/Team"; +import { Schedule } from "../schedule/Schedule"; +import { DestinationCalendar } from "../destinationCalendar/DestinationCalendar"; +import { Booking } from "../booking/Booking"; +import { Availability } from "../availability/Availability"; +import { EventTypeCustomInput } from "../eventTypeCustomInput/EventTypeCustomInput"; +import { Webhook } from "../webhook/Webhook"; +import { HashedLink } from "../hashedLink/HashedLink"; +import { WorkflowsOnEventType } from "../workflowsOnEventType/WorkflowsOnEventType"; + +export type EventType = { + id: number; + title: string; + slug: string; + description: string | null; + position: number; + locations: JsonValue; + length: number; + hidden: boolean; + users?: Array; + userId: number | null; + team?: Team | null; + eventName: string | null; + timeZone: string | null; + periodType?: "UNLIMITED" | "ROLLING" | "RANGE"; + periodStartDate: Date | null; + periodEndDate: Date | null; + periodDays: number | null; + periodCountCalendarDays: boolean | null; + requiresConfirmation: boolean; + recurringEvent: JsonValue; + disableGuests: boolean; + hideCalendarNotes: boolean; + minimumBookingNotice: number; + beforeEventBuffer: number; + afterEventBuffer: number; + seatsPerTimeSlot: number | null; + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE" | null; + schedule?: Schedule | null; + price: number; + currency: string; + slotInterval: number | null; + metadata: JsonValue; + successRedirectUrl: string | null; + destinationCalendar?: DestinationCalendar | null; + bookings?: Array; + availability?: Array; + customInputs?: Array; + webhooks?: Array; + hashedLink?: HashedLink | null; + workflows?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCountArgs.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCountArgs.ts new file mode 100644 index 0000000..3962cf4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCountArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeWhereInput } from "./EventTypeWhereInput"; + +export type EventTypeCountArgs = { + where?: EventTypeWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCreateInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCreateInput.ts new file mode 100644 index 0000000..e1faafb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCreateInput.ts @@ -0,0 +1,53 @@ +import { InputJsonValue } from "../../types"; +import { UserCreateNestedManyWithoutEventTypesInput } from "./UserCreateNestedManyWithoutEventTypesInput"; +import { TeamWhereUniqueInput } from "../team/TeamWhereUniqueInput"; +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { BookingCreateNestedManyWithoutEventTypesInput } from "./BookingCreateNestedManyWithoutEventTypesInput"; +import { AvailabilityCreateNestedManyWithoutEventTypesInput } from "./AvailabilityCreateNestedManyWithoutEventTypesInput"; +import { EventTypeCustomInputCreateNestedManyWithoutEventTypesInput } from "./EventTypeCustomInputCreateNestedManyWithoutEventTypesInput"; +import { WebhookCreateNestedManyWithoutEventTypesInput } from "./WebhookCreateNestedManyWithoutEventTypesInput"; +import { HashedLinkWhereUniqueInput } from "../hashedLink/HashedLinkWhereUniqueInput"; +import { WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput } from "./WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput"; + +export type EventTypeCreateInput = { + title: string; + slug: string; + description?: string | null; + position: number; + locations?: InputJsonValue; + length: number; + hidden: boolean; + users?: UserCreateNestedManyWithoutEventTypesInput; + userId?: number | null; + team?: TeamWhereUniqueInput | null; + eventName?: string | null; + timeZone?: string | null; + periodType: "UNLIMITED" | "ROLLING" | "RANGE"; + periodStartDate?: Date | null; + periodEndDate?: Date | null; + periodDays?: number | null; + periodCountCalendarDays?: boolean | null; + requiresConfirmation: boolean; + recurringEvent?: InputJsonValue; + disableGuests: boolean; + hideCalendarNotes: boolean; + minimumBookingNotice: number; + beforeEventBuffer: number; + afterEventBuffer: number; + seatsPerTimeSlot?: number | null; + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE" | null; + schedule?: ScheduleWhereUniqueInput | null; + price: number; + currency: string; + slotInterval?: number | null; + metadata?: InputJsonValue; + successRedirectUrl?: string | null; + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + bookings?: BookingCreateNestedManyWithoutEventTypesInput; + availability?: AvailabilityCreateNestedManyWithoutEventTypesInput; + customInputs?: EventTypeCustomInputCreateNestedManyWithoutEventTypesInput; + webhooks?: WebhookCreateNestedManyWithoutEventTypesInput; + hashedLink?: HashedLinkWhereUniqueInput | null; + workflows?: WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..35e9f6b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,5 @@ +import { EventTypeCustomInputWhereUniqueInput } from "../eventTypeCustomInput/EventTypeCustomInputWhereUniqueInput"; + +export type EventTypeCustomInputCreateNestedManyWithoutEventTypesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..26a90bc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,7 @@ +import { EventTypeCustomInputWhereUniqueInput } from "../eventTypeCustomInput/EventTypeCustomInputWhereUniqueInput"; + +export type EventTypeCustomInputUpdateManyWithoutEventTypesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindManyArgs.ts new file mode 100644 index 0000000..58cb470 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindManyArgs.ts @@ -0,0 +1,9 @@ +import { EventTypeWhereInput } from "./EventTypeWhereInput"; +import { EventTypeOrderByInput } from "./EventTypeOrderByInput"; + +export type EventTypeFindManyArgs = { + where?: EventTypeWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindUniqueArgs.ts new file mode 100644 index 0000000..f323c7b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeWhereUniqueInput } from "./EventTypeWhereUniqueInput"; + +export type EventTypeFindUniqueArgs = { + where: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeListRelationFilter.ts new file mode 100644 index 0000000..e16933b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeListRelationFilter.ts @@ -0,0 +1,7 @@ +import { EventTypeWhereInput } from "./EventTypeWhereInput"; + +export type EventTypeListRelationFilter = { + every?: EventTypeWhereInput; + some?: EventTypeWhereInput; + none?: EventTypeWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeOrderByInput.ts new file mode 100644 index 0000000..b7bb507 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeOrderByInput.ts @@ -0,0 +1,38 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type EventTypeOrderByInput = { + id?: SortOrder; + title?: SortOrder; + slug?: SortOrder; + description?: SortOrder; + position?: SortOrder; + locations?: SortOrder; + length?: SortOrder; + hidden?: SortOrder; + userId?: SortOrder; + teamId?: SortOrder; + eventName?: SortOrder; + timeZone?: SortOrder; + periodType?: SortOrder; + periodStartDate?: SortOrder; + periodEndDate?: SortOrder; + periodDays?: SortOrder; + periodCountCalendarDays?: SortOrder; + requiresConfirmation?: SortOrder; + recurringEvent?: SortOrder; + disableGuests?: SortOrder; + hideCalendarNotes?: SortOrder; + minimumBookingNotice?: SortOrder; + beforeEventBuffer?: SortOrder; + afterEventBuffer?: SortOrder; + seatsPerTimeSlot?: SortOrder; + schedulingType?: SortOrder; + scheduleId?: SortOrder; + price?: SortOrder; + currency?: SortOrder; + slotInterval?: SortOrder; + metadata?: SortOrder; + successRedirectUrl?: SortOrder; + destinationCalendarId?: SortOrder; + hashedLinkId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeUpdateInput.ts new file mode 100644 index 0000000..ac6c891 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeUpdateInput.ts @@ -0,0 +1,53 @@ +import { InputJsonValue } from "../../types"; +import { UserUpdateManyWithoutEventTypesInput } from "./UserUpdateManyWithoutEventTypesInput"; +import { TeamWhereUniqueInput } from "../team/TeamWhereUniqueInput"; +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { BookingUpdateManyWithoutEventTypesInput } from "./BookingUpdateManyWithoutEventTypesInput"; +import { AvailabilityUpdateManyWithoutEventTypesInput } from "./AvailabilityUpdateManyWithoutEventTypesInput"; +import { EventTypeCustomInputUpdateManyWithoutEventTypesInput } from "./EventTypeCustomInputUpdateManyWithoutEventTypesInput"; +import { WebhookUpdateManyWithoutEventTypesInput } from "./WebhookUpdateManyWithoutEventTypesInput"; +import { HashedLinkWhereUniqueInput } from "../hashedLink/HashedLinkWhereUniqueInput"; +import { WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput } from "./WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput"; + +export type EventTypeUpdateInput = { + title?: string; + slug?: string; + description?: string | null; + position?: number; + locations?: InputJsonValue; + length?: number; + hidden?: boolean; + users?: UserUpdateManyWithoutEventTypesInput; + userId?: number | null; + team?: TeamWhereUniqueInput | null; + eventName?: string | null; + timeZone?: string | null; + periodType?: "UNLIMITED" | "ROLLING" | "RANGE"; + periodStartDate?: Date | null; + periodEndDate?: Date | null; + periodDays?: number | null; + periodCountCalendarDays?: boolean | null; + requiresConfirmation?: boolean; + recurringEvent?: InputJsonValue; + disableGuests?: boolean; + hideCalendarNotes?: boolean; + minimumBookingNotice?: number; + beforeEventBuffer?: number; + afterEventBuffer?: number; + seatsPerTimeSlot?: number | null; + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE" | null; + schedule?: ScheduleWhereUniqueInput | null; + price?: number; + currency?: string; + slotInterval?: number | null; + metadata?: InputJsonValue; + successRedirectUrl?: string | null; + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + bookings?: BookingUpdateManyWithoutEventTypesInput; + availability?: AvailabilityUpdateManyWithoutEventTypesInput; + customInputs?: EventTypeCustomInputUpdateManyWithoutEventTypesInput; + webhooks?: WebhookUpdateManyWithoutEventTypesInput; + hashedLink?: HashedLinkWhereUniqueInput | null; + workflows?: WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereInput.ts new file mode 100644 index 0000000..39381cd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereInput.ts @@ -0,0 +1,61 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { UserListRelationFilter } from "../user/UserListRelationFilter"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { TeamWhereUniqueInput } from "../team/TeamWhereUniqueInput"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { BookingListRelationFilter } from "../booking/BookingListRelationFilter"; +import { AvailabilityListRelationFilter } from "../availability/AvailabilityListRelationFilter"; +import { EventTypeCustomInputListRelationFilter } from "../eventTypeCustomInput/EventTypeCustomInputListRelationFilter"; +import { WebhookListRelationFilter } from "../webhook/WebhookListRelationFilter"; +import { HashedLinkWhereUniqueInput } from "../hashedLink/HashedLinkWhereUniqueInput"; +import { WorkflowsOnEventTypeListRelationFilter } from "../workflowsOnEventType/WorkflowsOnEventTypeListRelationFilter"; + +export type EventTypeWhereInput = { + id?: IntFilter; + title?: StringFilter; + slug?: StringFilter; + description?: StringNullableFilter; + position?: IntFilter; + locations?: JsonFilter; + length?: IntFilter; + hidden?: BooleanFilter; + users?: UserListRelationFilter; + userId?: IntNullableFilter; + team?: TeamWhereUniqueInput; + eventName?: StringNullableFilter; + timeZone?: StringNullableFilter; + periodType?: "UNLIMITED" | "ROLLING" | "RANGE"; + periodStartDate?: DateTimeNullableFilter; + periodEndDate?: DateTimeNullableFilter; + periodDays?: IntNullableFilter; + periodCountCalendarDays?: BooleanNullableFilter; + requiresConfirmation?: BooleanFilter; + recurringEvent?: JsonFilter; + disableGuests?: BooleanFilter; + hideCalendarNotes?: BooleanFilter; + minimumBookingNotice?: IntFilter; + beforeEventBuffer?: IntFilter; + afterEventBuffer?: IntFilter; + seatsPerTimeSlot?: IntNullableFilter; + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE"; + schedule?: ScheduleWhereUniqueInput; + price?: IntFilter; + currency?: StringFilter; + slotInterval?: IntNullableFilter; + metadata?: JsonFilter; + successRedirectUrl?: StringNullableFilter; + destinationCalendar?: DestinationCalendarWhereUniqueInput; + bookings?: BookingListRelationFilter; + availability?: AvailabilityListRelationFilter; + customInputs?: EventTypeCustomInputListRelationFilter; + webhooks?: WebhookListRelationFilter; + hashedLink?: HashedLinkWhereUniqueInput; + workflows?: WorkflowsOnEventTypeListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereUniqueInput.ts new file mode 100644 index 0000000..b3a6c51 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/EventTypeWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type EventTypeWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/UpdateEventTypeArgs.ts b/apps/roi-cacl-2-admin/src/api/eventType/UpdateEventTypeArgs.ts new file mode 100644 index 0000000..8d64c25 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/UpdateEventTypeArgs.ts @@ -0,0 +1,7 @@ +import { EventTypeWhereUniqueInput } from "./EventTypeWhereUniqueInput"; +import { EventTypeUpdateInput } from "./EventTypeUpdateInput"; + +export type UpdateEventTypeArgs = { + where: EventTypeWhereUniqueInput; + data: EventTypeUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/UserCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/UserCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..7f5b2e8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/UserCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,5 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type UserCreateNestedManyWithoutEventTypesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/UserUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/UserUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..e43cf10 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/UserUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,7 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type UserUpdateManyWithoutEventTypesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/WebhookCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/WebhookCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..b138b4d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/WebhookCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,5 @@ +import { WebhookWhereUniqueInput } from "../webhook/WebhookWhereUniqueInput"; + +export type WebhookCreateNestedManyWithoutEventTypesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/WebhookUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/WebhookUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..6c72caa --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/WebhookUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,7 @@ +import { WebhookWhereUniqueInput } from "../webhook/WebhookWhereUniqueInput"; + +export type WebhookUpdateManyWithoutEventTypesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..0e57b22 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,5 @@ +import { WorkflowsOnEventTypeWhereUniqueInput } from "../workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..b753a53 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventType/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,7 @@ +import { WorkflowsOnEventTypeWhereUniqueInput } from "../workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/CreateEventTypeCustomInputArgs.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/CreateEventTypeCustomInputArgs.ts new file mode 100644 index 0000000..2c106e0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/CreateEventTypeCustomInputArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeCustomInputCreateInput } from "./EventTypeCustomInputCreateInput"; + +export type CreateEventTypeCustomInputArgs = { + data: EventTypeCustomInputCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/DeleteEventTypeCustomInputArgs.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/DeleteEventTypeCustomInputArgs.ts new file mode 100644 index 0000000..78715f5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/DeleteEventTypeCustomInputArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeCustomInputWhereUniqueInput } from "./EventTypeCustomInputWhereUniqueInput"; + +export type DeleteEventTypeCustomInputArgs = { + where: EventTypeCustomInputWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EnumEventTypeCustomInputType.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EnumEventTypeCustomInputType.ts new file mode 100644 index 0000000..71067f0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EnumEventTypeCustomInputType.ts @@ -0,0 +1,6 @@ +export enum EnumEventTypeCustomInputType { + Text = "TEXT", + Textlong = "TEXTLONG", + Number = "NUMBER", + Bool = "BOOL", +} diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInput.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInput.ts new file mode 100644 index 0000000..ee3426b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInput.ts @@ -0,0 +1,10 @@ +import { EventType } from "../eventType/EventType"; + +export type EventTypeCustomInput = { + id: number; + eventType?: EventType; + label: string; + type?: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + required: boolean; + placeholder: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCountArgs.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCountArgs.ts new file mode 100644 index 0000000..7dd55f3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCountArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeCustomInputWhereInput } from "./EventTypeCustomInputWhereInput"; + +export type EventTypeCustomInputCountArgs = { + where?: EventTypeCustomInputWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCreateInput.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCreateInput.ts new file mode 100644 index 0000000..b5c33ef --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputCreateInput.ts @@ -0,0 +1,9 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeCustomInputCreateInput = { + eventType: EventTypeWhereUniqueInput; + label: string; + type: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + required: boolean; + placeholder: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindManyArgs.ts new file mode 100644 index 0000000..e91ff32 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindManyArgs.ts @@ -0,0 +1,9 @@ +import { EventTypeCustomInputWhereInput } from "./EventTypeCustomInputWhereInput"; +import { EventTypeCustomInputOrderByInput } from "./EventTypeCustomInputOrderByInput"; + +export type EventTypeCustomInputFindManyArgs = { + where?: EventTypeCustomInputWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindUniqueArgs.ts new file mode 100644 index 0000000..56ad350 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { EventTypeCustomInputWhereUniqueInput } from "./EventTypeCustomInputWhereUniqueInput"; + +export type EventTypeCustomInputFindUniqueArgs = { + where: EventTypeCustomInputWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputListRelationFilter.ts new file mode 100644 index 0000000..3dd1dfb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputListRelationFilter.ts @@ -0,0 +1,7 @@ +import { EventTypeCustomInputWhereInput } from "./EventTypeCustomInputWhereInput"; + +export type EventTypeCustomInputListRelationFilter = { + every?: EventTypeCustomInputWhereInput; + some?: EventTypeCustomInputWhereInput; + none?: EventTypeCustomInputWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputOrderByInput.ts new file mode 100644 index 0000000..92e1620 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputOrderByInput.ts @@ -0,0 +1,10 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type EventTypeCustomInputOrderByInput = { + id?: SortOrder; + eventTypeId?: SortOrder; + label?: SortOrder; + type?: SortOrder; + required?: SortOrder; + placeholder?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputUpdateInput.ts new file mode 100644 index 0000000..764f066 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputUpdateInput.ts @@ -0,0 +1,9 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeCustomInputUpdateInput = { + eventType?: EventTypeWhereUniqueInput; + label?: string; + type?: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + required?: boolean; + placeholder?: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereInput.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereInput.ts new file mode 100644 index 0000000..8c850f4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereInput.ts @@ -0,0 +1,13 @@ +import { IntFilter } from "../../util/IntFilter"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; + +export type EventTypeCustomInputWhereInput = { + id?: IntFilter; + eventType?: EventTypeWhereUniqueInput; + label?: StringFilter; + type?: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + required?: BooleanFilter; + placeholder?: StringFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereUniqueInput.ts new file mode 100644 index 0000000..c123ddc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/EventTypeCustomInputWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type EventTypeCustomInputWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/UpdateEventTypeCustomInputArgs.ts b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/UpdateEventTypeCustomInputArgs.ts new file mode 100644 index 0000000..2a8b4e7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/eventTypeCustomInput/UpdateEventTypeCustomInputArgs.ts @@ -0,0 +1,7 @@ +import { EventTypeCustomInputWhereUniqueInput } from "./EventTypeCustomInputWhereUniqueInput"; +import { EventTypeCustomInputUpdateInput } from "./EventTypeCustomInputUpdateInput"; + +export type UpdateEventTypeCustomInputArgs = { + where: EventTypeCustomInputWhereUniqueInput; + data: EventTypeCustomInputUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/CreateFeedbackArgs.ts b/apps/roi-cacl-2-admin/src/api/feedback/CreateFeedbackArgs.ts new file mode 100644 index 0000000..d240a06 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/CreateFeedbackArgs.ts @@ -0,0 +1,5 @@ +import { FeedbackCreateInput } from "./FeedbackCreateInput"; + +export type CreateFeedbackArgs = { + data: FeedbackCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/DeleteFeedbackArgs.ts b/apps/roi-cacl-2-admin/src/api/feedback/DeleteFeedbackArgs.ts new file mode 100644 index 0000000..6f5ae8a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/DeleteFeedbackArgs.ts @@ -0,0 +1,5 @@ +import { FeedbackWhereUniqueInput } from "./FeedbackWhereUniqueInput"; + +export type DeleteFeedbackArgs = { + where: FeedbackWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/Feedback.ts b/apps/roi-cacl-2-admin/src/api/feedback/Feedback.ts new file mode 100644 index 0000000..8ef203a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/Feedback.ts @@ -0,0 +1,9 @@ +import { User } from "../user/User"; + +export type Feedback = { + id: number; + date: Date; + user?: User; + rating: string; + comment: string | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackCountArgs.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackCountArgs.ts new file mode 100644 index 0000000..8617b35 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackCountArgs.ts @@ -0,0 +1,5 @@ +import { FeedbackWhereInput } from "./FeedbackWhereInput"; + +export type FeedbackCountArgs = { + where?: FeedbackWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackCreateInput.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackCreateInput.ts new file mode 100644 index 0000000..73b3012 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackCreateInput.ts @@ -0,0 +1,8 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type FeedbackCreateInput = { + date: Date; + user: UserWhereUniqueInput; + rating: string; + comment?: string | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindManyArgs.ts new file mode 100644 index 0000000..a49bda3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindManyArgs.ts @@ -0,0 +1,9 @@ +import { FeedbackWhereInput } from "./FeedbackWhereInput"; +import { FeedbackOrderByInput } from "./FeedbackOrderByInput"; + +export type FeedbackFindManyArgs = { + where?: FeedbackWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindUniqueArgs.ts new file mode 100644 index 0000000..481268a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { FeedbackWhereUniqueInput } from "./FeedbackWhereUniqueInput"; + +export type FeedbackFindUniqueArgs = { + where: FeedbackWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackListRelationFilter.ts new file mode 100644 index 0000000..0a59af8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackListRelationFilter.ts @@ -0,0 +1,7 @@ +import { FeedbackWhereInput } from "./FeedbackWhereInput"; + +export type FeedbackListRelationFilter = { + every?: FeedbackWhereInput; + some?: FeedbackWhereInput; + none?: FeedbackWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackOrderByInput.ts new file mode 100644 index 0000000..c1d87cb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackOrderByInput.ts @@ -0,0 +1,9 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type FeedbackOrderByInput = { + id?: SortOrder; + date?: SortOrder; + userId?: SortOrder; + rating?: SortOrder; + comment?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackUpdateInput.ts new file mode 100644 index 0000000..5da5404 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackUpdateInput.ts @@ -0,0 +1,8 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type FeedbackUpdateInput = { + date?: Date; + user?: UserWhereUniqueInput; + rating?: string; + comment?: string | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereInput.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereInput.ts new file mode 100644 index 0000000..973c389 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereInput.ts @@ -0,0 +1,13 @@ +import { IntFilter } from "../../util/IntFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; + +export type FeedbackWhereInput = { + id?: IntFilter; + date?: DateTimeFilter; + user?: UserWhereUniqueInput; + rating?: StringFilter; + comment?: StringNullableFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereUniqueInput.ts new file mode 100644 index 0000000..0566d6d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/FeedbackWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type FeedbackWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/feedback/UpdateFeedbackArgs.ts b/apps/roi-cacl-2-admin/src/api/feedback/UpdateFeedbackArgs.ts new file mode 100644 index 0000000..f0d376c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/feedback/UpdateFeedbackArgs.ts @@ -0,0 +1,7 @@ +import { FeedbackWhereUniqueInput } from "./FeedbackWhereUniqueInput"; +import { FeedbackUpdateInput } from "./FeedbackUpdateInput"; + +export type UpdateFeedbackArgs = { + where: FeedbackWhereUniqueInput; + data: FeedbackUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/CreateHashedLinkArgs.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/CreateHashedLinkArgs.ts new file mode 100644 index 0000000..8ca3780 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/CreateHashedLinkArgs.ts @@ -0,0 +1,5 @@ +import { HashedLinkCreateInput } from "./HashedLinkCreateInput"; + +export type CreateHashedLinkArgs = { + data: HashedLinkCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/DeleteHashedLinkArgs.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/DeleteHashedLinkArgs.ts new file mode 100644 index 0000000..f9f0239 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/DeleteHashedLinkArgs.ts @@ -0,0 +1,5 @@ +import { HashedLinkWhereUniqueInput } from "./HashedLinkWhereUniqueInput"; + +export type DeleteHashedLinkArgs = { + where: HashedLinkWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLink.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLink.ts new file mode 100644 index 0000000..2b86985 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLink.ts @@ -0,0 +1,7 @@ +import { EventType } from "../eventType/EventType"; + +export type HashedLink = { + id: number; + link: string; + eventType?: EventType; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCountArgs.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCountArgs.ts new file mode 100644 index 0000000..d9dec91 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCountArgs.ts @@ -0,0 +1,5 @@ +import { HashedLinkWhereInput } from "./HashedLinkWhereInput"; + +export type HashedLinkCountArgs = { + where?: HashedLinkWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCreateInput.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCreateInput.ts new file mode 100644 index 0000000..dcd3fac --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkCreateInput.ts @@ -0,0 +1,6 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type HashedLinkCreateInput = { + link: string; + eventType: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindManyArgs.ts new file mode 100644 index 0000000..057e744 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindManyArgs.ts @@ -0,0 +1,9 @@ +import { HashedLinkWhereInput } from "./HashedLinkWhereInput"; +import { HashedLinkOrderByInput } from "./HashedLinkOrderByInput"; + +export type HashedLinkFindManyArgs = { + where?: HashedLinkWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindUniqueArgs.ts new file mode 100644 index 0000000..1a27674 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { HashedLinkWhereUniqueInput } from "./HashedLinkWhereUniqueInput"; + +export type HashedLinkFindUniqueArgs = { + where: HashedLinkWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkListRelationFilter.ts new file mode 100644 index 0000000..8f1f4e3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkListRelationFilter.ts @@ -0,0 +1,7 @@ +import { HashedLinkWhereInput } from "./HashedLinkWhereInput"; + +export type HashedLinkListRelationFilter = { + every?: HashedLinkWhereInput; + some?: HashedLinkWhereInput; + none?: HashedLinkWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkOrderByInput.ts new file mode 100644 index 0000000..fb1ae91 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkOrderByInput.ts @@ -0,0 +1,7 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type HashedLinkOrderByInput = { + id?: SortOrder; + link?: SortOrder; + eventTypeId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkUpdateInput.ts new file mode 100644 index 0000000..c2972be --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkUpdateInput.ts @@ -0,0 +1,6 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type HashedLinkUpdateInput = { + link?: string; + eventType?: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereInput.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereInput.ts new file mode 100644 index 0000000..a08945f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereInput.ts @@ -0,0 +1,9 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type HashedLinkWhereInput = { + id?: IntFilter; + link?: StringFilter; + eventType?: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereUniqueInput.ts new file mode 100644 index 0000000..11dd6fe --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/HashedLinkWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type HashedLinkWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/hashedLink/UpdateHashedLinkArgs.ts b/apps/roi-cacl-2-admin/src/api/hashedLink/UpdateHashedLinkArgs.ts new file mode 100644 index 0000000..53d7e33 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/hashedLink/UpdateHashedLinkArgs.ts @@ -0,0 +1,7 @@ +import { HashedLinkWhereUniqueInput } from "./HashedLinkWhereUniqueInput"; +import { HashedLinkUpdateInput } from "./HashedLinkUpdateInput"; + +export type UpdateHashedLinkArgs = { + where: HashedLinkWhereUniqueInput; + data: HashedLinkUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/CreateImpersonationArgs.ts b/apps/roi-cacl-2-admin/src/api/impersonation/CreateImpersonationArgs.ts new file mode 100644 index 0000000..7f793be --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/CreateImpersonationArgs.ts @@ -0,0 +1,5 @@ +import { ImpersonationCreateInput } from "./ImpersonationCreateInput"; + +export type CreateImpersonationArgs = { + data: ImpersonationCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/DeleteImpersonationArgs.ts b/apps/roi-cacl-2-admin/src/api/impersonation/DeleteImpersonationArgs.ts new file mode 100644 index 0000000..aa23f7d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/DeleteImpersonationArgs.ts @@ -0,0 +1,5 @@ +import { ImpersonationWhereUniqueInput } from "./ImpersonationWhereUniqueInput"; + +export type DeleteImpersonationArgs = { + where: ImpersonationWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/Impersonation.ts b/apps/roi-cacl-2-admin/src/api/impersonation/Impersonation.ts new file mode 100644 index 0000000..d887684 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/Impersonation.ts @@ -0,0 +1,8 @@ +import { User } from "../user/User"; + +export type Impersonation = { + id: number; + createdAt: Date; + impersonatedUser?: User; + impersonatedBy?: User; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCountArgs.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCountArgs.ts new file mode 100644 index 0000000..a296e4c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCountArgs.ts @@ -0,0 +1,5 @@ +import { ImpersonationWhereInput } from "./ImpersonationWhereInput"; + +export type ImpersonationCountArgs = { + where?: ImpersonationWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCreateInput.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCreateInput.ts new file mode 100644 index 0000000..dddce8e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationCreateInput.ts @@ -0,0 +1,6 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type ImpersonationCreateInput = { + impersonatedUser: UserWhereUniqueInput; + impersonatedBy: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindManyArgs.ts new file mode 100644 index 0000000..019cdf4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindManyArgs.ts @@ -0,0 +1,9 @@ +import { ImpersonationWhereInput } from "./ImpersonationWhereInput"; +import { ImpersonationOrderByInput } from "./ImpersonationOrderByInput"; + +export type ImpersonationFindManyArgs = { + where?: ImpersonationWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindUniqueArgs.ts new file mode 100644 index 0000000..60514a3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { ImpersonationWhereUniqueInput } from "./ImpersonationWhereUniqueInput"; + +export type ImpersonationFindUniqueArgs = { + where: ImpersonationWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationListRelationFilter.ts new file mode 100644 index 0000000..ce5f2b7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationListRelationFilter.ts @@ -0,0 +1,7 @@ +import { ImpersonationWhereInput } from "./ImpersonationWhereInput"; + +export type ImpersonationListRelationFilter = { + every?: ImpersonationWhereInput; + some?: ImpersonationWhereInput; + none?: ImpersonationWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationOrderByInput.ts new file mode 100644 index 0000000..155cbfd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationOrderByInput.ts @@ -0,0 +1,8 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type ImpersonationOrderByInput = { + id?: SortOrder; + createdAt?: SortOrder; + impersonatedUserId?: SortOrder; + impersonatedById?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationUpdateInput.ts new file mode 100644 index 0000000..d56ee64 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationUpdateInput.ts @@ -0,0 +1,6 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type ImpersonationUpdateInput = { + impersonatedUser?: UserWhereUniqueInput; + impersonatedBy?: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereInput.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereInput.ts new file mode 100644 index 0000000..839e871 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereInput.ts @@ -0,0 +1,10 @@ +import { IntFilter } from "../../util/IntFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type ImpersonationWhereInput = { + id?: IntFilter; + createdAt?: DateTimeFilter; + impersonatedUser?: UserWhereUniqueInput; + impersonatedBy?: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereUniqueInput.ts new file mode 100644 index 0000000..c89a285 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/ImpersonationWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type ImpersonationWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/impersonation/UpdateImpersonationArgs.ts b/apps/roi-cacl-2-admin/src/api/impersonation/UpdateImpersonationArgs.ts new file mode 100644 index 0000000..5dd4593 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/impersonation/UpdateImpersonationArgs.ts @@ -0,0 +1,7 @@ +import { ImpersonationWhereUniqueInput } from "./ImpersonationWhereUniqueInput"; +import { ImpersonationUpdateInput } from "./ImpersonationUpdateInput"; + +export type UpdateImpersonationArgs = { + where: ImpersonationWhereUniqueInput; + data: ImpersonationUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/CreateMembershipArgs.ts b/apps/roi-cacl-2-admin/src/api/membership/CreateMembershipArgs.ts new file mode 100644 index 0000000..a699a94 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/CreateMembershipArgs.ts @@ -0,0 +1,5 @@ +import { MembershipCreateInput } from "./MembershipCreateInput"; + +export type CreateMembershipArgs = { + data: MembershipCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/DeleteMembershipArgs.ts b/apps/roi-cacl-2-admin/src/api/membership/DeleteMembershipArgs.ts new file mode 100644 index 0000000..b14cc95 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/DeleteMembershipArgs.ts @@ -0,0 +1,5 @@ +import { MembershipWhereUniqueInput } from "./MembershipWhereUniqueInput"; + +export type DeleteMembershipArgs = { + where: MembershipWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/EnumMembershipRole.ts b/apps/roi-cacl-2-admin/src/api/membership/EnumMembershipRole.ts new file mode 100644 index 0000000..b136675 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/EnumMembershipRole.ts @@ -0,0 +1,5 @@ +export enum EnumMembershipRole { + Member = "MEMBER", + Admin = "ADMIN", + Owner = "OWNER", +} diff --git a/apps/roi-cacl-2-admin/src/api/membership/Membership.ts b/apps/roi-cacl-2-admin/src/api/membership/Membership.ts new file mode 100644 index 0000000..4fbe28e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/Membership.ts @@ -0,0 +1,10 @@ +import { Team } from "../team/Team"; +import { User } from "../user/User"; + +export type Membership = { + id: number; + accepted: boolean; + role?: "MEMBER" | "ADMIN" | "OWNER"; + team?: Team; + user?: User; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipCountArgs.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipCountArgs.ts new file mode 100644 index 0000000..d77d7e6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipCountArgs.ts @@ -0,0 +1,5 @@ +import { MembershipWhereInput } from "./MembershipWhereInput"; + +export type MembershipCountArgs = { + where?: MembershipWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipCreateInput.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipCreateInput.ts new file mode 100644 index 0000000..0f4925a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipCreateInput.ts @@ -0,0 +1,9 @@ +import { TeamWhereUniqueInput } from "../team/TeamWhereUniqueInput"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type MembershipCreateInput = { + accepted: boolean; + role: "MEMBER" | "ADMIN" | "OWNER"; + team: TeamWhereUniqueInput; + user: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipFindManyArgs.ts new file mode 100644 index 0000000..95be8fa --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipFindManyArgs.ts @@ -0,0 +1,9 @@ +import { MembershipWhereInput } from "./MembershipWhereInput"; +import { MembershipOrderByInput } from "./MembershipOrderByInput"; + +export type MembershipFindManyArgs = { + where?: MembershipWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipFindUniqueArgs.ts new file mode 100644 index 0000000..d05edc4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { MembershipWhereUniqueInput } from "./MembershipWhereUniqueInput"; + +export type MembershipFindUniqueArgs = { + where: MembershipWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipListRelationFilter.ts new file mode 100644 index 0000000..330dfdf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipListRelationFilter.ts @@ -0,0 +1,7 @@ +import { MembershipWhereInput } from "./MembershipWhereInput"; + +export type MembershipListRelationFilter = { + every?: MembershipWhereInput; + some?: MembershipWhereInput; + none?: MembershipWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipOrderByInput.ts new file mode 100644 index 0000000..23ca313 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipOrderByInput.ts @@ -0,0 +1,9 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type MembershipOrderByInput = { + id?: SortOrder; + accepted?: SortOrder; + role?: SortOrder; + teamId?: SortOrder; + userId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipUpdateInput.ts new file mode 100644 index 0000000..6a0ba3a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipUpdateInput.ts @@ -0,0 +1,9 @@ +import { TeamWhereUniqueInput } from "../team/TeamWhereUniqueInput"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type MembershipUpdateInput = { + accepted?: boolean; + role?: "MEMBER" | "ADMIN" | "OWNER"; + team?: TeamWhereUniqueInput; + user?: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipWhereInput.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipWhereInput.ts new file mode 100644 index 0000000..98d4761 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipWhereInput.ts @@ -0,0 +1,12 @@ +import { IntFilter } from "../../util/IntFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { TeamWhereUniqueInput } from "../team/TeamWhereUniqueInput"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type MembershipWhereInput = { + id?: IntFilter; + accepted?: BooleanFilter; + role?: "MEMBER" | "ADMIN" | "OWNER"; + team?: TeamWhereUniqueInput; + user?: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/MembershipWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/membership/MembershipWhereUniqueInput.ts new file mode 100644 index 0000000..b14b5c5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/MembershipWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type MembershipWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/membership/UpdateMembershipArgs.ts b/apps/roi-cacl-2-admin/src/api/membership/UpdateMembershipArgs.ts new file mode 100644 index 0000000..b3d4a41 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/membership/UpdateMembershipArgs.ts @@ -0,0 +1,7 @@ +import { MembershipWhereUniqueInput } from "./MembershipWhereUniqueInput"; +import { MembershipUpdateInput } from "./MembershipUpdateInput"; + +export type UpdateMembershipArgs = { + where: MembershipWhereUniqueInput; + data: MembershipUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/CreatePaymentArgs.ts b/apps/roi-cacl-2-admin/src/api/payment/CreatePaymentArgs.ts new file mode 100644 index 0000000..386441a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/CreatePaymentArgs.ts @@ -0,0 +1,5 @@ +import { PaymentCreateInput } from "./PaymentCreateInput"; + +export type CreatePaymentArgs = { + data: PaymentCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/DeletePaymentArgs.ts b/apps/roi-cacl-2-admin/src/api/payment/DeletePaymentArgs.ts new file mode 100644 index 0000000..f8fa18d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/DeletePaymentArgs.ts @@ -0,0 +1,5 @@ +import { PaymentWhereUniqueInput } from "./PaymentWhereUniqueInput"; + +export type DeletePaymentArgs = { + where: PaymentWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/EnumPaymentType.ts b/apps/roi-cacl-2-admin/src/api/payment/EnumPaymentType.ts new file mode 100644 index 0000000..46e3466 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/EnumPaymentType.ts @@ -0,0 +1,3 @@ +export enum EnumPaymentType { + Stripe = "STRIPE", +} diff --git a/apps/roi-cacl-2-admin/src/api/payment/Payment.ts b/apps/roi-cacl-2-admin/src/api/payment/Payment.ts new file mode 100644 index 0000000..f80b4f1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/Payment.ts @@ -0,0 +1,16 @@ +import { Booking } from "../booking/Booking"; +import { JsonValue } from "type-fest"; + +export type Payment = { + id: number; + uid: string; + type?: "STRIPE"; + booking?: Booking | null; + amount: number; + fee: number; + currency: string; + success: boolean; + refunded: boolean; + data: JsonValue; + externalId: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentCountArgs.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentCountArgs.ts new file mode 100644 index 0000000..051e311 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentCountArgs.ts @@ -0,0 +1,5 @@ +import { PaymentWhereInput } from "./PaymentWhereInput"; + +export type PaymentCountArgs = { + where?: PaymentWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentCreateInput.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentCreateInput.ts new file mode 100644 index 0000000..c92a1db --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentCreateInput.ts @@ -0,0 +1,15 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { InputJsonValue } from "../../types"; + +export type PaymentCreateInput = { + uid: string; + type: "STRIPE"; + booking?: BookingWhereUniqueInput | null; + amount: number; + fee: number; + currency: string; + success: boolean; + refunded: boolean; + data: InputJsonValue; + externalId: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentFindManyArgs.ts new file mode 100644 index 0000000..0fe78ba --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentFindManyArgs.ts @@ -0,0 +1,9 @@ +import { PaymentWhereInput } from "./PaymentWhereInput"; +import { PaymentOrderByInput } from "./PaymentOrderByInput"; + +export type PaymentFindManyArgs = { + where?: PaymentWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentFindUniqueArgs.ts new file mode 100644 index 0000000..565bf68 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { PaymentWhereUniqueInput } from "./PaymentWhereUniqueInput"; + +export type PaymentFindUniqueArgs = { + where: PaymentWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentListRelationFilter.ts new file mode 100644 index 0000000..b1ee5a9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentListRelationFilter.ts @@ -0,0 +1,7 @@ +import { PaymentWhereInput } from "./PaymentWhereInput"; + +export type PaymentListRelationFilter = { + every?: PaymentWhereInput; + some?: PaymentWhereInput; + none?: PaymentWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentOrderByInput.ts new file mode 100644 index 0000000..c4567b7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentOrderByInput.ts @@ -0,0 +1,15 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type PaymentOrderByInput = { + id?: SortOrder; + uid?: SortOrder; + type?: SortOrder; + bookingId?: SortOrder; + amount?: SortOrder; + fee?: SortOrder; + currency?: SortOrder; + success?: SortOrder; + refunded?: SortOrder; + data?: SortOrder; + externalId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentUpdateInput.ts new file mode 100644 index 0000000..40124e2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentUpdateInput.ts @@ -0,0 +1,15 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { InputJsonValue } from "../../types"; + +export type PaymentUpdateInput = { + uid?: string; + type?: "STRIPE"; + booking?: BookingWhereUniqueInput | null; + amount?: number; + fee?: number; + currency?: string; + success?: boolean; + refunded?: boolean; + data?: InputJsonValue; + externalId?: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentWhereInput.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentWhereInput.ts new file mode 100644 index 0000000..6401e2d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentWhereInput.ts @@ -0,0 +1,19 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { JsonFilter } from "../../util/JsonFilter"; + +export type PaymentWhereInput = { + id?: IntFilter; + uid?: StringFilter; + type?: "STRIPE"; + booking?: BookingWhereUniqueInput; + amount?: IntFilter; + fee?: IntFilter; + currency?: StringFilter; + success?: BooleanFilter; + refunded?: BooleanFilter; + data?: JsonFilter; + externalId?: StringFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/PaymentWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/payment/PaymentWhereUniqueInput.ts new file mode 100644 index 0000000..2505747 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/PaymentWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type PaymentWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/payment/UpdatePaymentArgs.ts b/apps/roi-cacl-2-admin/src/api/payment/UpdatePaymentArgs.ts new file mode 100644 index 0000000..c2cf44e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/payment/UpdatePaymentArgs.ts @@ -0,0 +1,7 @@ +import { PaymentWhereUniqueInput } from "./PaymentWhereUniqueInput"; +import { PaymentUpdateInput } from "./PaymentUpdateInput"; + +export type UpdatePaymentArgs = { + where: PaymentWhereUniqueInput; + data: PaymentUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/CreateReminderMailArgs.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/CreateReminderMailArgs.ts new file mode 100644 index 0000000..57d320e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/CreateReminderMailArgs.ts @@ -0,0 +1,5 @@ +import { ReminderMailCreateInput } from "./ReminderMailCreateInput"; + +export type CreateReminderMailArgs = { + data: ReminderMailCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/DeleteReminderMailArgs.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/DeleteReminderMailArgs.ts new file mode 100644 index 0000000..6c0a592 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/DeleteReminderMailArgs.ts @@ -0,0 +1,5 @@ +import { ReminderMailWhereUniqueInput } from "./ReminderMailWhereUniqueInput"; + +export type DeleteReminderMailArgs = { + where: ReminderMailWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/EnumReminderMailReminderType.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/EnumReminderMailReminderType.ts new file mode 100644 index 0000000..fb8bb41 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/EnumReminderMailReminderType.ts @@ -0,0 +1,3 @@ +export enum EnumReminderMailReminderType { + PendingBookingConfirmation = "PENDING_BOOKING_CONFIRMATION", +} diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMail.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMail.ts new file mode 100644 index 0000000..c4e8b0c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMail.ts @@ -0,0 +1,7 @@ +export type ReminderMail = { + id: number; + referenceId: number; + reminderType?: "PENDING_BOOKING_CONFIRMATION"; + elapsedMinutes: number; + createdAt: Date; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCountArgs.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCountArgs.ts new file mode 100644 index 0000000..f3bf645 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCountArgs.ts @@ -0,0 +1,5 @@ +import { ReminderMailWhereInput } from "./ReminderMailWhereInput"; + +export type ReminderMailCountArgs = { + where?: ReminderMailWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCreateInput.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCreateInput.ts new file mode 100644 index 0000000..f3a9b7a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailCreateInput.ts @@ -0,0 +1,5 @@ +export type ReminderMailCreateInput = { + referenceId: number; + reminderType: "PENDING_BOOKING_CONFIRMATION"; + elapsedMinutes: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindManyArgs.ts new file mode 100644 index 0000000..564cdd5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindManyArgs.ts @@ -0,0 +1,9 @@ +import { ReminderMailWhereInput } from "./ReminderMailWhereInput"; +import { ReminderMailOrderByInput } from "./ReminderMailOrderByInput"; + +export type ReminderMailFindManyArgs = { + where?: ReminderMailWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindUniqueArgs.ts new file mode 100644 index 0000000..4bf805d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { ReminderMailWhereUniqueInput } from "./ReminderMailWhereUniqueInput"; + +export type ReminderMailFindUniqueArgs = { + where: ReminderMailWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailListRelationFilter.ts new file mode 100644 index 0000000..489a4b2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailListRelationFilter.ts @@ -0,0 +1,7 @@ +import { ReminderMailWhereInput } from "./ReminderMailWhereInput"; + +export type ReminderMailListRelationFilter = { + every?: ReminderMailWhereInput; + some?: ReminderMailWhereInput; + none?: ReminderMailWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailOrderByInput.ts new file mode 100644 index 0000000..53abe32 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailOrderByInput.ts @@ -0,0 +1,9 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type ReminderMailOrderByInput = { + id?: SortOrder; + referenceId?: SortOrder; + reminderType?: SortOrder; + elapsedMinutes?: SortOrder; + createdAt?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailUpdateInput.ts new file mode 100644 index 0000000..5ea9b68 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailUpdateInput.ts @@ -0,0 +1,5 @@ +export type ReminderMailUpdateInput = { + referenceId?: number; + reminderType?: "PENDING_BOOKING_CONFIRMATION"; + elapsedMinutes?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereInput.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereInput.ts new file mode 100644 index 0000000..334e0d6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereInput.ts @@ -0,0 +1,10 @@ +import { IntFilter } from "../../util/IntFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; + +export type ReminderMailWhereInput = { + id?: IntFilter; + referenceId?: IntFilter; + reminderType?: "PENDING_BOOKING_CONFIRMATION"; + elapsedMinutes?: IntFilter; + createdAt?: DateTimeFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereUniqueInput.ts new file mode 100644 index 0000000..e5488cf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/ReminderMailWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type ReminderMailWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/reminderMail/UpdateReminderMailArgs.ts b/apps/roi-cacl-2-admin/src/api/reminderMail/UpdateReminderMailArgs.ts new file mode 100644 index 0000000..3e071d9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/reminderMail/UpdateReminderMailArgs.ts @@ -0,0 +1,7 @@ +import { ReminderMailWhereUniqueInput } from "./ReminderMailWhereUniqueInput"; +import { ReminderMailUpdateInput } from "./ReminderMailUpdateInput"; + +export type UpdateReminderMailArgs = { + where: ReminderMailWhereUniqueInput; + data: ReminderMailUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/CreateResetPasswordRequestArgs.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/CreateResetPasswordRequestArgs.ts new file mode 100644 index 0000000..200551b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/CreateResetPasswordRequestArgs.ts @@ -0,0 +1,5 @@ +import { ResetPasswordRequestCreateInput } from "./ResetPasswordRequestCreateInput"; + +export type CreateResetPasswordRequestArgs = { + data: ResetPasswordRequestCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/DeleteResetPasswordRequestArgs.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/DeleteResetPasswordRequestArgs.ts new file mode 100644 index 0000000..de014a9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/DeleteResetPasswordRequestArgs.ts @@ -0,0 +1,5 @@ +import { ResetPasswordRequestWhereUniqueInput } from "./ResetPasswordRequestWhereUniqueInput"; + +export type DeleteResetPasswordRequestArgs = { + where: ResetPasswordRequestWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequest.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequest.ts new file mode 100644 index 0000000..a313c2f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequest.ts @@ -0,0 +1,7 @@ +export type ResetPasswordRequest = { + id: string; + createdAt: Date; + updatedAt: Date; + email: string; + expires: Date; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCountArgs.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCountArgs.ts new file mode 100644 index 0000000..7e791de --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCountArgs.ts @@ -0,0 +1,5 @@ +import { ResetPasswordRequestWhereInput } from "./ResetPasswordRequestWhereInput"; + +export type ResetPasswordRequestCountArgs = { + where?: ResetPasswordRequestWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCreateInput.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCreateInput.ts new file mode 100644 index 0000000..4a14552 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestCreateInput.ts @@ -0,0 +1,4 @@ +export type ResetPasswordRequestCreateInput = { + email: string; + expires: Date; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindManyArgs.ts new file mode 100644 index 0000000..9699a37 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindManyArgs.ts @@ -0,0 +1,9 @@ +import { ResetPasswordRequestWhereInput } from "./ResetPasswordRequestWhereInput"; +import { ResetPasswordRequestOrderByInput } from "./ResetPasswordRequestOrderByInput"; + +export type ResetPasswordRequestFindManyArgs = { + where?: ResetPasswordRequestWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindUniqueArgs.ts new file mode 100644 index 0000000..ecaf912 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { ResetPasswordRequestWhereUniqueInput } from "./ResetPasswordRequestWhereUniqueInput"; + +export type ResetPasswordRequestFindUniqueArgs = { + where: ResetPasswordRequestWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestListRelationFilter.ts new file mode 100644 index 0000000..6385fca --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestListRelationFilter.ts @@ -0,0 +1,7 @@ +import { ResetPasswordRequestWhereInput } from "./ResetPasswordRequestWhereInput"; + +export type ResetPasswordRequestListRelationFilter = { + every?: ResetPasswordRequestWhereInput; + some?: ResetPasswordRequestWhereInput; + none?: ResetPasswordRequestWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestOrderByInput.ts new file mode 100644 index 0000000..9d27e13 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestOrderByInput.ts @@ -0,0 +1,9 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type ResetPasswordRequestOrderByInput = { + id?: SortOrder; + createdAt?: SortOrder; + updatedAt?: SortOrder; + email?: SortOrder; + expires?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestUpdateInput.ts new file mode 100644 index 0000000..f2d4b74 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestUpdateInput.ts @@ -0,0 +1,4 @@ +export type ResetPasswordRequestUpdateInput = { + email?: string; + expires?: Date; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereInput.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereInput.ts new file mode 100644 index 0000000..5a3a15d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereInput.ts @@ -0,0 +1,10 @@ +import { StringFilter } from "../../util/StringFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; + +export type ResetPasswordRequestWhereInput = { + id?: StringFilter; + createdAt?: DateTimeFilter; + updatedAt?: DateTimeFilter; + email?: StringFilter; + expires?: DateTimeFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereUniqueInput.ts new file mode 100644 index 0000000..ad6a5c7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/ResetPasswordRequestWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type ResetPasswordRequestWhereUniqueInput = { + id: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/UpdateResetPasswordRequestArgs.ts b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/UpdateResetPasswordRequestArgs.ts new file mode 100644 index 0000000..6f916e3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/resetPasswordRequest/UpdateResetPasswordRequestArgs.ts @@ -0,0 +1,7 @@ +import { ResetPasswordRequestWhereUniqueInput } from "./ResetPasswordRequestWhereUniqueInput"; +import { ResetPasswordRequestUpdateInput } from "./ResetPasswordRequestUpdateInput"; + +export type UpdateResetPasswordRequestArgs = { + where: ResetPasswordRequestWhereUniqueInput; + data: ResetPasswordRequestUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/AvailabilityCreateNestedManyWithoutSchedulesInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/AvailabilityCreateNestedManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..cd81580 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/AvailabilityCreateNestedManyWithoutSchedulesInput.ts @@ -0,0 +1,5 @@ +import { AvailabilityWhereUniqueInput } from "../availability/AvailabilityWhereUniqueInput"; + +export type AvailabilityCreateNestedManyWithoutSchedulesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/AvailabilityUpdateManyWithoutSchedulesInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/AvailabilityUpdateManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..3d6ee09 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/AvailabilityUpdateManyWithoutSchedulesInput.ts @@ -0,0 +1,7 @@ +import { AvailabilityWhereUniqueInput } from "../availability/AvailabilityWhereUniqueInput"; + +export type AvailabilityUpdateManyWithoutSchedulesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/CreateScheduleArgs.ts b/apps/roi-cacl-2-admin/src/api/schedule/CreateScheduleArgs.ts new file mode 100644 index 0000000..8677414 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/CreateScheduleArgs.ts @@ -0,0 +1,5 @@ +import { ScheduleCreateInput } from "./ScheduleCreateInput"; + +export type CreateScheduleArgs = { + data: ScheduleCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/DeleteScheduleArgs.ts b/apps/roi-cacl-2-admin/src/api/schedule/DeleteScheduleArgs.ts new file mode 100644 index 0000000..87e9f38 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/DeleteScheduleArgs.ts @@ -0,0 +1,5 @@ +import { ScheduleWhereUniqueInput } from "./ScheduleWhereUniqueInput"; + +export type DeleteScheduleArgs = { + where: ScheduleWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/EventTypeCreateNestedManyWithoutSchedulesInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/EventTypeCreateNestedManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..87ccb5a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/EventTypeCreateNestedManyWithoutSchedulesInput.ts @@ -0,0 +1,5 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeCreateNestedManyWithoutSchedulesInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/EventTypeUpdateManyWithoutSchedulesInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/EventTypeUpdateManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..6a90c54 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/EventTypeUpdateManyWithoutSchedulesInput.ts @@ -0,0 +1,7 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeUpdateManyWithoutSchedulesInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/Schedule.ts b/apps/roi-cacl-2-admin/src/api/schedule/Schedule.ts new file mode 100644 index 0000000..ad10237 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/Schedule.ts @@ -0,0 +1,12 @@ +import { User } from "../user/User"; +import { EventType } from "../eventType/EventType"; +import { Availability } from "../availability/Availability"; + +export type Schedule = { + id: number; + user?: User; + name: string; + timeZone: string | null; + eventType?: Array; + availability?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleCountArgs.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleCountArgs.ts new file mode 100644 index 0000000..b3f9753 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleCountArgs.ts @@ -0,0 +1,5 @@ +import { ScheduleWhereInput } from "./ScheduleWhereInput"; + +export type ScheduleCountArgs = { + where?: ScheduleWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleCreateInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleCreateInput.ts new file mode 100644 index 0000000..77872f5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleCreateInput.ts @@ -0,0 +1,11 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeCreateNestedManyWithoutSchedulesInput } from "./EventTypeCreateNestedManyWithoutSchedulesInput"; +import { AvailabilityCreateNestedManyWithoutSchedulesInput } from "./AvailabilityCreateNestedManyWithoutSchedulesInput"; + +export type ScheduleCreateInput = { + user: UserWhereUniqueInput; + name: string; + timeZone?: string | null; + eventType?: EventTypeCreateNestedManyWithoutSchedulesInput; + availability?: AvailabilityCreateNestedManyWithoutSchedulesInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindManyArgs.ts new file mode 100644 index 0000000..fa3e125 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindManyArgs.ts @@ -0,0 +1,9 @@ +import { ScheduleWhereInput } from "./ScheduleWhereInput"; +import { ScheduleOrderByInput } from "./ScheduleOrderByInput"; + +export type ScheduleFindManyArgs = { + where?: ScheduleWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindUniqueArgs.ts new file mode 100644 index 0000000..c11256d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { ScheduleWhereUniqueInput } from "./ScheduleWhereUniqueInput"; + +export type ScheduleFindUniqueArgs = { + where: ScheduleWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleListRelationFilter.ts new file mode 100644 index 0000000..795a36e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleListRelationFilter.ts @@ -0,0 +1,7 @@ +import { ScheduleWhereInput } from "./ScheduleWhereInput"; + +export type ScheduleListRelationFilter = { + every?: ScheduleWhereInput; + some?: ScheduleWhereInput; + none?: ScheduleWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleOrderByInput.ts new file mode 100644 index 0000000..b621096 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleOrderByInput.ts @@ -0,0 +1,8 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type ScheduleOrderByInput = { + id?: SortOrder; + userId?: SortOrder; + name?: SortOrder; + timeZone?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleUpdateInput.ts new file mode 100644 index 0000000..d7e3061 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleUpdateInput.ts @@ -0,0 +1,11 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeUpdateManyWithoutSchedulesInput } from "./EventTypeUpdateManyWithoutSchedulesInput"; +import { AvailabilityUpdateManyWithoutSchedulesInput } from "./AvailabilityUpdateManyWithoutSchedulesInput"; + +export type ScheduleUpdateInput = { + user?: UserWhereUniqueInput; + name?: string; + timeZone?: string | null; + eventType?: EventTypeUpdateManyWithoutSchedulesInput; + availability?: AvailabilityUpdateManyWithoutSchedulesInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereInput.ts new file mode 100644 index 0000000..e73ab87 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereInput.ts @@ -0,0 +1,15 @@ +import { IntFilter } from "../../util/IntFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { EventTypeListRelationFilter } from "../eventType/EventTypeListRelationFilter"; +import { AvailabilityListRelationFilter } from "../availability/AvailabilityListRelationFilter"; + +export type ScheduleWhereInput = { + id?: IntFilter; + user?: UserWhereUniqueInput; + name?: StringFilter; + timeZone?: StringNullableFilter; + eventType?: EventTypeListRelationFilter; + availability?: AvailabilityListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereUniqueInput.ts new file mode 100644 index 0000000..c716edf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/ScheduleWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type ScheduleWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/schedule/UpdateScheduleArgs.ts b/apps/roi-cacl-2-admin/src/api/schedule/UpdateScheduleArgs.ts new file mode 100644 index 0000000..092f441 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/schedule/UpdateScheduleArgs.ts @@ -0,0 +1,7 @@ +import { ScheduleWhereUniqueInput } from "./ScheduleWhereUniqueInput"; +import { ScheduleUpdateInput } from "./ScheduleUpdateInput"; + +export type UpdateScheduleArgs = { + where: ScheduleWhereUniqueInput; + data: ScheduleUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/CreateSelectedCalendarArgs.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/CreateSelectedCalendarArgs.ts new file mode 100644 index 0000000..7702971 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/CreateSelectedCalendarArgs.ts @@ -0,0 +1,5 @@ +import { SelectedCalendarCreateInput } from "./SelectedCalendarCreateInput"; + +export type CreateSelectedCalendarArgs = { + data: SelectedCalendarCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/DeleteSelectedCalendarArgs.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/DeleteSelectedCalendarArgs.ts new file mode 100644 index 0000000..631f01f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/DeleteSelectedCalendarArgs.ts @@ -0,0 +1,5 @@ +import { SelectedCalendarWhereUniqueInput } from "./SelectedCalendarWhereUniqueInput"; + +export type DeleteSelectedCalendarArgs = { + where: SelectedCalendarWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendar.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendar.ts new file mode 100644 index 0000000..fd5437c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendar.ts @@ -0,0 +1,8 @@ +import { User } from "../user/User"; + +export type SelectedCalendar = { + id: number; + user?: User; + integration: string; + externalId: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCountArgs.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCountArgs.ts new file mode 100644 index 0000000..9eb8f95 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCountArgs.ts @@ -0,0 +1,5 @@ +import { SelectedCalendarWhereInput } from "./SelectedCalendarWhereInput"; + +export type SelectedCalendarCountArgs = { + where?: SelectedCalendarWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCreateInput.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCreateInput.ts new file mode 100644 index 0000000..10fe1f3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarCreateInput.ts @@ -0,0 +1,7 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type SelectedCalendarCreateInput = { + user: UserWhereUniqueInput; + integration: string; + externalId: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindManyArgs.ts new file mode 100644 index 0000000..cd3e4de --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindManyArgs.ts @@ -0,0 +1,9 @@ +import { SelectedCalendarWhereInput } from "./SelectedCalendarWhereInput"; +import { SelectedCalendarOrderByInput } from "./SelectedCalendarOrderByInput"; + +export type SelectedCalendarFindManyArgs = { + where?: SelectedCalendarWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindUniqueArgs.ts new file mode 100644 index 0000000..8053a2e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { SelectedCalendarWhereUniqueInput } from "./SelectedCalendarWhereUniqueInput"; + +export type SelectedCalendarFindUniqueArgs = { + where: SelectedCalendarWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarListRelationFilter.ts new file mode 100644 index 0000000..d3e468c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarListRelationFilter.ts @@ -0,0 +1,7 @@ +import { SelectedCalendarWhereInput } from "./SelectedCalendarWhereInput"; + +export type SelectedCalendarListRelationFilter = { + every?: SelectedCalendarWhereInput; + some?: SelectedCalendarWhereInput; + none?: SelectedCalendarWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarOrderByInput.ts new file mode 100644 index 0000000..a2a5965 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarOrderByInput.ts @@ -0,0 +1,8 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type SelectedCalendarOrderByInput = { + id?: SortOrder; + userId?: SortOrder; + integration?: SortOrder; + externalId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarUpdateInput.ts new file mode 100644 index 0000000..86e08c1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarUpdateInput.ts @@ -0,0 +1,7 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type SelectedCalendarUpdateInput = { + user?: UserWhereUniqueInput; + integration?: string; + externalId?: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereInput.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereInput.ts new file mode 100644 index 0000000..9f8bf40 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereInput.ts @@ -0,0 +1,10 @@ +import { IntFilter } from "../../util/IntFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; + +export type SelectedCalendarWhereInput = { + id?: IntFilter; + user?: UserWhereUniqueInput; + integration?: StringFilter; + externalId?: StringFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereUniqueInput.ts new file mode 100644 index 0000000..ad9157e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/SelectedCalendarWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type SelectedCalendarWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/selectedCalendar/UpdateSelectedCalendarArgs.ts b/apps/roi-cacl-2-admin/src/api/selectedCalendar/UpdateSelectedCalendarArgs.ts new file mode 100644 index 0000000..7fd8b2f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/selectedCalendar/UpdateSelectedCalendarArgs.ts @@ -0,0 +1,7 @@ +import { SelectedCalendarWhereUniqueInput } from "./SelectedCalendarWhereUniqueInput"; +import { SelectedCalendarUpdateInput } from "./SelectedCalendarUpdateInput"; + +export type UpdateSelectedCalendarArgs = { + where: SelectedCalendarWhereUniqueInput; + data: SelectedCalendarUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/CreateSessionArgs.ts b/apps/roi-cacl-2-admin/src/api/session/CreateSessionArgs.ts new file mode 100644 index 0000000..7a51e01 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/CreateSessionArgs.ts @@ -0,0 +1,5 @@ +import { SessionCreateInput } from "./SessionCreateInput"; + +export type CreateSessionArgs = { + data: SessionCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/DeleteSessionArgs.ts b/apps/roi-cacl-2-admin/src/api/session/DeleteSessionArgs.ts new file mode 100644 index 0000000..3a5cb5e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/DeleteSessionArgs.ts @@ -0,0 +1,5 @@ +import { SessionWhereUniqueInput } from "./SessionWhereUniqueInput"; + +export type DeleteSessionArgs = { + where: SessionWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/Session.ts b/apps/roi-cacl-2-admin/src/api/session/Session.ts new file mode 100644 index 0000000..8ec51f7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/Session.ts @@ -0,0 +1,8 @@ +import { User } from "../user/User"; + +export type Session = { + id: string; + sessionToken: string; + expires: Date; + user?: User | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionCountArgs.ts b/apps/roi-cacl-2-admin/src/api/session/SessionCountArgs.ts new file mode 100644 index 0000000..ca5d0b4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionCountArgs.ts @@ -0,0 +1,5 @@ +import { SessionWhereInput } from "./SessionWhereInput"; + +export type SessionCountArgs = { + where?: SessionWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionCreateInput.ts b/apps/roi-cacl-2-admin/src/api/session/SessionCreateInput.ts new file mode 100644 index 0000000..8574801 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionCreateInput.ts @@ -0,0 +1,7 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type SessionCreateInput = { + sessionToken: string; + expires: Date; + user?: UserWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/session/SessionFindManyArgs.ts new file mode 100644 index 0000000..ad0fa97 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionFindManyArgs.ts @@ -0,0 +1,9 @@ +import { SessionWhereInput } from "./SessionWhereInput"; +import { SessionOrderByInput } from "./SessionOrderByInput"; + +export type SessionFindManyArgs = { + where?: SessionWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/session/SessionFindUniqueArgs.ts new file mode 100644 index 0000000..cb88ff6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { SessionWhereUniqueInput } from "./SessionWhereUniqueInput"; + +export type SessionFindUniqueArgs = { + where: SessionWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/session/SessionListRelationFilter.ts new file mode 100644 index 0000000..6c1bac9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionListRelationFilter.ts @@ -0,0 +1,7 @@ +import { SessionWhereInput } from "./SessionWhereInput"; + +export type SessionListRelationFilter = { + every?: SessionWhereInput; + some?: SessionWhereInput; + none?: SessionWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/session/SessionOrderByInput.ts new file mode 100644 index 0000000..d9186f7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionOrderByInput.ts @@ -0,0 +1,8 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type SessionOrderByInput = { + id?: SortOrder; + sessionToken?: SortOrder; + expires?: SortOrder; + userId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/session/SessionUpdateInput.ts new file mode 100644 index 0000000..47c9e72 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionUpdateInput.ts @@ -0,0 +1,7 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type SessionUpdateInput = { + sessionToken?: string; + expires?: Date; + user?: UserWhereUniqueInput | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionWhereInput.ts b/apps/roi-cacl-2-admin/src/api/session/SessionWhereInput.ts new file mode 100644 index 0000000..fd17a8a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionWhereInput.ts @@ -0,0 +1,10 @@ +import { StringFilter } from "../../util/StringFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; + +export type SessionWhereInput = { + id?: StringFilter; + sessionToken?: StringFilter; + expires?: DateTimeFilter; + user?: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/SessionWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/session/SessionWhereUniqueInput.ts new file mode 100644 index 0000000..c0f95f6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/SessionWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type SessionWhereUniqueInput = { + id: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/session/UpdateSessionArgs.ts b/apps/roi-cacl-2-admin/src/api/session/UpdateSessionArgs.ts new file mode 100644 index 0000000..135ce69 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/session/UpdateSessionArgs.ts @@ -0,0 +1,7 @@ +import { SessionWhereUniqueInput } from "./SessionWhereUniqueInput"; +import { SessionUpdateInput } from "./SessionUpdateInput"; + +export type UpdateSessionArgs = { + where: SessionWhereUniqueInput; + data: SessionUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/CreateTeamArgs.ts b/apps/roi-cacl-2-admin/src/api/team/CreateTeamArgs.ts new file mode 100644 index 0000000..c566546 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/CreateTeamArgs.ts @@ -0,0 +1,5 @@ +import { TeamCreateInput } from "./TeamCreateInput"; + +export type CreateTeamArgs = { + data: TeamCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/DeleteTeamArgs.ts b/apps/roi-cacl-2-admin/src/api/team/DeleteTeamArgs.ts new file mode 100644 index 0000000..172109e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/DeleteTeamArgs.ts @@ -0,0 +1,5 @@ +import { TeamWhereUniqueInput } from "./TeamWhereUniqueInput"; + +export type DeleteTeamArgs = { + where: TeamWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/EventTypeCreateNestedManyWithoutTeamsInput.ts b/apps/roi-cacl-2-admin/src/api/team/EventTypeCreateNestedManyWithoutTeamsInput.ts new file mode 100644 index 0000000..78f6c81 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/EventTypeCreateNestedManyWithoutTeamsInput.ts @@ -0,0 +1,5 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeCreateNestedManyWithoutTeamsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/EventTypeUpdateManyWithoutTeamsInput.ts b/apps/roi-cacl-2-admin/src/api/team/EventTypeUpdateManyWithoutTeamsInput.ts new file mode 100644 index 0000000..ebd4d2c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/EventTypeUpdateManyWithoutTeamsInput.ts @@ -0,0 +1,7 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeUpdateManyWithoutTeamsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/MembershipCreateNestedManyWithoutTeamsInput.ts b/apps/roi-cacl-2-admin/src/api/team/MembershipCreateNestedManyWithoutTeamsInput.ts new file mode 100644 index 0000000..f9f4c1f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/MembershipCreateNestedManyWithoutTeamsInput.ts @@ -0,0 +1,5 @@ +import { MembershipWhereUniqueInput } from "../membership/MembershipWhereUniqueInput"; + +export type MembershipCreateNestedManyWithoutTeamsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/MembershipUpdateManyWithoutTeamsInput.ts b/apps/roi-cacl-2-admin/src/api/team/MembershipUpdateManyWithoutTeamsInput.ts new file mode 100644 index 0000000..d592e5d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/MembershipUpdateManyWithoutTeamsInput.ts @@ -0,0 +1,7 @@ +import { MembershipWhereUniqueInput } from "../membership/MembershipWhereUniqueInput"; + +export type MembershipUpdateManyWithoutTeamsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/Team.ts b/apps/roi-cacl-2-admin/src/api/team/Team.ts new file mode 100644 index 0000000..9b966cc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/Team.ts @@ -0,0 +1,13 @@ +import { EventType } from "../eventType/EventType"; +import { Membership } from "../membership/Membership"; + +export type Team = { + id: number; + name: string | null; + slug: string | null; + logo: string | null; + bio: string | null; + hideBranding: boolean; + eventTypes?: Array; + members?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamCountArgs.ts b/apps/roi-cacl-2-admin/src/api/team/TeamCountArgs.ts new file mode 100644 index 0000000..9cdfb81 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamCountArgs.ts @@ -0,0 +1,5 @@ +import { TeamWhereInput } from "./TeamWhereInput"; + +export type TeamCountArgs = { + where?: TeamWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamCreateInput.ts b/apps/roi-cacl-2-admin/src/api/team/TeamCreateInput.ts new file mode 100644 index 0000000..9c6f2e6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamCreateInput.ts @@ -0,0 +1,12 @@ +import { EventTypeCreateNestedManyWithoutTeamsInput } from "./EventTypeCreateNestedManyWithoutTeamsInput"; +import { MembershipCreateNestedManyWithoutTeamsInput } from "./MembershipCreateNestedManyWithoutTeamsInput"; + +export type TeamCreateInput = { + name?: string | null; + slug?: string | null; + logo?: string | null; + bio?: string | null; + hideBranding: boolean; + eventTypes?: EventTypeCreateNestedManyWithoutTeamsInput; + members?: MembershipCreateNestedManyWithoutTeamsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/team/TeamFindManyArgs.ts new file mode 100644 index 0000000..5eeca43 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamFindManyArgs.ts @@ -0,0 +1,9 @@ +import { TeamWhereInput } from "./TeamWhereInput"; +import { TeamOrderByInput } from "./TeamOrderByInput"; + +export type TeamFindManyArgs = { + where?: TeamWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/team/TeamFindUniqueArgs.ts new file mode 100644 index 0000000..15d7783 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { TeamWhereUniqueInput } from "./TeamWhereUniqueInput"; + +export type TeamFindUniqueArgs = { + where: TeamWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/team/TeamListRelationFilter.ts new file mode 100644 index 0000000..a002102 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamListRelationFilter.ts @@ -0,0 +1,7 @@ +import { TeamWhereInput } from "./TeamWhereInput"; + +export type TeamListRelationFilter = { + every?: TeamWhereInput; + some?: TeamWhereInput; + none?: TeamWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/team/TeamOrderByInput.ts new file mode 100644 index 0000000..01d0c6f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamOrderByInput.ts @@ -0,0 +1,10 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type TeamOrderByInput = { + id?: SortOrder; + name?: SortOrder; + slug?: SortOrder; + logo?: SortOrder; + bio?: SortOrder; + hideBranding?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/team/TeamUpdateInput.ts new file mode 100644 index 0000000..0097511 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamUpdateInput.ts @@ -0,0 +1,12 @@ +import { EventTypeUpdateManyWithoutTeamsInput } from "./EventTypeUpdateManyWithoutTeamsInput"; +import { MembershipUpdateManyWithoutTeamsInput } from "./MembershipUpdateManyWithoutTeamsInput"; + +export type TeamUpdateInput = { + name?: string | null; + slug?: string | null; + logo?: string | null; + bio?: string | null; + hideBranding?: boolean; + eventTypes?: EventTypeUpdateManyWithoutTeamsInput; + members?: MembershipUpdateManyWithoutTeamsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamWhereInput.ts b/apps/roi-cacl-2-admin/src/api/team/TeamWhereInput.ts new file mode 100644 index 0000000..a2feb0d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamWhereInput.ts @@ -0,0 +1,16 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { EventTypeListRelationFilter } from "../eventType/EventTypeListRelationFilter"; +import { MembershipListRelationFilter } from "../membership/MembershipListRelationFilter"; + +export type TeamWhereInput = { + id?: IntFilter; + name?: StringNullableFilter; + slug?: StringNullableFilter; + logo?: StringNullableFilter; + bio?: StringNullableFilter; + hideBranding?: BooleanFilter; + eventTypes?: EventTypeListRelationFilter; + members?: MembershipListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/TeamWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/team/TeamWhereUniqueInput.ts new file mode 100644 index 0000000..2e7b8de --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/TeamWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type TeamWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/team/UpdateTeamArgs.ts b/apps/roi-cacl-2-admin/src/api/team/UpdateTeamArgs.ts new file mode 100644 index 0000000..1249932 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/team/UpdateTeamArgs.ts @@ -0,0 +1,7 @@ +import { TeamWhereUniqueInput } from "./TeamWhereUniqueInput"; +import { TeamUpdateInput } from "./TeamUpdateInput"; + +export type UpdateTeamArgs = { + where: TeamWhereUniqueInput; + data: TeamUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/AccountCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/AccountCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..4232ab9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/AccountCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { AccountWhereUniqueInput } from "../account/AccountWhereUniqueInput"; + +export type AccountCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/AccountUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/AccountUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..4c1b189 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/AccountUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { AccountWhereUniqueInput } from "../account/AccountWhereUniqueInput"; + +export type AccountUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/ApiKeyCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/ApiKeyCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..496f664 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/ApiKeyCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { ApiKeyWhereUniqueInput } from "../apiKey/ApiKeyWhereUniqueInput"; + +export type ApiKeyCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/ApiKeyUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/ApiKeyUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..15c2106 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/ApiKeyUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { ApiKeyWhereUniqueInput } from "../apiKey/ApiKeyWhereUniqueInput"; + +export type ApiKeyUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/AvailabilityCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/AvailabilityCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..d91cc19 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/AvailabilityCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { AvailabilityWhereUniqueInput } from "../availability/AvailabilityWhereUniqueInput"; + +export type AvailabilityCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/AvailabilityUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/AvailabilityUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..a502742 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/AvailabilityUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { AvailabilityWhereUniqueInput } from "../availability/AvailabilityWhereUniqueInput"; + +export type AvailabilityUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/BookingCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/BookingCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..ca3a4b7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/BookingCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type BookingCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/BookingUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/BookingUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..373b4e6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/BookingUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; + +export type BookingUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/CreateUserArgs.ts b/apps/roi-cacl-2-admin/src/api/user/CreateUserArgs.ts new file mode 100644 index 0000000..2a56f0c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/CreateUserArgs.ts @@ -0,0 +1,5 @@ +import { UserCreateInput } from "./UserCreateInput"; + +export type CreateUserArgs = { + data: UserCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/CredentialCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/CredentialCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..955b5bf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/CredentialCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { CredentialWhereUniqueInput } from "../credential/CredentialWhereUniqueInput"; + +export type CredentialCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/CredentialUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/CredentialUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..9f57324 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/CredentialUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { CredentialWhereUniqueInput } from "../credential/CredentialWhereUniqueInput"; + +export type CredentialUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/DeleteUserArgs.ts b/apps/roi-cacl-2-admin/src/api/user/DeleteUserArgs.ts new file mode 100644 index 0000000..5f655b8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/DeleteUserArgs.ts @@ -0,0 +1,5 @@ +import { UserWhereUniqueInput } from "./UserWhereUniqueInput"; + +export type DeleteUserArgs = { + where: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/EnumUserIdentityProvider.ts b/apps/roi-cacl-2-admin/src/api/user/EnumUserIdentityProvider.ts new file mode 100644 index 0000000..1a3c5c5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/EnumUserIdentityProvider.ts @@ -0,0 +1,5 @@ +export enum EnumUserIdentityProvider { + Cal = "CAL", + Google = "GOOGLE", + Saml = "SAML", +} diff --git a/apps/roi-cacl-2-admin/src/api/user/EnumUserPlan.ts b/apps/roi-cacl-2-admin/src/api/user/EnumUserPlan.ts new file mode 100644 index 0000000..c281145 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/EnumUserPlan.ts @@ -0,0 +1,5 @@ +export enum EnumUserPlan { + Free = "FREE", + Trial = "TRIAL", + Pro = "PRO", +} diff --git a/apps/roi-cacl-2-admin/src/api/user/EnumUserRole.ts b/apps/roi-cacl-2-admin/src/api/user/EnumUserRole.ts new file mode 100644 index 0000000..cda5791 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/EnumUserRole.ts @@ -0,0 +1,6 @@ +import { User } from "./User"; + +export enum EnumUserRole { + User = "USER", + Admin = "ADMIN", +} diff --git a/apps/roi-cacl-2-admin/src/api/user/EventTypeCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/EventTypeCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..7be098e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/EventTypeCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/EventTypeUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/EventTypeUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..bfca395 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/EventTypeUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type EventTypeUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/FeedbackCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/FeedbackCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..efafa99 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/FeedbackCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { FeedbackWhereUniqueInput } from "../feedback/FeedbackWhereUniqueInput"; + +export type FeedbackCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/FeedbackUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/FeedbackUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..47ef864 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/FeedbackUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { FeedbackWhereUniqueInput } from "../feedback/FeedbackWhereUniqueInput"; + +export type FeedbackUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/ImpersonationCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/ImpersonationCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..4d3ae12 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/ImpersonationCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { ImpersonationWhereUniqueInput } from "../impersonation/ImpersonationWhereUniqueInput"; + +export type ImpersonationCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/ImpersonationUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/ImpersonationUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..bb201bf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/ImpersonationUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { ImpersonationWhereUniqueInput } from "../impersonation/ImpersonationWhereUniqueInput"; + +export type ImpersonationUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/MembershipCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/MembershipCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..95779ba --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/MembershipCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { MembershipWhereUniqueInput } from "../membership/MembershipWhereUniqueInput"; + +export type MembershipCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/MembershipUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/MembershipUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..483e39b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/MembershipUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { MembershipWhereUniqueInput } from "../membership/MembershipWhereUniqueInput"; + +export type MembershipUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/ScheduleCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/ScheduleCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..2593ec6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/ScheduleCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; + +export type ScheduleCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/ScheduleUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/ScheduleUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..f512d21 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/ScheduleUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { ScheduleWhereUniqueInput } from "../schedule/ScheduleWhereUniqueInput"; + +export type ScheduleUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/SelectedCalendarCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/SelectedCalendarCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..2fd91a5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/SelectedCalendarCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { SelectedCalendarWhereUniqueInput } from "../selectedCalendar/SelectedCalendarWhereUniqueInput"; + +export type SelectedCalendarCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/SelectedCalendarUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/SelectedCalendarUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..7f1e93e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/SelectedCalendarUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { SelectedCalendarWhereUniqueInput } from "../selectedCalendar/SelectedCalendarWhereUniqueInput"; + +export type SelectedCalendarUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/SessionCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/SessionCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..9eb819f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/SessionCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { SessionWhereUniqueInput } from "../session/SessionWhereUniqueInput"; + +export type SessionCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/SessionUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/SessionUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..1dc0c00 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/SessionUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { SessionWhereUniqueInput } from "../session/SessionWhereUniqueInput"; + +export type SessionUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UpdateUserArgs.ts b/apps/roi-cacl-2-admin/src/api/user/UpdateUserArgs.ts new file mode 100644 index 0000000..30e635e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UpdateUserArgs.ts @@ -0,0 +1,7 @@ +import { UserWhereUniqueInput } from "./UserWhereUniqueInput"; +import { UserUpdateInput } from "./UserUpdateInput"; + +export type UpdateUserArgs = { + where: UserWhereUniqueInput; + data: UserUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/User.ts b/apps/roi-cacl-2-admin/src/api/user/User.ts new file mode 100644 index 0000000..3500c0d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/User.ts @@ -0,0 +1,70 @@ +import { JsonValue } from "type-fest"; +import { EventType } from "../eventType/EventType"; +import { Credential } from "../credential/Credential"; +import { DestinationCalendar } from "../destinationCalendar/DestinationCalendar"; +import { Membership } from "../membership/Membership"; +import { Booking } from "../booking/Booking"; +import { Schedule } from "../schedule/Schedule"; +import { Availability } from "../availability/Availability"; +import { SelectedCalendar } from "../selectedCalendar/SelectedCalendar"; +import { Webhook } from "../webhook/Webhook"; +import { Impersonation } from "../impersonation/Impersonation"; +import { ApiKey } from "../apiKey/ApiKey"; +import { Account } from "../account/Account"; +import { Session } from "../session/Session"; +import { Feedback } from "../feedback/Feedback"; +import { Workflow } from "../workflow/Workflow"; + +export type User = { + id: number; + username: string | null; + name: string | null; + email: string; + emailVerified: Date | null; + password: string | null; + bio: string | null; + avatar: string | null; + timeZone: string; + weekStart: string; + startTime: number; + endTime: number; + bufferTime: number; + hideBranding: boolean; + theme: string | null; + createdDate: Date; + trialEndsAt: Date | null; + defaultScheduleId: number | null; + completedOnboarding: boolean; + locale: string | null; + timeFormat: number | null; + twoFactorSecret: string | null; + twoFactorEnabled: boolean; + identityProvider?: "CAL" | "GOOGLE" | "SAML"; + identityProviderId: string | null; + invitedTo: number | null; + plan?: "FREE" | "TRIAL" | "PRO"; + brandColor: string; + darkBrandColor: string; + away: boolean; + allowDynamicBooking: boolean | null; + metadata: JsonValue; + verified: boolean | null; + role?: "USER" | "ADMIN"; + disableImpersonation: boolean; + eventTypes?: Array; + credentials?: Array; + destinationCalendar?: DestinationCalendar | null; + teams?: Array; + bookings?: Array; + schedules?: Array; + availability?: Array; + selectedCalendars?: Array; + webhooks?: Array; + impersonatedUsers?: Array; + impersonatedBy?: Array; + apiKeys?: Array; + accounts?: Array; + sessions?: Array; + feedback?: Array; + workflows?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserCountArgs.ts b/apps/roi-cacl-2-admin/src/api/user/UserCountArgs.ts new file mode 100644 index 0000000..b300ec3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserCountArgs.ts @@ -0,0 +1,5 @@ +import { UserWhereInput } from "./UserWhereInput"; + +export type UserCountArgs = { + where?: UserWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserCreateInput.ts b/apps/roi-cacl-2-admin/src/api/user/UserCreateInput.ts new file mode 100644 index 0000000..bba3556 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserCreateInput.ts @@ -0,0 +1,68 @@ +import { InputJsonValue } from "../../types"; +import { EventTypeCreateNestedManyWithoutUsersInput } from "./EventTypeCreateNestedManyWithoutUsersInput"; +import { CredentialCreateNestedManyWithoutUsersInput } from "./CredentialCreateNestedManyWithoutUsersInput"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { MembershipCreateNestedManyWithoutUsersInput } from "./MembershipCreateNestedManyWithoutUsersInput"; +import { BookingCreateNestedManyWithoutUsersInput } from "./BookingCreateNestedManyWithoutUsersInput"; +import { ScheduleCreateNestedManyWithoutUsersInput } from "./ScheduleCreateNestedManyWithoutUsersInput"; +import { AvailabilityCreateNestedManyWithoutUsersInput } from "./AvailabilityCreateNestedManyWithoutUsersInput"; +import { SelectedCalendarCreateNestedManyWithoutUsersInput } from "./SelectedCalendarCreateNestedManyWithoutUsersInput"; +import { WebhookCreateNestedManyWithoutUsersInput } from "./WebhookCreateNestedManyWithoutUsersInput"; +import { ImpersonationCreateNestedManyWithoutUsersInput } from "./ImpersonationCreateNestedManyWithoutUsersInput"; +import { ApiKeyCreateNestedManyWithoutUsersInput } from "./ApiKeyCreateNestedManyWithoutUsersInput"; +import { AccountCreateNestedManyWithoutUsersInput } from "./AccountCreateNestedManyWithoutUsersInput"; +import { SessionCreateNestedManyWithoutUsersInput } from "./SessionCreateNestedManyWithoutUsersInput"; +import { FeedbackCreateNestedManyWithoutUsersInput } from "./FeedbackCreateNestedManyWithoutUsersInput"; +import { WorkflowCreateNestedManyWithoutUsersInput } from "./WorkflowCreateNestedManyWithoutUsersInput"; + +export type UserCreateInput = { + username?: string | null; + name?: string | null; + email: string; + emailVerified?: Date | null; + password?: string | null; + bio?: string | null; + avatar?: string | null; + timeZone: string; + weekStart: string; + startTime: number; + endTime: number; + bufferTime: number; + hideBranding: boolean; + theme?: string | null; + trialEndsAt?: Date | null; + defaultScheduleId?: number | null; + completedOnboarding: boolean; + locale?: string | null; + timeFormat?: number | null; + twoFactorSecret?: string | null; + twoFactorEnabled: boolean; + identityProvider: "CAL" | "GOOGLE" | "SAML"; + identityProviderId?: string | null; + invitedTo?: number | null; + plan: "FREE" | "TRIAL" | "PRO"; + brandColor: string; + darkBrandColor: string; + away: boolean; + allowDynamicBooking?: boolean | null; + metadata?: InputJsonValue; + verified?: boolean | null; + role: "USER" | "ADMIN"; + disableImpersonation: boolean; + eventTypes?: EventTypeCreateNestedManyWithoutUsersInput; + credentials?: CredentialCreateNestedManyWithoutUsersInput; + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + teams?: MembershipCreateNestedManyWithoutUsersInput; + bookings?: BookingCreateNestedManyWithoutUsersInput; + schedules?: ScheduleCreateNestedManyWithoutUsersInput; + availability?: AvailabilityCreateNestedManyWithoutUsersInput; + selectedCalendars?: SelectedCalendarCreateNestedManyWithoutUsersInput; + webhooks?: WebhookCreateNestedManyWithoutUsersInput; + impersonatedUsers?: ImpersonationCreateNestedManyWithoutUsersInput; + impersonatedBy?: ImpersonationCreateNestedManyWithoutUsersInput; + apiKeys?: ApiKeyCreateNestedManyWithoutUsersInput; + accounts?: AccountCreateNestedManyWithoutUsersInput; + sessions?: SessionCreateNestedManyWithoutUsersInput; + feedback?: FeedbackCreateNestedManyWithoutUsersInput; + workflows?: WorkflowCreateNestedManyWithoutUsersInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/user/UserFindManyArgs.ts new file mode 100644 index 0000000..b453f3e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserFindManyArgs.ts @@ -0,0 +1,9 @@ +import { UserWhereInput } from "./UserWhereInput"; +import { UserOrderByInput } from "./UserOrderByInput"; + +export type UserFindManyArgs = { + where?: UserWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/user/UserFindUniqueArgs.ts new file mode 100644 index 0000000..97d18e8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { UserWhereUniqueInput } from "./UserWhereUniqueInput"; + +export type UserFindUniqueArgs = { + where: UserWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/user/UserListRelationFilter.ts new file mode 100644 index 0000000..4c4d06e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserListRelationFilter.ts @@ -0,0 +1,7 @@ +import { UserWhereInput } from "./UserWhereInput"; + +export type UserListRelationFilter = { + every?: UserWhereInput; + some?: UserWhereInput; + none?: UserWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/user/UserOrderByInput.ts new file mode 100644 index 0000000..dfdcb26 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserOrderByInput.ts @@ -0,0 +1,40 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type UserOrderByInput = { + id?: SortOrder; + username?: SortOrder; + name?: SortOrder; + email?: SortOrder; + emailVerified?: SortOrder; + password?: SortOrder; + bio?: SortOrder; + avatar?: SortOrder; + timeZone?: SortOrder; + weekStart?: SortOrder; + startTime?: SortOrder; + endTime?: SortOrder; + bufferTime?: SortOrder; + hideBranding?: SortOrder; + theme?: SortOrder; + createdDate?: SortOrder; + trialEndsAt?: SortOrder; + defaultScheduleId?: SortOrder; + completedOnboarding?: SortOrder; + locale?: SortOrder; + timeFormat?: SortOrder; + twoFactorSecret?: SortOrder; + twoFactorEnabled?: SortOrder; + identityProvider?: SortOrder; + identityProviderId?: SortOrder; + invitedTo?: SortOrder; + plan?: SortOrder; + brandColor?: SortOrder; + darkBrandColor?: SortOrder; + away?: SortOrder; + allowDynamicBooking?: SortOrder; + metadata?: SortOrder; + verified?: SortOrder; + role?: SortOrder; + disableImpersonation?: SortOrder; + destinationCalendarId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/user/UserUpdateInput.ts new file mode 100644 index 0000000..d78d6b6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserUpdateInput.ts @@ -0,0 +1,68 @@ +import { InputJsonValue } from "../../types"; +import { EventTypeUpdateManyWithoutUsersInput } from "./EventTypeUpdateManyWithoutUsersInput"; +import { CredentialUpdateManyWithoutUsersInput } from "./CredentialUpdateManyWithoutUsersInput"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { MembershipUpdateManyWithoutUsersInput } from "./MembershipUpdateManyWithoutUsersInput"; +import { BookingUpdateManyWithoutUsersInput } from "./BookingUpdateManyWithoutUsersInput"; +import { ScheduleUpdateManyWithoutUsersInput } from "./ScheduleUpdateManyWithoutUsersInput"; +import { AvailabilityUpdateManyWithoutUsersInput } from "./AvailabilityUpdateManyWithoutUsersInput"; +import { SelectedCalendarUpdateManyWithoutUsersInput } from "./SelectedCalendarUpdateManyWithoutUsersInput"; +import { WebhookUpdateManyWithoutUsersInput } from "./WebhookUpdateManyWithoutUsersInput"; +import { ImpersonationUpdateManyWithoutUsersInput } from "./ImpersonationUpdateManyWithoutUsersInput"; +import { ApiKeyUpdateManyWithoutUsersInput } from "./ApiKeyUpdateManyWithoutUsersInput"; +import { AccountUpdateManyWithoutUsersInput } from "./AccountUpdateManyWithoutUsersInput"; +import { SessionUpdateManyWithoutUsersInput } from "./SessionUpdateManyWithoutUsersInput"; +import { FeedbackUpdateManyWithoutUsersInput } from "./FeedbackUpdateManyWithoutUsersInput"; +import { WorkflowUpdateManyWithoutUsersInput } from "./WorkflowUpdateManyWithoutUsersInput"; + +export type UserUpdateInput = { + username?: string | null; + name?: string | null; + email?: string; + emailVerified?: Date | null; + password?: string | null; + bio?: string | null; + avatar?: string | null; + timeZone?: string; + weekStart?: string; + startTime?: number; + endTime?: number; + bufferTime?: number; + hideBranding?: boolean; + theme?: string | null; + trialEndsAt?: Date | null; + defaultScheduleId?: number | null; + completedOnboarding?: boolean; + locale?: string | null; + timeFormat?: number | null; + twoFactorSecret?: string | null; + twoFactorEnabled?: boolean; + identityProvider?: "CAL" | "GOOGLE" | "SAML"; + identityProviderId?: string | null; + invitedTo?: number | null; + plan?: "FREE" | "TRIAL" | "PRO"; + brandColor?: string; + darkBrandColor?: string; + away?: boolean; + allowDynamicBooking?: boolean | null; + metadata?: InputJsonValue; + verified?: boolean | null; + role?: "USER" | "ADMIN"; + disableImpersonation?: boolean; + eventTypes?: EventTypeUpdateManyWithoutUsersInput; + credentials?: CredentialUpdateManyWithoutUsersInput; + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + teams?: MembershipUpdateManyWithoutUsersInput; + bookings?: BookingUpdateManyWithoutUsersInput; + schedules?: ScheduleUpdateManyWithoutUsersInput; + availability?: AvailabilityUpdateManyWithoutUsersInput; + selectedCalendars?: SelectedCalendarUpdateManyWithoutUsersInput; + webhooks?: WebhookUpdateManyWithoutUsersInput; + impersonatedUsers?: ImpersonationUpdateManyWithoutUsersInput; + impersonatedBy?: ImpersonationUpdateManyWithoutUsersInput; + apiKeys?: ApiKeyUpdateManyWithoutUsersInput; + accounts?: AccountUpdateManyWithoutUsersInput; + sessions?: SessionUpdateManyWithoutUsersInput; + feedback?: FeedbackUpdateManyWithoutUsersInput; + workflows?: WorkflowUpdateManyWithoutUsersInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserWhereInput.ts b/apps/roi-cacl-2-admin/src/api/user/UserWhereInput.ts new file mode 100644 index 0000000..8f7dbe8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserWhereInput.ts @@ -0,0 +1,78 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { EventTypeListRelationFilter } from "../eventType/EventTypeListRelationFilter"; +import { CredentialListRelationFilter } from "../credential/CredentialListRelationFilter"; +import { DestinationCalendarWhereUniqueInput } from "../destinationCalendar/DestinationCalendarWhereUniqueInput"; +import { MembershipListRelationFilter } from "../membership/MembershipListRelationFilter"; +import { BookingListRelationFilter } from "../booking/BookingListRelationFilter"; +import { ScheduleListRelationFilter } from "../schedule/ScheduleListRelationFilter"; +import { AvailabilityListRelationFilter } from "../availability/AvailabilityListRelationFilter"; +import { SelectedCalendarListRelationFilter } from "../selectedCalendar/SelectedCalendarListRelationFilter"; +import { WebhookListRelationFilter } from "../webhook/WebhookListRelationFilter"; +import { ImpersonationListRelationFilter } from "../impersonation/ImpersonationListRelationFilter"; +import { ApiKeyListRelationFilter } from "../apiKey/ApiKeyListRelationFilter"; +import { AccountListRelationFilter } from "../account/AccountListRelationFilter"; +import { SessionListRelationFilter } from "../session/SessionListRelationFilter"; +import { FeedbackListRelationFilter } from "../feedback/FeedbackListRelationFilter"; +import { WorkflowListRelationFilter } from "../workflow/WorkflowListRelationFilter"; + +export type UserWhereInput = { + id?: IntFilter; + username?: StringNullableFilter; + name?: StringNullableFilter; + email?: StringFilter; + emailVerified?: DateTimeNullableFilter; + password?: StringNullableFilter; + bio?: StringNullableFilter; + avatar?: StringNullableFilter; + timeZone?: StringFilter; + weekStart?: StringFilter; + startTime?: IntFilter; + endTime?: IntFilter; + bufferTime?: IntFilter; + hideBranding?: BooleanFilter; + theme?: StringNullableFilter; + createdDate?: DateTimeFilter; + trialEndsAt?: DateTimeNullableFilter; + defaultScheduleId?: IntNullableFilter; + completedOnboarding?: BooleanFilter; + locale?: StringNullableFilter; + timeFormat?: IntNullableFilter; + twoFactorSecret?: StringNullableFilter; + twoFactorEnabled?: BooleanFilter; + identityProvider?: "CAL" | "GOOGLE" | "SAML"; + identityProviderId?: StringNullableFilter; + invitedTo?: IntNullableFilter; + plan?: "FREE" | "TRIAL" | "PRO"; + brandColor?: StringFilter; + darkBrandColor?: StringFilter; + away?: BooleanFilter; + allowDynamicBooking?: BooleanNullableFilter; + metadata?: JsonFilter; + verified?: BooleanNullableFilter; + role?: "USER" | "ADMIN"; + disableImpersonation?: BooleanFilter; + eventTypes?: EventTypeListRelationFilter; + credentials?: CredentialListRelationFilter; + destinationCalendar?: DestinationCalendarWhereUniqueInput; + teams?: MembershipListRelationFilter; + bookings?: BookingListRelationFilter; + schedules?: ScheduleListRelationFilter; + availability?: AvailabilityListRelationFilter; + selectedCalendars?: SelectedCalendarListRelationFilter; + webhooks?: WebhookListRelationFilter; + impersonatedUsers?: ImpersonationListRelationFilter; + impersonatedBy?: ImpersonationListRelationFilter; + apiKeys?: ApiKeyListRelationFilter; + accounts?: AccountListRelationFilter; + sessions?: SessionListRelationFilter; + feedback?: FeedbackListRelationFilter; + workflows?: WorkflowListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/UserWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/user/UserWhereUniqueInput.ts new file mode 100644 index 0000000..8bd7723 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/UserWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type UserWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/WebhookCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/WebhookCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..f99cd64 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/WebhookCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { WebhookWhereUniqueInput } from "../webhook/WebhookWhereUniqueInput"; + +export type WebhookCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/WebhookUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/WebhookUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..5360a5a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/WebhookUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { WebhookWhereUniqueInput } from "../webhook/WebhookWhereUniqueInput"; + +export type WebhookUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/WorkflowCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/WorkflowCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..521096d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/WorkflowCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,5 @@ +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; + +export type WorkflowCreateNestedManyWithoutUsersInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/user/WorkflowUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2-admin/src/api/user/WorkflowUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..c22f8d6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/user/WorkflowUpdateManyWithoutUsersInput.ts @@ -0,0 +1,7 @@ +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; + +export type WorkflowUpdateManyWithoutUsersInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/CreateVerificationTokenArgs.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/CreateVerificationTokenArgs.ts new file mode 100644 index 0000000..9256535 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/CreateVerificationTokenArgs.ts @@ -0,0 +1,5 @@ +import { VerificationTokenCreateInput } from "./VerificationTokenCreateInput"; + +export type CreateVerificationTokenArgs = { + data: VerificationTokenCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/DeleteVerificationTokenArgs.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/DeleteVerificationTokenArgs.ts new file mode 100644 index 0000000..9097fc2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/DeleteVerificationTokenArgs.ts @@ -0,0 +1,5 @@ +import { VerificationTokenWhereUniqueInput } from "./VerificationTokenWhereUniqueInput"; + +export type DeleteVerificationTokenArgs = { + where: VerificationTokenWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/UpdateVerificationTokenArgs.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/UpdateVerificationTokenArgs.ts new file mode 100644 index 0000000..dbbe2b8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/UpdateVerificationTokenArgs.ts @@ -0,0 +1,7 @@ +import { VerificationTokenWhereUniqueInput } from "./VerificationTokenWhereUniqueInput"; +import { VerificationTokenUpdateInput } from "./VerificationTokenUpdateInput"; + +export type UpdateVerificationTokenArgs = { + where: VerificationTokenWhereUniqueInput; + data: VerificationTokenUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationToken.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationToken.ts new file mode 100644 index 0000000..71566e5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationToken.ts @@ -0,0 +1,8 @@ +export type VerificationToken = { + id: number; + identifier: string; + token: string; + expires: Date; + createdAt: Date; + updatedAt: Date; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCountArgs.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCountArgs.ts new file mode 100644 index 0000000..8e173fc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCountArgs.ts @@ -0,0 +1,5 @@ +import { VerificationTokenWhereInput } from "./VerificationTokenWhereInput"; + +export type VerificationTokenCountArgs = { + where?: VerificationTokenWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCreateInput.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCreateInput.ts new file mode 100644 index 0000000..516e453 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenCreateInput.ts @@ -0,0 +1,5 @@ +export type VerificationTokenCreateInput = { + identifier: string; + token: string; + expires: Date; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindManyArgs.ts new file mode 100644 index 0000000..37f4bc2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindManyArgs.ts @@ -0,0 +1,9 @@ +import { VerificationTokenWhereInput } from "./VerificationTokenWhereInput"; +import { VerificationTokenOrderByInput } from "./VerificationTokenOrderByInput"; + +export type VerificationTokenFindManyArgs = { + where?: VerificationTokenWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindUniqueArgs.ts new file mode 100644 index 0000000..869565e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { VerificationTokenWhereUniqueInput } from "./VerificationTokenWhereUniqueInput"; + +export type VerificationTokenFindUniqueArgs = { + where: VerificationTokenWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenListRelationFilter.ts new file mode 100644 index 0000000..6b96fa3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenListRelationFilter.ts @@ -0,0 +1,7 @@ +import { VerificationTokenWhereInput } from "./VerificationTokenWhereInput"; + +export type VerificationTokenListRelationFilter = { + every?: VerificationTokenWhereInput; + some?: VerificationTokenWhereInput; + none?: VerificationTokenWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenOrderByInput.ts new file mode 100644 index 0000000..75c650d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenOrderByInput.ts @@ -0,0 +1,10 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type VerificationTokenOrderByInput = { + id?: SortOrder; + identifier?: SortOrder; + token?: SortOrder; + expires?: SortOrder; + createdAt?: SortOrder; + updatedAt?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenUpdateInput.ts new file mode 100644 index 0000000..3970577 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenUpdateInput.ts @@ -0,0 +1,5 @@ +export type VerificationTokenUpdateInput = { + identifier?: string; + token?: string; + expires?: Date; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereInput.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereInput.ts new file mode 100644 index 0000000..87a2770 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereInput.ts @@ -0,0 +1,12 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; + +export type VerificationTokenWhereInput = { + id?: IntFilter; + identifier?: StringFilter; + token?: StringFilter; + expires?: DateTimeFilter; + createdAt?: DateTimeFilter; + updatedAt?: DateTimeFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereUniqueInput.ts new file mode 100644 index 0000000..2658ee2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/verificationToken/VerificationTokenWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type VerificationTokenWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/CreateWebhookArgs.ts b/apps/roi-cacl-2-admin/src/api/webhook/CreateWebhookArgs.ts new file mode 100644 index 0000000..31cbd5f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/CreateWebhookArgs.ts @@ -0,0 +1,5 @@ +import { WebhookCreateInput } from "./WebhookCreateInput"; + +export type CreateWebhookArgs = { + data: WebhookCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/DeleteWebhookArgs.ts b/apps/roi-cacl-2-admin/src/api/webhook/DeleteWebhookArgs.ts new file mode 100644 index 0000000..55a87a6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/DeleteWebhookArgs.ts @@ -0,0 +1,5 @@ +import { WebhookWhereUniqueInput } from "./WebhookWhereUniqueInput"; + +export type DeleteWebhookArgs = { + where: WebhookWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/EnumWebhookEventTriggers.ts b/apps/roi-cacl-2-admin/src/api/webhook/EnumWebhookEventTriggers.ts new file mode 100644 index 0000000..03473a5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/EnumWebhookEventTriggers.ts @@ -0,0 +1,5 @@ +export enum EnumWebhookEventTriggers { + BookingCreated = "BOOKING_CREATED", + BookingRescheduled = "BOOKING_RESCHEDULED", + BookingCancelled = "BOOKING_CANCELLED", +} diff --git a/apps/roi-cacl-2-admin/src/api/webhook/UpdateWebhookArgs.ts b/apps/roi-cacl-2-admin/src/api/webhook/UpdateWebhookArgs.ts new file mode 100644 index 0000000..51a9f5e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/UpdateWebhookArgs.ts @@ -0,0 +1,7 @@ +import { WebhookWhereUniqueInput } from "./WebhookWhereUniqueInput"; +import { WebhookUpdateInput } from "./WebhookUpdateInput"; + +export type UpdateWebhookArgs = { + where: WebhookWhereUniqueInput; + data: WebhookUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/Webhook.ts b/apps/roi-cacl-2-admin/src/api/webhook/Webhook.ts new file mode 100644 index 0000000..853c330 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/Webhook.ts @@ -0,0 +1,18 @@ +import { User } from "../user/User"; +import { EventType } from "../eventType/EventType"; +import { AppModel } from "../appModel/AppModel"; + +export type Webhook = { + id: string; + subscriberUrl: string; + payloadTemplate: string | null; + createdAt: Date; + active: boolean; + eventTriggers?: Array< + "BOOKING_CREATED" | "BOOKING_RESCHEDULED" | "BOOKING_CANCELLED" + >; + user?: User | null; + eventType?: EventType | null; + appField?: AppModel | null; + secret: string | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookCountArgs.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookCountArgs.ts new file mode 100644 index 0000000..0cc0c73 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookCountArgs.ts @@ -0,0 +1,5 @@ +import { WebhookWhereInput } from "./WebhookWhereInput"; + +export type WebhookCountArgs = { + where?: WebhookWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookCreateInput.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookCreateInput.ts new file mode 100644 index 0000000..43ce953 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookCreateInput.ts @@ -0,0 +1,16 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; + +export type WebhookCreateInput = { + subscriberUrl: string; + payloadTemplate?: string | null; + active: boolean; + eventTriggers?: Array< + "BOOKING_CREATED" | "BOOKING_RESCHEDULED" | "BOOKING_CANCELLED" + >; + user?: UserWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + appField?: AppModelWhereUniqueInput | null; + secret?: string | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookFindManyArgs.ts new file mode 100644 index 0000000..d8682e2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookFindManyArgs.ts @@ -0,0 +1,9 @@ +import { WebhookWhereInput } from "./WebhookWhereInput"; +import { WebhookOrderByInput } from "./WebhookOrderByInput"; + +export type WebhookFindManyArgs = { + where?: WebhookWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookFindUniqueArgs.ts new file mode 100644 index 0000000..e62f7f1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { WebhookWhereUniqueInput } from "./WebhookWhereUniqueInput"; + +export type WebhookFindUniqueArgs = { + where: WebhookWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookListRelationFilter.ts new file mode 100644 index 0000000..1db00e3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookListRelationFilter.ts @@ -0,0 +1,7 @@ +import { WebhookWhereInput } from "./WebhookWhereInput"; + +export type WebhookListRelationFilter = { + every?: WebhookWhereInput; + some?: WebhookWhereInput; + none?: WebhookWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookOrderByInput.ts new file mode 100644 index 0000000..c877713 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookOrderByInput.ts @@ -0,0 +1,14 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type WebhookOrderByInput = { + id?: SortOrder; + subscriberUrl?: SortOrder; + payloadTemplate?: SortOrder; + createdAt?: SortOrder; + active?: SortOrder; + eventTriggers?: SortOrder; + userId?: SortOrder; + eventTypeId?: SortOrder; + appId?: SortOrder; + secret?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookUpdateInput.ts new file mode 100644 index 0000000..7253452 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookUpdateInput.ts @@ -0,0 +1,16 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; + +export type WebhookUpdateInput = { + subscriberUrl?: string; + payloadTemplate?: string | null; + active?: boolean; + eventTriggers?: Array< + "BOOKING_CREATED" | "BOOKING_RESCHEDULED" | "BOOKING_CANCELLED" + >; + user?: UserWhereUniqueInput | null; + eventType?: EventTypeWhereUniqueInput | null; + appField?: AppModelWhereUniqueInput | null; + secret?: string | null; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereInput.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereInput.ts new file mode 100644 index 0000000..1a75513 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereInput.ts @@ -0,0 +1,19 @@ +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../appModel/AppModelWhereUniqueInput"; + +export type WebhookWhereInput = { + id?: StringFilter; + subscriberUrl?: StringFilter; + payloadTemplate?: StringNullableFilter; + createdAt?: DateTimeFilter; + active?: BooleanFilter; + user?: UserWhereUniqueInput; + eventType?: EventTypeWhereUniqueInput; + appField?: AppModelWhereUniqueInput; + secret?: StringNullableFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereUniqueInput.ts new file mode 100644 index 0000000..a7321ce --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/webhook/WebhookWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type WebhookWhereUniqueInput = { + id: string; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/CreateWorkflowArgs.ts b/apps/roi-cacl-2-admin/src/api/workflow/CreateWorkflowArgs.ts new file mode 100644 index 0000000..e2197ab --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/CreateWorkflowArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowCreateInput } from "./WorkflowCreateInput"; + +export type CreateWorkflowArgs = { + data: WorkflowCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/DeleteWorkflowArgs.ts b/apps/roi-cacl-2-admin/src/api/workflow/DeleteWorkflowArgs.ts new file mode 100644 index 0000000..a6110dd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/DeleteWorkflowArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowWhereUniqueInput } from "./WorkflowWhereUniqueInput"; + +export type DeleteWorkflowArgs = { + where: WorkflowWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTimeUnit.ts b/apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTimeUnit.ts new file mode 100644 index 0000000..6fdbb9c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTimeUnit.ts @@ -0,0 +1,5 @@ +export enum EnumWorkflowTimeUnit { + Day = "DAY", + Hour = "HOUR", + Minute = "MINUTE", +} diff --git a/apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTrigger.ts b/apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTrigger.ts new file mode 100644 index 0000000..7449ff7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/EnumWorkflowTrigger.ts @@ -0,0 +1,5 @@ +export enum EnumWorkflowTrigger { + BeforeEvent = "BEFORE_EVENT", + EventCancelled = "EVENT_CANCELLED", + NewEvent = "NEW_EVENT", +} diff --git a/apps/roi-cacl-2-admin/src/api/workflow/UpdateWorkflowArgs.ts b/apps/roi-cacl-2-admin/src/api/workflow/UpdateWorkflowArgs.ts new file mode 100644 index 0000000..a1f1685 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/UpdateWorkflowArgs.ts @@ -0,0 +1,7 @@ +import { WorkflowWhereUniqueInput } from "./WorkflowWhereUniqueInput"; +import { WorkflowUpdateInput } from "./WorkflowUpdateInput"; + +export type UpdateWorkflowArgs = { + where: WorkflowWhereUniqueInput; + data: WorkflowUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/Workflow.ts b/apps/roi-cacl-2-admin/src/api/workflow/Workflow.ts new file mode 100644 index 0000000..cc85d1c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/Workflow.ts @@ -0,0 +1,14 @@ +import { User } from "../user/User"; +import { WorkflowStep } from "../workflowStep/WorkflowStep"; +import { WorkflowsOnEventType } from "../workflowsOnEventType/WorkflowsOnEventType"; + +export type Workflow = { + id: number; + name: string; + user?: User; + trigger?: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + time: number | null; + timeUnit?: "DAY" | "HOUR" | "MINUTE" | null; + steps?: Array; + activeOn?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowCountArgs.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowCountArgs.ts new file mode 100644 index 0000000..66ab5fb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowCountArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowWhereInput } from "./WorkflowWhereInput"; + +export type WorkflowCountArgs = { + where?: WorkflowWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowCreateInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowCreateInput.ts new file mode 100644 index 0000000..c6a64c6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowCreateInput.ts @@ -0,0 +1,13 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { WorkflowStepCreateNestedManyWithoutWorkflowsInput } from "./WorkflowStepCreateNestedManyWithoutWorkflowsInput"; +import { WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput } from "./WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput"; + +export type WorkflowCreateInput = { + name: string; + user: UserWhereUniqueInput; + trigger: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + time?: number | null; + timeUnit?: "DAY" | "HOUR" | "MINUTE" | null; + steps?: WorkflowStepCreateNestedManyWithoutWorkflowsInput; + activeOn?: WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindManyArgs.ts new file mode 100644 index 0000000..da62560 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindManyArgs.ts @@ -0,0 +1,9 @@ +import { WorkflowWhereInput } from "./WorkflowWhereInput"; +import { WorkflowOrderByInput } from "./WorkflowOrderByInput"; + +export type WorkflowFindManyArgs = { + where?: WorkflowWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindUniqueArgs.ts new file mode 100644 index 0000000..810ce98 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowWhereUniqueInput } from "./WorkflowWhereUniqueInput"; + +export type WorkflowFindUniqueArgs = { + where: WorkflowWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowListRelationFilter.ts new file mode 100644 index 0000000..d299ca7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowListRelationFilter.ts @@ -0,0 +1,7 @@ +import { WorkflowWhereInput } from "./WorkflowWhereInput"; + +export type WorkflowListRelationFilter = { + every?: WorkflowWhereInput; + some?: WorkflowWhereInput; + none?: WorkflowWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowOrderByInput.ts new file mode 100644 index 0000000..84cca1b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowOrderByInput.ts @@ -0,0 +1,10 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type WorkflowOrderByInput = { + id?: SortOrder; + name?: SortOrder; + userId?: SortOrder; + trigger?: SortOrder; + time?: SortOrder; + timeUnit?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..511e8dd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts @@ -0,0 +1,5 @@ +import { WorkflowStepWhereUniqueInput } from "../workflowStep/WorkflowStepWhereUniqueInput"; + +export type WorkflowStepCreateNestedManyWithoutWorkflowsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepUpdateManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepUpdateManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..a1350a2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowStepUpdateManyWithoutWorkflowsInput.ts @@ -0,0 +1,7 @@ +import { WorkflowStepWhereUniqueInput } from "../workflowStep/WorkflowStepWhereUniqueInput"; + +export type WorkflowStepUpdateManyWithoutWorkflowsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowUpdateInput.ts new file mode 100644 index 0000000..bcd0fa7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowUpdateInput.ts @@ -0,0 +1,13 @@ +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { WorkflowStepUpdateManyWithoutWorkflowsInput } from "./WorkflowStepUpdateManyWithoutWorkflowsInput"; +import { WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput } from "./WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput"; + +export type WorkflowUpdateInput = { + name?: string; + user?: UserWhereUniqueInput; + trigger?: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + time?: number | null; + timeUnit?: "DAY" | "HOUR" | "MINUTE" | null; + steps?: WorkflowStepUpdateManyWithoutWorkflowsInput; + activeOn?: WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereInput.ts new file mode 100644 index 0000000..2735cdd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereInput.ts @@ -0,0 +1,17 @@ +import { IntFilter } from "../../util/IntFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { UserWhereUniqueInput } from "../user/UserWhereUniqueInput"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { WorkflowStepListRelationFilter } from "../workflowStep/WorkflowStepListRelationFilter"; +import { WorkflowsOnEventTypeListRelationFilter } from "../workflowsOnEventType/WorkflowsOnEventTypeListRelationFilter"; + +export type WorkflowWhereInput = { + id?: IntFilter; + name?: StringFilter; + user?: UserWhereUniqueInput; + trigger?: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + time?: IntNullableFilter; + timeUnit?: "DAY" | "HOUR" | "MINUTE"; + steps?: WorkflowStepListRelationFilter; + activeOn?: WorkflowsOnEventTypeListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereUniqueInput.ts new file mode 100644 index 0000000..85b1e7f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type WorkflowWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..7ac3e63 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts @@ -0,0 +1,5 @@ +import { WorkflowsOnEventTypeWhereUniqueInput } from "../workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..1fa3ef3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflow/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts @@ -0,0 +1,7 @@ +import { WorkflowsOnEventTypeWhereUniqueInput } from "../workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/CreateWorkflowReminderArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/CreateWorkflowReminderArgs.ts new file mode 100644 index 0000000..5784536 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/CreateWorkflowReminderArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowReminderCreateInput } from "./WorkflowReminderCreateInput"; + +export type CreateWorkflowReminderArgs = { + data: WorkflowReminderCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/DeleteWorkflowReminderArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/DeleteWorkflowReminderArgs.ts new file mode 100644 index 0000000..d605928 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/DeleteWorkflowReminderArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowReminderWhereUniqueInput } from "./WorkflowReminderWhereUniqueInput"; + +export type DeleteWorkflowReminderArgs = { + where: WorkflowReminderWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/EnumWorkflowReminderMethod.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/EnumWorkflowReminderMethod.ts new file mode 100644 index 0000000..ea15c39 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/EnumWorkflowReminderMethod.ts @@ -0,0 +1,4 @@ +export enum EnumWorkflowReminderMethod { + Email = "EMAIL", + Sms = "SMS", +} diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/UpdateWorkflowReminderArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/UpdateWorkflowReminderArgs.ts new file mode 100644 index 0000000..54013ac --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/UpdateWorkflowReminderArgs.ts @@ -0,0 +1,7 @@ +import { WorkflowReminderWhereUniqueInput } from "./WorkflowReminderWhereUniqueInput"; +import { WorkflowReminderUpdateInput } from "./WorkflowReminderUpdateInput"; + +export type UpdateWorkflowReminderArgs = { + where: WorkflowReminderWhereUniqueInput; + data: WorkflowReminderUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminder.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminder.ts new file mode 100644 index 0000000..4cd3828 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminder.ts @@ -0,0 +1,12 @@ +import { Booking } from "../booking/Booking"; +import { WorkflowStep } from "../workflowStep/WorkflowStep"; + +export type WorkflowReminder = { + id: number; + booking?: Booking | null; + method?: "EMAIL" | "SMS"; + scheduledDate: Date; + referenceId: string | null; + scheduled: boolean; + workflowStep?: WorkflowStep; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCountArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCountArgs.ts new file mode 100644 index 0000000..9aa2ea0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCountArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowReminderWhereInput } from "./WorkflowReminderWhereInput"; + +export type WorkflowReminderCountArgs = { + where?: WorkflowReminderWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCreateInput.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCreateInput.ts new file mode 100644 index 0000000..c85800d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderCreateInput.ts @@ -0,0 +1,11 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { WorkflowStepWhereUniqueInput } from "../workflowStep/WorkflowStepWhereUniqueInput"; + +export type WorkflowReminderCreateInput = { + booking?: BookingWhereUniqueInput | null; + method: "EMAIL" | "SMS"; + scheduledDate: Date; + referenceId?: string | null; + scheduled: boolean; + workflowStep: WorkflowStepWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindManyArgs.ts new file mode 100644 index 0000000..85c2b4e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindManyArgs.ts @@ -0,0 +1,9 @@ +import { WorkflowReminderWhereInput } from "./WorkflowReminderWhereInput"; +import { WorkflowReminderOrderByInput } from "./WorkflowReminderOrderByInput"; + +export type WorkflowReminderFindManyArgs = { + where?: WorkflowReminderWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindUniqueArgs.ts new file mode 100644 index 0000000..26503ea --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowReminderWhereUniqueInput } from "./WorkflowReminderWhereUniqueInput"; + +export type WorkflowReminderFindUniqueArgs = { + where: WorkflowReminderWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderListRelationFilter.ts new file mode 100644 index 0000000..820a202 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderListRelationFilter.ts @@ -0,0 +1,7 @@ +import { WorkflowReminderWhereInput } from "./WorkflowReminderWhereInput"; + +export type WorkflowReminderListRelationFilter = { + every?: WorkflowReminderWhereInput; + some?: WorkflowReminderWhereInput; + none?: WorkflowReminderWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderOrderByInput.ts new file mode 100644 index 0000000..64b1575 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderOrderByInput.ts @@ -0,0 +1,11 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type WorkflowReminderOrderByInput = { + id?: SortOrder; + bookingUid?: SortOrder; + method?: SortOrder; + scheduledDate?: SortOrder; + referenceId?: SortOrder; + scheduled?: SortOrder; + workflowStepId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderUpdateInput.ts new file mode 100644 index 0000000..c8df314 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderUpdateInput.ts @@ -0,0 +1,11 @@ +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { WorkflowStepWhereUniqueInput } from "../workflowStep/WorkflowStepWhereUniqueInput"; + +export type WorkflowReminderUpdateInput = { + booking?: BookingWhereUniqueInput | null; + method?: "EMAIL" | "SMS"; + scheduledDate?: Date; + referenceId?: string | null; + scheduled?: boolean; + workflowStep?: WorkflowStepWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereInput.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereInput.ts new file mode 100644 index 0000000..a382f13 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereInput.ts @@ -0,0 +1,16 @@ +import { IntFilter } from "../../util/IntFilter"; +import { BookingWhereUniqueInput } from "../booking/BookingWhereUniqueInput"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { WorkflowStepWhereUniqueInput } from "../workflowStep/WorkflowStepWhereUniqueInput"; + +export type WorkflowReminderWhereInput = { + id?: IntFilter; + booking?: BookingWhereUniqueInput; + method?: "EMAIL" | "SMS"; + scheduledDate?: DateTimeFilter; + referenceId?: StringNullableFilter; + scheduled?: BooleanFilter; + workflowStep?: WorkflowStepWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereUniqueInput.ts new file mode 100644 index 0000000..0f28e2b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowReminder/WorkflowReminderWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type WorkflowReminderWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/CreateWorkflowStepArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/CreateWorkflowStepArgs.ts new file mode 100644 index 0000000..bba9539 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/CreateWorkflowStepArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowStepCreateInput } from "./WorkflowStepCreateInput"; + +export type CreateWorkflowStepArgs = { + data: WorkflowStepCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/DeleteWorkflowStepArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/DeleteWorkflowStepArgs.ts new file mode 100644 index 0000000..4b5bb40 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/DeleteWorkflowStepArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowStepWhereUniqueInput } from "./WorkflowStepWhereUniqueInput"; + +export type DeleteWorkflowStepArgs = { + where: WorkflowStepWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepAction.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepAction.ts new file mode 100644 index 0000000..dbd2b25 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepAction.ts @@ -0,0 +1,6 @@ +export enum EnumWorkflowStepAction { + EmailHost = "EMAIL_HOST", + EmailAttendee = "EMAIL_ATTENDEE", + SmsAttendee = "SMS_ATTENDEE", + SmsNumber = "SMS_NUMBER", +} diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepTemplate.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepTemplate.ts new file mode 100644 index 0000000..5d095fb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/EnumWorkflowStepTemplate.ts @@ -0,0 +1,4 @@ +export enum EnumWorkflowStepTemplate { + Reminder = "REMINDER", + Custom = "CUSTOM", +} diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/UpdateWorkflowStepArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/UpdateWorkflowStepArgs.ts new file mode 100644 index 0000000..213272d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/UpdateWorkflowStepArgs.ts @@ -0,0 +1,7 @@ +import { WorkflowStepWhereUniqueInput } from "./WorkflowStepWhereUniqueInput"; +import { WorkflowStepUpdateInput } from "./WorkflowStepUpdateInput"; + +export type UpdateWorkflowStepArgs = { + where: WorkflowStepWhereUniqueInput; + data: WorkflowStepUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts new file mode 100644 index 0000000..7524512 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts @@ -0,0 +1,5 @@ +import { WorkflowReminderWhereUniqueInput } from "../workflowReminder/WorkflowReminderWhereUniqueInput"; + +export type WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput = { + connect?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts new file mode 100644 index 0000000..770bdb0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts @@ -0,0 +1,7 @@ +import { WorkflowReminderWhereUniqueInput } from "../workflowReminder/WorkflowReminderWhereUniqueInput"; + +export type WorkflowReminderUpdateManyWithoutWorkflowStepsInput = { + connect?: Array; + disconnect?: Array; + set?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStep.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStep.ts new file mode 100644 index 0000000..a69e063 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStep.ts @@ -0,0 +1,14 @@ +import { Workflow } from "../workflow/Workflow"; +import { WorkflowReminder } from "../workflowReminder/WorkflowReminder"; + +export type WorkflowStep = { + id: number; + stepNumber: number; + action?: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + workflow?: Workflow; + sendTo: string | null; + reminderBody: string | null; + emailSubject: string | null; + template?: "REMINDER" | "CUSTOM"; + workflowReminders?: Array; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCountArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCountArgs.ts new file mode 100644 index 0000000..3c74391 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCountArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowStepWhereInput } from "./WorkflowStepWhereInput"; + +export type WorkflowStepCountArgs = { + where?: WorkflowStepWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCreateInput.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCreateInput.ts new file mode 100644 index 0000000..daa81fb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepCreateInput.ts @@ -0,0 +1,13 @@ +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; +import { WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput } from "./WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput"; + +export type WorkflowStepCreateInput = { + stepNumber: number; + action: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + workflow: WorkflowWhereUniqueInput; + sendTo?: string | null; + reminderBody?: string | null; + emailSubject?: string | null; + template: "REMINDER" | "CUSTOM"; + workflowReminders?: WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindManyArgs.ts new file mode 100644 index 0000000..0f8cf9f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindManyArgs.ts @@ -0,0 +1,9 @@ +import { WorkflowStepWhereInput } from "./WorkflowStepWhereInput"; +import { WorkflowStepOrderByInput } from "./WorkflowStepOrderByInput"; + +export type WorkflowStepFindManyArgs = { + where?: WorkflowStepWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindUniqueArgs.ts new file mode 100644 index 0000000..3c34755 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowStepWhereUniqueInput } from "./WorkflowStepWhereUniqueInput"; + +export type WorkflowStepFindUniqueArgs = { + where: WorkflowStepWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepListRelationFilter.ts new file mode 100644 index 0000000..6af4c7a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepListRelationFilter.ts @@ -0,0 +1,7 @@ +import { WorkflowStepWhereInput } from "./WorkflowStepWhereInput"; + +export type WorkflowStepListRelationFilter = { + every?: WorkflowStepWhereInput; + some?: WorkflowStepWhereInput; + none?: WorkflowStepWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepOrderByInput.ts new file mode 100644 index 0000000..39eae4b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepOrderByInput.ts @@ -0,0 +1,12 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type WorkflowStepOrderByInput = { + id?: SortOrder; + stepNumber?: SortOrder; + action?: SortOrder; + workflowId?: SortOrder; + sendTo?: SortOrder; + reminderBody?: SortOrder; + emailSubject?: SortOrder; + template?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepUpdateInput.ts new file mode 100644 index 0000000..6f0fd77 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepUpdateInput.ts @@ -0,0 +1,13 @@ +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; +import { WorkflowReminderUpdateManyWithoutWorkflowStepsInput } from "./WorkflowReminderUpdateManyWithoutWorkflowStepsInput"; + +export type WorkflowStepUpdateInput = { + stepNumber?: number; + action?: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + workflow?: WorkflowWhereUniqueInput; + sendTo?: string | null; + reminderBody?: string | null; + emailSubject?: string | null; + template?: "REMINDER" | "CUSTOM"; + workflowReminders?: WorkflowReminderUpdateManyWithoutWorkflowStepsInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereInput.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereInput.ts new file mode 100644 index 0000000..2f6fa1e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereInput.ts @@ -0,0 +1,16 @@ +import { IntFilter } from "../../util/IntFilter"; +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { WorkflowReminderListRelationFilter } from "../workflowReminder/WorkflowReminderListRelationFilter"; + +export type WorkflowStepWhereInput = { + id?: IntFilter; + stepNumber?: IntFilter; + action?: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + workflow?: WorkflowWhereUniqueInput; + sendTo?: StringNullableFilter; + reminderBody?: StringNullableFilter; + emailSubject?: StringNullableFilter; + template?: "REMINDER" | "CUSTOM"; + workflowReminders?: WorkflowReminderListRelationFilter; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereUniqueInput.ts new file mode 100644 index 0000000..8f78b1a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowStep/WorkflowStepWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type WorkflowStepWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/CreateWorkflowsOnEventTypeArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/CreateWorkflowsOnEventTypeArgs.ts new file mode 100644 index 0000000..68db3be --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/CreateWorkflowsOnEventTypeArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowsOnEventTypeCreateInput } from "./WorkflowsOnEventTypeCreateInput"; + +export type CreateWorkflowsOnEventTypeArgs = { + data: WorkflowsOnEventTypeCreateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/DeleteWorkflowsOnEventTypeArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/DeleteWorkflowsOnEventTypeArgs.ts new file mode 100644 index 0000000..278d9ec --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/DeleteWorkflowsOnEventTypeArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowsOnEventTypeWhereUniqueInput } from "./WorkflowsOnEventTypeWhereUniqueInput"; + +export type DeleteWorkflowsOnEventTypeArgs = { + where: WorkflowsOnEventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/UpdateWorkflowsOnEventTypeArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/UpdateWorkflowsOnEventTypeArgs.ts new file mode 100644 index 0000000..353a7c1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/UpdateWorkflowsOnEventTypeArgs.ts @@ -0,0 +1,7 @@ +import { WorkflowsOnEventTypeWhereUniqueInput } from "./WorkflowsOnEventTypeWhereUniqueInput"; +import { WorkflowsOnEventTypeUpdateInput } from "./WorkflowsOnEventTypeUpdateInput"; + +export type UpdateWorkflowsOnEventTypeArgs = { + where: WorkflowsOnEventTypeWhereUniqueInput; + data: WorkflowsOnEventTypeUpdateInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventType.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventType.ts new file mode 100644 index 0000000..b98d345 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventType.ts @@ -0,0 +1,8 @@ +import { Workflow } from "../workflow/Workflow"; +import { EventType } from "../eventType/EventType"; + +export type WorkflowsOnEventType = { + id: number; + workflow?: Workflow; + eventType?: EventType; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCountArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCountArgs.ts new file mode 100644 index 0000000..2000932 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCountArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowsOnEventTypeWhereInput } from "./WorkflowsOnEventTypeWhereInput"; + +export type WorkflowsOnEventTypeCountArgs = { + where?: WorkflowsOnEventTypeWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCreateInput.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCreateInput.ts new file mode 100644 index 0000000..5b874bd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeCreateInput.ts @@ -0,0 +1,7 @@ +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeCreateInput = { + workflow: WorkflowWhereUniqueInput; + eventType: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindManyArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindManyArgs.ts new file mode 100644 index 0000000..4dc9335 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindManyArgs.ts @@ -0,0 +1,9 @@ +import { WorkflowsOnEventTypeWhereInput } from "./WorkflowsOnEventTypeWhereInput"; +import { WorkflowsOnEventTypeOrderByInput } from "./WorkflowsOnEventTypeOrderByInput"; + +export type WorkflowsOnEventTypeFindManyArgs = { + where?: WorkflowsOnEventTypeWhereInput; + orderBy?: Array; + skip?: number; + take?: number; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindUniqueArgs.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindUniqueArgs.ts new file mode 100644 index 0000000..2020435 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeFindUniqueArgs.ts @@ -0,0 +1,5 @@ +import { WorkflowsOnEventTypeWhereUniqueInput } from "./WorkflowsOnEventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeFindUniqueArgs = { + where: WorkflowsOnEventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeListRelationFilter.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeListRelationFilter.ts new file mode 100644 index 0000000..85be4bd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeListRelationFilter.ts @@ -0,0 +1,7 @@ +import { WorkflowsOnEventTypeWhereInput } from "./WorkflowsOnEventTypeWhereInput"; + +export type WorkflowsOnEventTypeListRelationFilter = { + every?: WorkflowsOnEventTypeWhereInput; + some?: WorkflowsOnEventTypeWhereInput; + none?: WorkflowsOnEventTypeWhereInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeOrderByInput.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeOrderByInput.ts new file mode 100644 index 0000000..cba8706 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeOrderByInput.ts @@ -0,0 +1,7 @@ +import { SortOrder } from "../../util/SortOrder"; + +export type WorkflowsOnEventTypeOrderByInput = { + id?: SortOrder; + workflowId?: SortOrder; + eventTypeId?: SortOrder; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeUpdateInput.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeUpdateInput.ts new file mode 100644 index 0000000..063c0ac --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeUpdateInput.ts @@ -0,0 +1,7 @@ +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeUpdateInput = { + workflow?: WorkflowWhereUniqueInput; + eventType?: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereInput.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereInput.ts new file mode 100644 index 0000000..dd65231 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereInput.ts @@ -0,0 +1,9 @@ +import { IntFilter } from "../../util/IntFilter"; +import { WorkflowWhereUniqueInput } from "../workflow/WorkflowWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../eventType/EventTypeWhereUniqueInput"; + +export type WorkflowsOnEventTypeWhereInput = { + id?: IntFilter; + workflow?: WorkflowWhereUniqueInput; + eventType?: EventTypeWhereUniqueInput; +}; diff --git a/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput.ts b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput.ts new file mode 100644 index 0000000..cdd2208 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/api/workflowsOnEventType/WorkflowsOnEventTypeWhereUniqueInput.ts @@ -0,0 +1,3 @@ +export type WorkflowsOnEventTypeWhereUniqueInput = { + id: number; +}; diff --git a/apps/roi-cacl-2-admin/src/apiKey/ApiKeyCreate.tsx b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyCreate.tsx new file mode 100644 index 0000000..f5b2cba --- /dev/null +++ b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyCreate.tsx @@ -0,0 +1,37 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + DateTimeInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { AppModelTitle } from "../appModel/AppModelTitle"; + +export const ApiKeyCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/apiKey/ApiKeyEdit.tsx b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyEdit.tsx new file mode 100644 index 0000000..5d5014b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyEdit.tsx @@ -0,0 +1,37 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + DateTimeInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { AppModelTitle } from "../appModel/AppModelTitle"; + +export const ApiKeyEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/apiKey/ApiKeyList.tsx b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyList.tsx new file mode 100644 index 0000000..e9606d3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyList.tsx @@ -0,0 +1,43 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + DateField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; + +export const ApiKeyList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/apiKey/ApiKeyShow.tsx b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyShow.tsx new file mode 100644 index 0000000..933653b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyShow.tsx @@ -0,0 +1,36 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + DateField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; + +export const ApiKeyShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/apiKey/ApiKeyTitle.ts b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyTitle.ts new file mode 100644 index 0000000..09af0e8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/apiKey/ApiKeyTitle.ts @@ -0,0 +1,7 @@ +import { ApiKey as TApiKey } from "../api/apiKey/ApiKey"; + +export const APIKEY_TITLE_FIELD = "note"; + +export const ApiKeyTitle = (record: TApiKey): string => { + return record.note?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/appModel/AppModelCreate.tsx b/apps/roi-cacl-2-admin/src/appModel/AppModelCreate.tsx new file mode 100644 index 0000000..b92553a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/appModel/AppModelCreate.tsx @@ -0,0 +1,63 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + SelectArrayInput, + ReferenceArrayInput, +} from "react-admin"; + +import { CredentialTitle } from "../credential/CredentialTitle"; +import { WebhookTitle } from "../webhook/WebhookTitle"; +import { ApiKeyTitle } from "../apiKey/ApiKeyTitle"; + +export const AppModelCreate = (props: CreateProps): React.ReactElement => { + return ( + + + +
+ + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/appModel/AppModelEdit.tsx b/apps/roi-cacl-2-admin/src/appModel/AppModelEdit.tsx new file mode 100644 index 0000000..bf6caea --- /dev/null +++ b/apps/roi-cacl-2-admin/src/appModel/AppModelEdit.tsx @@ -0,0 +1,63 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + SelectArrayInput, + ReferenceArrayInput, +} from "react-admin"; + +import { CredentialTitle } from "../credential/CredentialTitle"; +import { WebhookTitle } from "../webhook/WebhookTitle"; +import { ApiKeyTitle } from "../apiKey/ApiKeyTitle"; + +export const AppModelEdit = (props: EditProps): React.ReactElement => { + return ( + + + +
+ + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/appModel/AppModelList.tsx b/apps/roi-cacl-2-admin/src/appModel/AppModelList.tsx new file mode 100644 index 0000000..6f51b72 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/appModel/AppModelList.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { List, Datagrid, ListProps, TextField, DateField } from "react-admin"; +import Pagination from "../Components/Pagination"; + +export const AppModelList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/appModel/AppModelShow.tsx b/apps/roi-cacl-2-admin/src/appModel/AppModelShow.tsx new file mode 100644 index 0000000..5866d2d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/appModel/AppModelShow.tsx @@ -0,0 +1,101 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + DateField, + ReferenceManyField, + Datagrid, + ReferenceField, + BooleanField, +} from "react-admin"; + +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { APPMODEL_TITLE_FIELD } from "./AppModelTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const AppModelShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/appModel/AppModelTitle.ts b/apps/roi-cacl-2-admin/src/appModel/AppModelTitle.ts new file mode 100644 index 0000000..6f6476b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/appModel/AppModelTitle.ts @@ -0,0 +1,7 @@ +import { AppModel as TAppModel } from "../api/appModel/AppModel"; + +export const APPMODEL_TITLE_FIELD = "dirName"; + +export const AppModelTitle = (record: TAppModel): string => { + return record.dirName?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/attendee/AttendeeCreate.tsx b/apps/roi-cacl-2-admin/src/attendee/AttendeeCreate.tsx new file mode 100644 index 0000000..c22e5df --- /dev/null +++ b/apps/roi-cacl-2-admin/src/attendee/AttendeeCreate.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { BookingTitle } from "../booking/BookingTitle"; + +export const AttendeeCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/attendee/AttendeeEdit.tsx b/apps/roi-cacl-2-admin/src/attendee/AttendeeEdit.tsx new file mode 100644 index 0000000..408a04d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/attendee/AttendeeEdit.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { BookingTitle } from "../booking/BookingTitle"; + +export const AttendeeEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/attendee/AttendeeList.tsx b/apps/roi-cacl-2-admin/src/attendee/AttendeeList.tsx new file mode 100644 index 0000000..56cbac9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/attendee/AttendeeList.tsx @@ -0,0 +1,33 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const AttendeeList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/attendee/AttendeeShow.tsx b/apps/roi-cacl-2-admin/src/attendee/AttendeeShow.tsx new file mode 100644 index 0000000..6416c9b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/attendee/AttendeeShow.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const AttendeeShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/attendee/AttendeeTitle.ts b/apps/roi-cacl-2-admin/src/attendee/AttendeeTitle.ts new file mode 100644 index 0000000..7592413 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/attendee/AttendeeTitle.ts @@ -0,0 +1,7 @@ +import { Attendee as TAttendee } from "../api/attendee/Attendee"; + +export const ATTENDEE_TITLE_FIELD = "name"; + +export const AttendeeTitle = (record: TAttendee): string => { + return record.name?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/auth-provider/ra-auth-http.ts b/apps/roi-cacl-2-admin/src/auth-provider/ra-auth-http.ts new file mode 100644 index 0000000..c6eeba8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/auth-provider/ra-auth-http.ts @@ -0,0 +1,78 @@ +import { gql } from "@apollo/client/core"; +import { AuthProvider } from "react-admin"; +import { + CREDENTIALS_LOCAL_STORAGE_ITEM, + USER_DATA_LOCAL_STORAGE_ITEM, +} from "../constants"; +import { Credentials, LoginMutateResult } from "../types"; +import { apolloClient } from "../data-provider/graphqlDataProvider"; + +const LOGIN = gql` + mutation login($username: String!, $password: String!) { + login(credentials: { username: $username, password: $password }) { + username + roles + } + } +`; + +export const httpAuthProvider: AuthProvider = { + login: async (credentials: Credentials) => { + const userData = await apolloClient.mutate({ + mutation: LOGIN, + variables: { + ...credentials, + }, + }); + + if (userData && userData.data?.login.username) { + localStorage.setItem( + CREDENTIALS_LOCAL_STORAGE_ITEM, + createBasicAuthorizationHeader( + credentials.username, + credentials.password + ) + ); + localStorage.setItem( + USER_DATA_LOCAL_STORAGE_ITEM, + JSON.stringify(userData.data) + ); + return Promise.resolve(); + } + return Promise.reject(); + }, + logout: () => { + localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM); + return Promise.resolve(); + }, + checkError: ({ status }: any) => { + if (status === 401 || status === 403) { + localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM); + return Promise.reject(); + } + return Promise.resolve(); + }, + checkAuth: () => { + return localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM) + ? Promise.resolve() + : Promise.reject(); + }, + getPermissions: () => Promise.reject("Unknown method"), + getIdentity: () => { + const str = localStorage.getItem(USER_DATA_LOCAL_STORAGE_ITEM); + const userData: LoginMutateResult = JSON.parse(str || ""); + + return Promise.resolve({ + id: userData.login.username, + fullName: userData.login.username, + avatar: undefined, + }); + }, +}; + +function createBasicAuthorizationHeader( + username: string, + password: string +): string { + return `Basic ${btoa(`${username}:${password}`)}`; +} diff --git a/apps/roi-cacl-2-admin/src/auth-provider/ra-auth-jwt.ts b/apps/roi-cacl-2-admin/src/auth-provider/ra-auth-jwt.ts new file mode 100644 index 0000000..c8bcafc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/auth-provider/ra-auth-jwt.ts @@ -0,0 +1,72 @@ +import { gql } from "@apollo/client/core"; +import { AuthProvider } from "react-admin"; +import { + CREDENTIALS_LOCAL_STORAGE_ITEM, + USER_DATA_LOCAL_STORAGE_ITEM, +} from "../constants"; +import { Credentials, LoginMutateResult } from "../types"; +import { apolloClient } from "../data-provider/graphqlDataProvider"; + +const LOGIN = gql` + mutation login($username: String!, $password: String!) { + login(credentials: { username: $username, password: $password }) { + username + accessToken + } + } +`; + +export const jwtAuthProvider: AuthProvider = { + login: async (credentials: Credentials) => { + const userData = await apolloClient.mutate({ + mutation: LOGIN, + variables: { + ...credentials, + }, + }); + + if (userData && userData.data?.login.username) { + localStorage.setItem( + CREDENTIALS_LOCAL_STORAGE_ITEM, + createBearerAuthorizationHeader(userData.data.login?.accessToken) + ); + localStorage.setItem( + USER_DATA_LOCAL_STORAGE_ITEM, + JSON.stringify(userData.data) + ); + return Promise.resolve(); + } + return Promise.reject(); + }, + logout: () => { + localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM); + return Promise.resolve(); + }, + checkError: ({ status }: any) => { + if (status === 401 || status === 403) { + localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM); + return Promise.reject(); + } + return Promise.resolve(); + }, + checkAuth: () => { + return localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM) + ? Promise.resolve() + : Promise.reject(); + }, + getPermissions: () => Promise.reject("Unknown method"), + getIdentity: () => { + const str = localStorage.getItem(USER_DATA_LOCAL_STORAGE_ITEM); + const userData: LoginMutateResult = JSON.parse(str || ""); + + return Promise.resolve({ + id: userData.login.username, + fullName: userData.login.username, + avatar: undefined, + }); + }, +}; + +export function createBearerAuthorizationHeader(accessToken: string) { + return `Bearer ${accessToken}`; +} diff --git a/apps/roi-cacl-2-admin/src/auth.ts b/apps/roi-cacl-2-admin/src/auth.ts new file mode 100644 index 0000000..498b026 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/auth.ts @@ -0,0 +1,34 @@ +import { EventEmitter } from "events"; +import { CREDENTIALS_LOCAL_STORAGE_ITEM } from "./constants"; +import { Credentials } from "./types"; + +const eventEmitter = new EventEmitter(); + +export function isAuthenticated(): boolean { + return Boolean(getCredentials()); +} + +export function listen(listener: (authenticated: boolean) => void): void { + eventEmitter.on("change", () => { + listener(isAuthenticated()); + }); +} + +export function setCredentials(credentials: Credentials) { + localStorage.setItem( + CREDENTIALS_LOCAL_STORAGE_ITEM, + JSON.stringify(credentials) + ); +} + +export function getCredentials(): Credentials | null { + const raw = localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM); + if (raw === null) { + return null; + } + return JSON.parse(raw); +} + +export function removeCredentials(): void { + localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM); +} diff --git a/apps/roi-cacl-2-admin/src/availability/AvailabilityCreate.tsx b/apps/roi-cacl-2-admin/src/availability/AvailabilityCreate.tsx new file mode 100644 index 0000000..bba64e3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/availability/AvailabilityCreate.tsx @@ -0,0 +1,45 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + ReferenceInput, + SelectInput, + NumberInput, + DateTimeInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { ScheduleTitle } from "../schedule/ScheduleTitle"; + +export const AvailabilityCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/availability/AvailabilityEdit.tsx b/apps/roi-cacl-2-admin/src/availability/AvailabilityEdit.tsx new file mode 100644 index 0000000..d751508 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/availability/AvailabilityEdit.tsx @@ -0,0 +1,45 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + ReferenceInput, + SelectInput, + NumberInput, + DateTimeInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { ScheduleTitle } from "../schedule/ScheduleTitle"; + +export const AvailabilityEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/availability/AvailabilityList.tsx b/apps/roi-cacl-2-admin/src/availability/AvailabilityList.tsx new file mode 100644 index 0000000..9aac891 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/availability/AvailabilityList.tsx @@ -0,0 +1,49 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { SCHEDULE_TITLE_FIELD } from "../schedule/ScheduleTitle"; + +export const AvailabilityList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/availability/AvailabilityShow.tsx b/apps/roi-cacl-2-admin/src/availability/AvailabilityShow.tsx new file mode 100644 index 0000000..8528642 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/availability/AvailabilityShow.tsx @@ -0,0 +1,42 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { SCHEDULE_TITLE_FIELD } from "../schedule/ScheduleTitle"; + +export const AvailabilityShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/availability/AvailabilityTitle.ts b/apps/roi-cacl-2-admin/src/availability/AvailabilityTitle.ts new file mode 100644 index 0000000..1271cf1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/availability/AvailabilityTitle.ts @@ -0,0 +1,7 @@ +import { Availability as TAvailability } from "../api/availability/Availability"; + +export const AVAILABILITY_TITLE_FIELD = "id"; + +export const AvailabilityTitle = (record: TAvailability): string => { + return record.id?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/booking/BookingCreate.tsx b/apps/roi-cacl-2-admin/src/booking/BookingCreate.tsx new file mode 100644 index 0000000..bd53f00 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/booking/BookingCreate.tsx @@ -0,0 +1,123 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, + DateTimeInput, + BooleanInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; +import { BookingReferenceTitle } from "../bookingReference/BookingReferenceTitle"; +import { AttendeeTitle } from "../attendee/AttendeeTitle"; +import { DailyEventReferenceTitle } from "../dailyEventReference/DailyEventReferenceTitle"; +import { PaymentTitle } from "../payment/PaymentTitle"; +import { WorkflowReminderTitle } from "../workflowReminder/WorkflowReminderTitle"; + +export const BookingCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/booking/BookingEdit.tsx b/apps/roi-cacl-2-admin/src/booking/BookingEdit.tsx new file mode 100644 index 0000000..7b559e2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/booking/BookingEdit.tsx @@ -0,0 +1,123 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, + DateTimeInput, + BooleanInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; +import { BookingReferenceTitle } from "../bookingReference/BookingReferenceTitle"; +import { AttendeeTitle } from "../attendee/AttendeeTitle"; +import { DailyEventReferenceTitle } from "../dailyEventReference/DailyEventReferenceTitle"; +import { PaymentTitle } from "../payment/PaymentTitle"; +import { WorkflowReminderTitle } from "../workflowReminder/WorkflowReminderTitle"; + +export const BookingEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/booking/BookingList.tsx b/apps/roi-cacl-2-admin/src/booking/BookingList.tsx new file mode 100644 index 0000000..80e9120 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/booking/BookingList.tsx @@ -0,0 +1,82 @@ +import * as React from "react"; + +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, + DateField, + BooleanField, +} from "react-admin"; + +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; +import { DAILYEVENTREFERENCE_TITLE_FIELD } from "../dailyEventReference/DailyEventReferenceTitle"; + +export const BookingList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/booking/BookingShow.tsx b/apps/roi-cacl-2-admin/src/booking/BookingShow.tsx new file mode 100644 index 0000000..1088cff --- /dev/null +++ b/apps/roi-cacl-2-admin/src/booking/BookingShow.tsx @@ -0,0 +1,177 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + DateField, + BooleanField, + ReferenceManyField, + Datagrid, +} from "react-admin"; + +import { BOOKING_TITLE_FIELD } from "./BookingTitle"; +import { WORKFLOWSTEP_TITLE_FIELD } from "../workflowStep/WorkflowStepTitle"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; +import { DAILYEVENTREFERENCE_TITLE_FIELD } from "../dailyEventReference/DailyEventReferenceTitle"; + +export const BookingShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/booking/BookingTitle.ts b/apps/roi-cacl-2-admin/src/booking/BookingTitle.ts new file mode 100644 index 0000000..0eb8f1d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/booking/BookingTitle.ts @@ -0,0 +1,7 @@ +import { Booking as TBooking } from "../api/booking/Booking"; + +export const BOOKING_TITLE_FIELD = "title"; + +export const BookingTitle = (record: TBooking): string => { + return record.title?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceCreate.tsx b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceCreate.tsx new file mode 100644 index 0000000..09ca1f5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceCreate.tsx @@ -0,0 +1,34 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, + BooleanInput, +} from "react-admin"; + +import { BookingTitle } from "../booking/BookingTitle"; + +export const BookingReferenceCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceEdit.tsx b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceEdit.tsx new file mode 100644 index 0000000..7ed2063 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceEdit.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, + BooleanInput, +} from "react-admin"; + +import { BookingTitle } from "../booking/BookingTitle"; + +export const BookingReferenceEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceList.tsx b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceList.tsx new file mode 100644 index 0000000..0352fd1 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceList.tsx @@ -0,0 +1,37 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const BookingReferenceList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceShow.tsx b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceShow.tsx new file mode 100644 index 0000000..9e9afff --- /dev/null +++ b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceShow.tsx @@ -0,0 +1,30 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const BookingReferenceShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceTitle.ts b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceTitle.ts new file mode 100644 index 0000000..5152ba4 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/bookingReference/BookingReferenceTitle.ts @@ -0,0 +1,7 @@ +import { BookingReference as TBookingReference } from "../api/bookingReference/BookingReference"; + +export const BOOKINGREFERENCE_TITLE_FIELD = "typeField"; + +export const BookingReferenceTitle = (record: TBookingReference): string => { + return record.typeField?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/constants.ts b/apps/roi-cacl-2-admin/src/constants.ts new file mode 100644 index 0000000..4b3ca4b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/constants.ts @@ -0,0 +1,2 @@ +export const CREDENTIALS_LOCAL_STORAGE_ITEM = "credentials"; +export const USER_DATA_LOCAL_STORAGE_ITEM = "userData"; diff --git a/apps/roi-cacl-2-admin/src/credential/CredentialCreate.tsx b/apps/roi-cacl-2-admin/src/credential/CredentialCreate.tsx new file mode 100644 index 0000000..7db7b66 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/credential/CredentialCreate.tsx @@ -0,0 +1,45 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { AppModelTitle } from "../appModel/AppModelTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; + +export const CredentialCreate = (props: CreateProps): React.ReactElement => { + return ( + + + +
+ + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/credential/CredentialEdit.tsx b/apps/roi-cacl-2-admin/src/credential/CredentialEdit.tsx new file mode 100644 index 0000000..025d394 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/credential/CredentialEdit.tsx @@ -0,0 +1,45 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { AppModelTitle } from "../appModel/AppModelTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; + +export const CredentialEdit = (props: EditProps): React.ReactElement => { + return ( + + + +
+ + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/credential/CredentialList.tsx b/apps/roi-cacl-2-admin/src/credential/CredentialList.tsx new file mode 100644 index 0000000..3376a99 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/credential/CredentialList.tsx @@ -0,0 +1,39 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; + +export const CredentialList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/credential/CredentialShow.tsx b/apps/roi-cacl-2-admin/src/credential/CredentialShow.tsx new file mode 100644 index 0000000..d312983 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/credential/CredentialShow.tsx @@ -0,0 +1,74 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + ReferenceManyField, + Datagrid, +} from "react-admin"; + +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { CREDENTIAL_TITLE_FIELD } from "./CredentialTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; + +export const CredentialShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/credential/CredentialTitle.ts b/apps/roi-cacl-2-admin/src/credential/CredentialTitle.ts new file mode 100644 index 0000000..3a1a211 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/credential/CredentialTitle.ts @@ -0,0 +1,7 @@ +import { Credential as TCredential } from "../api/credential/Credential"; + +export const CREDENTIAL_TITLE_FIELD = "typeField"; + +export const CredentialTitle = (record: TCredential): string => { + return record.typeField?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceCreate.tsx b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceCreate.tsx new file mode 100644 index 0000000..09a2f12 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceCreate.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { BookingTitle } from "../booking/BookingTitle"; + +export const DailyEventReferenceCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceEdit.tsx b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceEdit.tsx new file mode 100644 index 0000000..75adb98 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceEdit.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { BookingTitle } from "../booking/BookingTitle"; + +export const DailyEventReferenceEdit = ( + props: EditProps +): React.ReactElement => { + return ( + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceList.tsx b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceList.tsx new file mode 100644 index 0000000..b94e22f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceList.tsx @@ -0,0 +1,33 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const DailyEventReferenceList = ( + props: ListProps +): React.ReactElement => { + return ( + } + > + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceShow.tsx b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceShow.tsx new file mode 100644 index 0000000..6bee5af --- /dev/null +++ b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceShow.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const DailyEventReferenceShow = ( + props: ShowProps +): React.ReactElement => { + return ( + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceTitle.ts b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceTitle.ts new file mode 100644 index 0000000..6aef3ef --- /dev/null +++ b/apps/roi-cacl-2-admin/src/dailyEventReference/DailyEventReferenceTitle.ts @@ -0,0 +1,9 @@ +import { DailyEventReference as TDailyEventReference } from "../api/dailyEventReference/DailyEventReference"; + +export const DAILYEVENTREFERENCE_TITLE_FIELD = "dailyurl"; + +export const DailyEventReferenceTitle = ( + record: TDailyEventReference +): string => { + return record.dailyurl?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/data-provider/graphqlDataProvider.ts b/apps/roi-cacl-2-admin/src/data-provider/graphqlDataProvider.ts new file mode 100644 index 0000000..3ec4466 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/data-provider/graphqlDataProvider.ts @@ -0,0 +1,28 @@ +import buildGraphQLProvider from "ra-data-graphql-amplication"; +import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client"; +import { setContext } from "@apollo/client/link/context"; +import { CREDENTIALS_LOCAL_STORAGE_ITEM } from "../constants"; + +const httpLink = createHttpLink({ + uri: `${process.env.REACT_APP_SERVER_URL}/graphql`, +}); + +// eslint-disable-next-line @typescript-eslint/naming-convention +const authLink = setContext((_, { headers }) => { + const token = localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM); + return { + headers: { + ...headers, + authorization: token ? token : "", + }, + }; +}); + +export const apolloClient = new ApolloClient({ + cache: new InMemoryCache(), + link: authLink.concat(httpLink), +}); + +export default buildGraphQLProvider({ + client: apolloClient, +}); diff --git a/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarCreate.tsx b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarCreate.tsx new file mode 100644 index 0000000..b5f149a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarCreate.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { UserTitle } from "../user/UserTitle"; +import { BookingTitle } from "../booking/BookingTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { CredentialTitle } from "../credential/CredentialTitle"; + +export const DestinationCalendarCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarEdit.tsx b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarEdit.tsx new file mode 100644 index 0000000..ec7ff85 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarEdit.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { UserTitle } from "../user/UserTitle"; +import { BookingTitle } from "../booking/BookingTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { CredentialTitle } from "../credential/CredentialTitle"; + +export const DestinationCalendarEdit = ( + props: EditProps +): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarList.tsx b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarList.tsx new file mode 100644 index 0000000..390bad3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarList.tsx @@ -0,0 +1,53 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { CREDENTIAL_TITLE_FIELD } from "../credential/CredentialTitle"; + +export const DestinationCalendarList = ( + props: ListProps +): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarShow.tsx b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarShow.tsx new file mode 100644 index 0000000..4df8f93 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarShow.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { CREDENTIAL_TITLE_FIELD } from "../credential/CredentialTitle"; + +export const DestinationCalendarShow = ( + props: ShowProps +): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarTitle.ts b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarTitle.ts new file mode 100644 index 0000000..8347c6f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/destinationCalendar/DestinationCalendarTitle.ts @@ -0,0 +1,9 @@ +import { DestinationCalendar as TDestinationCalendar } from "../api/destinationCalendar/DestinationCalendar"; + +export const DESTINATIONCALENDAR_TITLE_FIELD = "integration"; + +export const DestinationCalendarTitle = ( + record: TDestinationCalendar +): string => { + return record.integration?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/eventType/EventTypeCreate.tsx b/apps/roi-cacl-2-admin/src/eventType/EventTypeCreate.tsx new file mode 100644 index 0000000..f264de3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventType/EventTypeCreate.tsx @@ -0,0 +1,178 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + NumberInput, + BooleanInput, + ReferenceArrayInput, + SelectArrayInput, + ReferenceInput, + SelectInput, + DateTimeInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { TeamTitle } from "../team/TeamTitle"; +import { ScheduleTitle } from "../schedule/ScheduleTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; +import { BookingTitle } from "../booking/BookingTitle"; +import { AvailabilityTitle } from "../availability/AvailabilityTitle"; +import { EventTypeCustomInputTitle } from "../eventTypeCustomInput/EventTypeCustomInputTitle"; +import { WebhookTitle } from "../webhook/WebhookTitle"; +import { HashedLinkTitle } from "../hashedLink/HashedLinkTitle"; +import { WorkflowsOnEventTypeTitle } from "../workflowsOnEventType/WorkflowsOnEventTypeTitle"; + +export const EventTypeCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + +
+ + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventType/EventTypeEdit.tsx b/apps/roi-cacl-2-admin/src/eventType/EventTypeEdit.tsx new file mode 100644 index 0000000..dc6efe7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventType/EventTypeEdit.tsx @@ -0,0 +1,178 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + NumberInput, + BooleanInput, + ReferenceArrayInput, + SelectArrayInput, + ReferenceInput, + SelectInput, + DateTimeInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { TeamTitle } from "../team/TeamTitle"; +import { ScheduleTitle } from "../schedule/ScheduleTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; +import { BookingTitle } from "../booking/BookingTitle"; +import { AvailabilityTitle } from "../availability/AvailabilityTitle"; +import { EventTypeCustomInputTitle } from "../eventTypeCustomInput/EventTypeCustomInputTitle"; +import { WebhookTitle } from "../webhook/WebhookTitle"; +import { HashedLinkTitle } from "../hashedLink/HashedLinkTitle"; +import { WorkflowsOnEventTypeTitle } from "../workflowsOnEventType/WorkflowsOnEventTypeTitle"; + +export const EventTypeEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + +
+ + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + + value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventType/EventTypeList.tsx b/apps/roi-cacl-2-admin/src/eventType/EventTypeList.tsx new file mode 100644 index 0000000..70cad75 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventType/EventTypeList.tsx @@ -0,0 +1,92 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + BooleanField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { TEAM_TITLE_FIELD } from "../team/TeamTitle"; +import { SCHEDULE_TITLE_FIELD } from "../schedule/ScheduleTitle"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; +import { HASHEDLINK_TITLE_FIELD } from "../hashedLink/HashedLinkTitle"; + +export const EventTypeList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventType/EventTypeShow.tsx b/apps/roi-cacl-2-admin/src/eventType/EventTypeShow.tsx new file mode 100644 index 0000000..2b479fd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventType/EventTypeShow.tsx @@ -0,0 +1,261 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + BooleanField, + ReferenceField, + ReferenceManyField, + Datagrid, + DateField, +} from "react-admin"; + +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "./EventTypeTitle"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; +import { DAILYEVENTREFERENCE_TITLE_FIELD } from "../dailyEventReference/DailyEventReferenceTitle"; +import { SCHEDULE_TITLE_FIELD } from "../schedule/ScheduleTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; +import { WORKFLOW_TITLE_FIELD } from "../workflow/WorkflowTitle"; +import { TEAM_TITLE_FIELD } from "../team/TeamTitle"; +import { HASHEDLINK_TITLE_FIELD } from "../hashedLink/HashedLinkTitle"; + +export const EventTypeShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventType/EventTypeTitle.ts b/apps/roi-cacl-2-admin/src/eventType/EventTypeTitle.ts new file mode 100644 index 0000000..fa0f537 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventType/EventTypeTitle.ts @@ -0,0 +1,7 @@ +import { EventType as TEventType } from "../api/eventType/EventType"; + +export const EVENTTYPE_TITLE_FIELD = "eventName"; + +export const EventTypeTitle = (record: TEventType): string => { + return record.eventName?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputCreate.tsx b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputCreate.tsx new file mode 100644 index 0000000..1c00d56 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputCreate.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + ReferenceInput, + SelectInput, + TextInput, + BooleanInput, +} from "react-admin"; + +import { EventTypeTitle } from "../eventType/EventTypeTitle"; + +export const EventTypeCustomInputCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputEdit.tsx b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputEdit.tsx new file mode 100644 index 0000000..44a5f6f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputEdit.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + ReferenceInput, + SelectInput, + TextInput, + BooleanInput, +} from "react-admin"; + +import { EventTypeTitle } from "../eventType/EventTypeTitle"; + +export const EventTypeCustomInputEdit = ( + props: EditProps +): React.ReactElement => { + return ( + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputList.tsx b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputList.tsx new file mode 100644 index 0000000..b34feb9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputList.tsx @@ -0,0 +1,40 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const EventTypeCustomInputList = ( + props: ListProps +): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputShow.tsx b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputShow.tsx new file mode 100644 index 0000000..30c651c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputShow.tsx @@ -0,0 +1,33 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const EventTypeCustomInputShow = ( + props: ShowProps +): React.ReactElement => { + return ( + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputTitle.ts b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputTitle.ts new file mode 100644 index 0000000..44850f8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/eventTypeCustomInput/EventTypeCustomInputTitle.ts @@ -0,0 +1,9 @@ +import { EventTypeCustomInput as TEventTypeCustomInput } from "../api/eventTypeCustomInput/EventTypeCustomInput"; + +export const EVENTTYPECUSTOMINPUT_TITLE_FIELD = "label"; + +export const EventTypeCustomInputTitle = ( + record: TEventTypeCustomInput +): string => { + return record.label?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/feedback/FeedbackCreate.tsx b/apps/roi-cacl-2-admin/src/feedback/FeedbackCreate.tsx new file mode 100644 index 0000000..318ddcc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/feedback/FeedbackCreate.tsx @@ -0,0 +1,28 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + DateTimeInput, + ReferenceInput, + SelectInput, + TextInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; + +export const FeedbackCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/feedback/FeedbackEdit.tsx b/apps/roi-cacl-2-admin/src/feedback/FeedbackEdit.tsx new file mode 100644 index 0000000..9bd5b2a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/feedback/FeedbackEdit.tsx @@ -0,0 +1,28 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + DateTimeInput, + ReferenceInput, + SelectInput, + TextInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; + +export const FeedbackEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/feedback/FeedbackList.tsx b/apps/roi-cacl-2-admin/src/feedback/FeedbackList.tsx new file mode 100644 index 0000000..3681b75 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/feedback/FeedbackList.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const FeedbackList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/feedback/FeedbackShow.tsx b/apps/roi-cacl-2-admin/src/feedback/FeedbackShow.tsx new file mode 100644 index 0000000..3ee50bf --- /dev/null +++ b/apps/roi-cacl-2-admin/src/feedback/FeedbackShow.tsx @@ -0,0 +1,25 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const FeedbackShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/feedback/FeedbackTitle.ts b/apps/roi-cacl-2-admin/src/feedback/FeedbackTitle.ts new file mode 100644 index 0000000..f933e80 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/feedback/FeedbackTitle.ts @@ -0,0 +1,7 @@ +import { Feedback as TFeedback } from "../api/feedback/Feedback"; + +export const FEEDBACK_TITLE_FIELD = "rating"; + +export const FeedbackTitle = (record: TFeedback): string => { + return record.rating?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkCreate.tsx b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkCreate.tsx new file mode 100644 index 0000000..f027ca2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkCreate.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; + +export const HashedLinkCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkEdit.tsx b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkEdit.tsx new file mode 100644 index 0000000..45b1df5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkEdit.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; + +export const HashedLinkEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkList.tsx b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkList.tsx new file mode 100644 index 0000000..3308a75 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkList.tsx @@ -0,0 +1,34 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const HashedLinkList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkShow.tsx b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkShow.tsx new file mode 100644 index 0000000..732c0d9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkShow.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const HashedLinkShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkTitle.ts b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkTitle.ts new file mode 100644 index 0000000..f011cb6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/hashedLink/HashedLinkTitle.ts @@ -0,0 +1,7 @@ +import { HashedLink as THashedLink } from "../api/hashedLink/HashedLink"; + +export const HASHEDLINK_TITLE_FIELD = "link"; + +export const HashedLinkTitle = (record: THashedLink): string => { + return record.link?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/impersonation/ImpersonationCreate.tsx b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationCreate.tsx new file mode 100644 index 0000000..8222cec --- /dev/null +++ b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationCreate.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { UserTitle } from "../user/UserTitle"; + +export const ImpersonationCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/impersonation/ImpersonationEdit.tsx b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationEdit.tsx new file mode 100644 index 0000000..8a71474 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationEdit.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { UserTitle } from "../user/UserTitle"; + +export const ImpersonationEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/impersonation/ImpersonationList.tsx b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationList.tsx new file mode 100644 index 0000000..9d9a371 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationList.tsx @@ -0,0 +1,42 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + DateField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const ImpersonationList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/impersonation/ImpersonationShow.tsx b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationShow.tsx new file mode 100644 index 0000000..ef8feac --- /dev/null +++ b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationShow.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + DateField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const ImpersonationShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/impersonation/ImpersonationTitle.ts b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationTitle.ts new file mode 100644 index 0000000..29ebf38 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/impersonation/ImpersonationTitle.ts @@ -0,0 +1,7 @@ +import { Impersonation as TImpersonation } from "../api/impersonation/Impersonation"; + +export const IMPERSONATION_TITLE_FIELD = "id"; + +export const ImpersonationTitle = (record: TImpersonation): string => { + return record.id?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/index.css b/apps/roi-cacl-2-admin/src/index.css new file mode 100644 index 0000000..8686848 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/index.css @@ -0,0 +1,26 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +#root { + height: 100vh; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", + monospace; +} + +.amp-breadcrumbs { + padding: var(--default-spacing); +} + +.entity-id { + color: var(--primary); + text-decoration: underline; +} diff --git a/apps/roi-cacl-2-admin/src/index.tsx b/apps/roi-cacl-2-admin/src/index.tsx new file mode 100644 index 0000000..2da129c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/index.tsx @@ -0,0 +1,18 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import "./index.css"; + +import App from "./App"; +import reportWebVitals from "./reportWebVitals"; + +ReactDOM.render( + + + , + document.getElementById("root") +); + +// If you want to start measuring performance in your app, pass a function +// to log results (for example: reportWebVitals(console.log)) +// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +reportWebVitals(); diff --git a/apps/roi-cacl-2-admin/src/login.scss b/apps/roi-cacl-2-admin/src/login.scss new file mode 100644 index 0000000..667d8d2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/login.scss @@ -0,0 +1,119 @@ +:root { + --surface: #15192c; /*dark: black100 */ + --white: #15192c; /*dark: black100 */ + + --black100: #ffffff; /*dark: white */ + --black90: #b7bac7; /*dark: black10 */ + --black80: #a3a8b8; /*dark: black20 */ + --black60: #80869d; /*dark: black30 */ + --black40: #686f8c; /*dark: black40 */ + --black30: #515873; /*dark: black50 */ + --black20: #444b66; /*dark: black60 */ + --black10: #373d57; /*dark: black70 */ + --black5: #2c3249; /*dark: black80 */ + --black2: #22273c; /*dark: black90 */ + + --primary: #7950ed; +} + +.login-page { + height: 100vh; + width: 100%; + background-color: var(--surface); + color: var(--black100); + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + + &__wrapper { + display: flex; + align-items: stretch; + justify-content: center; + flex-direction: row; + } + + &__box { + text-align: center; + width: 340px; + background-color: var(--black2); + border-radius: var(--small-border-radius); + margin: 1rem; + padding: 1rem; + border: 1px solid var(--black10); + display: flex; + flex-direction: column; + align-items: center; + justify-content: stretch; + + h2 { + font-size: 18px; + } + img { + width: 48px; + } + + &__message { + color: var(--black80); + font-size: 14px; + line-height: 22px; + } + + button, + .MuiButton-contained { + box-sizing: border-box; + background-color: var(--primary); + width: 300px; + margin-top: 0.5rem; + margin-bottom: 1rem; + margin-top: auto; + &:hover, + &:active, + &:focus { + background-color: var(--primary); + } + } + } + + form { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + margin-top: 2rem; + + label { + span { + display: block; + text-align: left; + font-size: 12px; + color: var(--black60); + } + } + + input { + box-sizing: border-box; + background-color: var(--white); + border: 1px solid var(--black10); + padding: 0.5rem; + margin-bottom: 1rem; + outline: none; + border-radius: var(--small-border-radius); + width: 300px; + color: var(--black100); + &:hover, + &:active, + &:focus { + border: 1px solid var(--black100); + } + } + } + + &__read-more { + color: var(--black80); + a { + color: var(--black100); + text-decoration: none; + } + } +} diff --git a/apps/roi-cacl-2-admin/src/membership/MembershipCreate.tsx b/apps/roi-cacl-2-admin/src/membership/MembershipCreate.tsx new file mode 100644 index 0000000..3344097 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/membership/MembershipCreate.tsx @@ -0,0 +1,38 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + BooleanInput, + SelectInput, + ReferenceInput, +} from "react-admin"; +import { TeamTitle } from "../team/TeamTitle"; +import { UserTitle } from "../user/UserTitle"; + +export const MembershipCreate = (props: CreateProps): React.ReactElement => { + return ( + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/membership/MembershipEdit.tsx b/apps/roi-cacl-2-admin/src/membership/MembershipEdit.tsx new file mode 100644 index 0000000..81f74eb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/membership/MembershipEdit.tsx @@ -0,0 +1,38 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + BooleanInput, + SelectInput, + ReferenceInput, +} from "react-admin"; +import { TeamTitle } from "../team/TeamTitle"; +import { UserTitle } from "../user/UserTitle"; + +export const MembershipEdit = (props: EditProps): React.ReactElement => { + return ( + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/membership/MembershipList.tsx b/apps/roi-cacl-2-admin/src/membership/MembershipList.tsx new file mode 100644 index 0000000..6c57f7e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/membership/MembershipList.tsx @@ -0,0 +1,36 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + BooleanField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { TEAM_TITLE_FIELD } from "../team/TeamTitle"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const MembershipList = (props: ListProps): React.ReactElement => { + return ( + } + > + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/membership/MembershipShow.tsx b/apps/roi-cacl-2-admin/src/membership/MembershipShow.tsx new file mode 100644 index 0000000..a4725a5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/membership/MembershipShow.tsx @@ -0,0 +1,29 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + BooleanField, + ReferenceField, +} from "react-admin"; +import { TEAM_TITLE_FIELD } from "../team/TeamTitle"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const MembershipShow = (props: ShowProps): React.ReactElement => { + return ( + + + + + + + + + + + + + + ); +}; diff --git a/apps/roi-cacl-2-admin/src/membership/MembershipTitle.ts b/apps/roi-cacl-2-admin/src/membership/MembershipTitle.ts new file mode 100644 index 0000000..b190e01 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/membership/MembershipTitle.ts @@ -0,0 +1,7 @@ +import { Membership as TMembership } from "../api/membership/Membership"; + +export const MEMBERSHIP_TITLE_FIELD = "id"; + +export const MembershipTitle = (record: TMembership): string => { + return record.id?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/pages/Dashboard.tsx b/apps/roi-cacl-2-admin/src/pages/Dashboard.tsx new file mode 100644 index 0000000..39c4d18 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/pages/Dashboard.tsx @@ -0,0 +1,12 @@ +import * as React from "react"; +import Card from "@material-ui/core/Card"; +import CardContent from "@material-ui/core/CardContent"; +import { Title } from "react-admin"; +const Dashboard = () => ( + + + <CardContent>Welcome</CardContent> + </Card> +); + +export default Dashboard; diff --git a/apps/roi-cacl-2-admin/src/payment/PaymentCreate.tsx b/apps/roi-cacl-2-admin/src/payment/PaymentCreate.tsx new file mode 100644 index 0000000..d094908 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/payment/PaymentCreate.tsx @@ -0,0 +1,41 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + SelectInput, + ReferenceInput, + NumberInput, + BooleanInput, +} from "react-admin"; + +import { BookingTitle } from "../booking/BookingTitle"; + +export const PaymentCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Uid" source="uid" /> + <SelectInput + source="type" + label="Type" + choices={[{ label: "STRIPE", value: "STRIPE" }]} + optionText="label" + optionValue="value" + /> + <ReferenceInput source="booking.id" reference="Booking" label="Booking"> + <SelectInput optionText={BookingTitle} /> + </ReferenceInput> + <NumberInput step={1} label="Amount" source="amount" /> + <NumberInput step={1} label="Fee" source="fee" /> + <TextInput label="Currency" source="currency" /> + <BooleanInput label="Success" source="success" /> + <BooleanInput label="Refunded" source="refunded" /> + <div /> + <TextInput label="External Id" source="externalId" /> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/payment/PaymentEdit.tsx b/apps/roi-cacl-2-admin/src/payment/PaymentEdit.tsx new file mode 100644 index 0000000..5b55d21 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/payment/PaymentEdit.tsx @@ -0,0 +1,41 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + SelectInput, + ReferenceInput, + NumberInput, + BooleanInput, +} from "react-admin"; + +import { BookingTitle } from "../booking/BookingTitle"; + +export const PaymentEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Uid" source="uid" /> + <SelectInput + source="type" + label="Type" + choices={[{ label: "STRIPE", value: "STRIPE" }]} + optionText="label" + optionValue="value" + /> + <ReferenceInput source="booking.id" reference="Booking" label="Booking"> + <SelectInput optionText={BookingTitle} /> + </ReferenceInput> + <NumberInput step={1} label="Amount" source="amount" /> + <NumberInput step={1} label="Fee" source="fee" /> + <TextInput label="Currency" source="currency" /> + <BooleanInput label="Success" source="success" /> + <BooleanInput label="Refunded" source="refunded" /> + <div /> + <TextInput label="External Id" source="externalId" /> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/payment/PaymentList.tsx b/apps/roi-cacl-2-admin/src/payment/PaymentList.tsx new file mode 100644 index 0000000..257fadc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/payment/PaymentList.tsx @@ -0,0 +1,39 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const PaymentList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"Payments"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Uid" source="uid" /> + <TextField label="Type" source="type" /> + <ReferenceField label="Booking" source="booking.id" reference="Booking"> + <TextField source={BOOKING_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Amount" source="amount" /> + <TextField label="Fee" source="fee" /> + <TextField label="Currency" source="currency" /> + <BooleanField label="Success" source="success" /> + <BooleanField label="Refunded" source="refunded" /> + <TextField label="Data" source="data" /> + <TextField label="External Id" source="externalId" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/payment/PaymentShow.tsx b/apps/roi-cacl-2-admin/src/payment/PaymentShow.tsx new file mode 100644 index 0000000..2af8012 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/payment/PaymentShow.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; + +export const PaymentShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Uid" source="uid" /> + <TextField label="Type" source="type" /> + <ReferenceField label="Booking" source="booking.id" reference="Booking"> + <TextField source={BOOKING_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Amount" source="amount" /> + <TextField label="Fee" source="fee" /> + <TextField label="Currency" source="currency" /> + <BooleanField label="Success" source="success" /> + <BooleanField label="Refunded" source="refunded" /> + <TextField label="Data" source="data" /> + <TextField label="External Id" source="externalId" /> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/payment/PaymentTitle.ts b/apps/roi-cacl-2-admin/src/payment/PaymentTitle.ts new file mode 100644 index 0000000..9a33886 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/payment/PaymentTitle.ts @@ -0,0 +1,7 @@ +import { Payment as TPayment } from "../api/payment/Payment"; + +export const PAYMENT_TITLE_FIELD = "uid"; + +export const PaymentTitle = (record: TPayment): string => { + return record.uid?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailCreate.tsx b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailCreate.tsx new file mode 100644 index 0000000..61286d8 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailCreate.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + NumberInput, + SelectInput, +} from "react-admin"; + +export const ReminderMailCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <NumberInput step={1} label="Reference Id" source="referenceId" /> + <SelectInput + source="reminderType" + label="Reminder Type" + choices={[ + { + label: "PENDING_BOOKING_CONFIRMATION", + value: "PENDING_BOOKING_CONFIRMATION", + }, + ]} + optionText="label" + optionValue="value" + /> + <NumberInput step={1} label="Elapsed Minutes" source="elapsedMinutes" /> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailEdit.tsx b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailEdit.tsx new file mode 100644 index 0000000..59bea1b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailEdit.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + NumberInput, + SelectInput, +} from "react-admin"; + +export const ReminderMailEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <NumberInput step={1} label="Reference Id" source="referenceId" /> + <SelectInput + source="reminderType" + label="Reminder Type" + choices={[ + { + label: "PENDING_BOOKING_CONFIRMATION", + value: "PENDING_BOOKING_CONFIRMATION", + }, + ]} + optionText="label" + optionValue="value" + /> + <NumberInput step={1} label="Elapsed Minutes" source="elapsedMinutes" /> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailList.tsx b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailList.tsx new file mode 100644 index 0000000..944bece --- /dev/null +++ b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailList.tsx @@ -0,0 +1,23 @@ +import * as React from "react"; +import { List, Datagrid, ListProps, TextField, DateField } from "react-admin"; +import Pagination from "../Components/Pagination"; + +export const ReminderMailList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"ReminderMails"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Reference Id" source="referenceId" /> + <TextField label="Reminder Type" source="reminderType" /> + <TextField label="Elapsed Minutes" source="elapsedMinutes" /> + <DateField source="createdAt" label="Created At" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailShow.tsx b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailShow.tsx new file mode 100644 index 0000000..303677b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailShow.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + DateField, +} from "react-admin"; + +export const ReminderMailShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Reference Id" source="referenceId" /> + <TextField label="Reminder Type" source="reminderType" /> + <TextField label="Elapsed Minutes" source="elapsedMinutes" /> + <DateField source="createdAt" label="Created At" /> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailTitle.ts b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailTitle.ts new file mode 100644 index 0000000..07c026f --- /dev/null +++ b/apps/roi-cacl-2-admin/src/reminderMail/ReminderMailTitle.ts @@ -0,0 +1,7 @@ +import { ReminderMail as TReminderMail } from "../api/reminderMail/ReminderMail"; + +export const REMINDERMAIL_TITLE_FIELD = "id"; + +export const ReminderMailTitle = (record: TReminderMail): string => { + return record.id?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/reportWebVitals.ts b/apps/roi-cacl-2-admin/src/reportWebVitals.ts new file mode 100644 index 0000000..821a6cd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/reportWebVitals.ts @@ -0,0 +1,17 @@ +import { ReportHandler } from "web-vitals"; + +const reportWebVitals = (onPerfEntry?: ReportHandler): void => { + if (onPerfEntry && onPerfEntry instanceof Function) { + void import("web-vitals").then( + ({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + getCLS(onPerfEntry); + getFID(onPerfEntry); + getFCP(onPerfEntry); + getLCP(onPerfEntry); + getTTFB(onPerfEntry); + } + ); + } +}; + +export default reportWebVitals; diff --git a/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestCreate.tsx b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestCreate.tsx new file mode 100644 index 0000000..84b1c6a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestCreate.tsx @@ -0,0 +1,21 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + TextInput, + DateTimeInput, +} from "react-admin"; + +export const ResetPasswordRequestCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Email" source="email" /> + <DateTimeInput label="Expires" source="expires" /> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestEdit.tsx b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestEdit.tsx new file mode 100644 index 0000000..602807e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestEdit.tsx @@ -0,0 +1,21 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + TextInput, + DateTimeInput, +} from "react-admin"; + +export const ResetPasswordRequestEdit = ( + props: EditProps +): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Email" source="email" /> + <DateTimeInput label="Expires" source="expires" /> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestList.tsx b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestList.tsx new file mode 100644 index 0000000..ba1bc12 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestList.tsx @@ -0,0 +1,25 @@ +import * as React from "react"; +import { List, Datagrid, ListProps, TextField, DateField } from "react-admin"; +import Pagination from "../Components/Pagination"; + +export const ResetPasswordRequestList = ( + props: ListProps +): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"ResetPasswordRequests"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <DateField source="createdAt" label="Created At" /> + <DateField source="updatedAt" label="Updated At" /> + <TextField label="Email" source="email" /> + <TextField label="Expires" source="expires" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestShow.tsx b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestShow.tsx new file mode 100644 index 0000000..22041b9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestShow.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + DateField, +} from "react-admin"; + +export const ResetPasswordRequestShow = ( + props: ShowProps +): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <DateField source="createdAt" label="Created At" /> + <DateField source="updatedAt" label="Updated At" /> + <TextField label="Email" source="email" /> + <TextField label="Expires" source="expires" /> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestTitle.ts b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestTitle.ts new file mode 100644 index 0000000..e97976d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/resetPasswordRequest/ResetPasswordRequestTitle.ts @@ -0,0 +1,9 @@ +import { ResetPasswordRequest as TResetPasswordRequest } from "../api/resetPasswordRequest/ResetPasswordRequest"; + +export const RESETPASSWORDREQUEST_TITLE_FIELD = "email"; + +export const ResetPasswordRequestTitle = ( + record: TResetPasswordRequest +): string => { + return record.email?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/schedule/ScheduleCreate.tsx b/apps/roi-cacl-2-admin/src/schedule/ScheduleCreate.tsx new file mode 100644 index 0000000..9e9ee03 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/schedule/ScheduleCreate.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + ReferenceInput, + SelectInput, + TextInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { AvailabilityTitle } from "../availability/AvailabilityTitle"; + +export const ScheduleCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <TextInput label="Name" source="name" /> + <TextInput label="Time Zone" source="timeZone" /> + <ReferenceArrayInput + source="eventType" + reference="EventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={EventTypeTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="availability" + reference="Availability" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={AvailabilityTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/schedule/ScheduleEdit.tsx b/apps/roi-cacl-2-admin/src/schedule/ScheduleEdit.tsx new file mode 100644 index 0000000..965a656 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/schedule/ScheduleEdit.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + ReferenceInput, + SelectInput, + TextInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { AvailabilityTitle } from "../availability/AvailabilityTitle"; + +export const ScheduleEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <TextInput label="Name" source="name" /> + <TextInput label="Time Zone" source="timeZone" /> + <ReferenceArrayInput + source="eventType" + reference="EventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={EventTypeTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="availability" + reference="Availability" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={AvailabilityTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/schedule/ScheduleList.tsx b/apps/roi-cacl-2-admin/src/schedule/ScheduleList.tsx new file mode 100644 index 0000000..85ef04b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/schedule/ScheduleList.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const ScheduleList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"Schedules"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Name" source="name" /> + <TextField label="Time Zone" source="timeZone" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/schedule/ScheduleShow.tsx b/apps/roi-cacl-2-admin/src/schedule/ScheduleShow.tsx new file mode 100644 index 0000000..318f16d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/schedule/ScheduleShow.tsx @@ -0,0 +1,141 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + ReferenceManyField, + Datagrid, + BooleanField, +} from "react-admin"; + +import { TEAM_TITLE_FIELD } from "../team/TeamTitle"; +import { SCHEDULE_TITLE_FIELD } from "./ScheduleTitle"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; +import { HASHEDLINK_TITLE_FIELD } from "../hashedLink/HashedLinkTitle"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const ScheduleShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Name" source="name" /> + <TextField label="Time Zone" source="timeZone" /> + <ReferenceManyField + reference="EventType" + target="scheduleId" + label="EventTypes" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Title" source="title" /> + <TextField label="Slug" source="slug" /> + <TextField label="Description" source="description" /> + <TextField label="Position" source="position" /> + <TextField label="Locations" source="locations" /> + <TextField label="Length" source="length" /> + <BooleanField label="Hidden" source="hidden" /> + <TextField label="User Id" source="userId" /> + <ReferenceField label="Team" source="team.id" reference="Team"> + <TextField source={TEAM_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Event Name" source="eventName" /> + <TextField label="Time Zone" source="timeZone" /> + <TextField label="Period Type" source="periodType" /> + <TextField label="Period Start Date" source="periodStartDate" /> + <TextField label="Period End Date" source="periodEndDate" /> + <TextField label="Period Days" source="periodDays" /> + <BooleanField + label="Period Count Calendar Days" + source="periodCountCalendarDays" + /> + <BooleanField + label="Requires Confirmation" + source="requiresConfirmation" + /> + <TextField label="Recurring Event" source="recurringEvent" /> + <BooleanField label="Disable Guests" source="disableGuests" /> + <BooleanField + label="Hide Calendar Notes" + source="hideCalendarNotes" + /> + <TextField + label="Minimum Booking Notice" + source="minimumBookingNotice" + /> + <TextField label="Before Event Buffer" source="beforeEventBuffer" /> + <TextField label="After Event Buffer" source="afterEventBuffer" /> + <TextField label="Seats Per Time Slot" source="seatsPerTimeSlot" /> + <TextField label="Scheduling Type" source="schedulingType" /> + <ReferenceField + label="Schedule" + source="schedule.id" + reference="Schedule" + > + <TextField source={SCHEDULE_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Price" source="price" /> + <TextField label="Currency" source="currency" /> + <TextField label="Slot Interval" source="slotInterval" /> + <TextField label="Metadata" source="metadata" /> + <TextField + label="Success Redirect Url" + source="successRedirectUrl" + /> + <ReferenceField + label="Destination Calendar" + source="destinationcalendar.id" + reference="DestinationCalendar" + > + <TextField source={DESTINATIONCALENDAR_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Hashed Link" + source="hashedlink.id" + reference="HashedLink" + > + <TextField source={HASHEDLINK_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Availability" + target="scheduleId" + label="Availabilities" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Days" source="days" /> + <TextField label="Start Time" source="startTime" /> + <TextField label="End Time" source="endTime" /> + <TextField label="Date" source="date" /> + <ReferenceField + label="Schedule" + source="schedule.id" + reference="Schedule" + > + <TextField source={SCHEDULE_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/schedule/ScheduleTitle.ts b/apps/roi-cacl-2-admin/src/schedule/ScheduleTitle.ts new file mode 100644 index 0000000..678741c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/schedule/ScheduleTitle.ts @@ -0,0 +1,7 @@ +import { Schedule as TSchedule } from "../api/schedule/Schedule"; + +export const SCHEDULE_TITLE_FIELD = "name"; + +export const ScheduleTitle = (record: TSchedule): string => { + return record.name?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarCreate.tsx b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarCreate.tsx new file mode 100644 index 0000000..a507416 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarCreate.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + ReferenceInput, + SelectInput, + TextInput, +} from "react-admin"; +import { UserTitle } from "../user/UserTitle"; + +export const SelectedCalendarCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <TextInput label="Integration" source="integration" /> + <TextInput label="External Id" source="externalId" /> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarEdit.tsx b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarEdit.tsx new file mode 100644 index 0000000..764ed2d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarEdit.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + ReferenceInput, + SelectInput, + TextInput, +} from "react-admin"; +import { UserTitle } from "../user/UserTitle"; + +export const SelectedCalendarEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <TextInput label="Integration" source="integration" /> + <TextInput label="External Id" source="externalId" /> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarList.tsx b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarList.tsx new file mode 100644 index 0000000..83aa4dd --- /dev/null +++ b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarList.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const SelectedCalendarList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"SelectedCalendars"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Integration" source="integration" /> + <TextField label="External Id" source="externalId" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarShow.tsx b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarShow.tsx new file mode 100644 index 0000000..69d150b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarShow.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const SelectedCalendarShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Integration" source="integration" /> + <TextField label="External Id" source="externalId" /> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarTitle.ts b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarTitle.ts new file mode 100644 index 0000000..45a53c5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/selectedCalendar/SelectedCalendarTitle.ts @@ -0,0 +1,7 @@ +import { SelectedCalendar as TSelectedCalendar } from "../api/selectedCalendar/SelectedCalendar"; + +export const SELECTEDCALENDAR_TITLE_FIELD = "integration"; + +export const SelectedCalendarTitle = (record: TSelectedCalendar): string => { + return record.integration?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/session/SessionCreate.tsx b/apps/roi-cacl-2-admin/src/session/SessionCreate.tsx new file mode 100644 index 0000000..2e704f3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/session/SessionCreate.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + DateTimeInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; + +export const SessionCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Session Token" source="sessionToken" /> + <DateTimeInput label="Expires" source="expires" /> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/session/SessionEdit.tsx b/apps/roi-cacl-2-admin/src/session/SessionEdit.tsx new file mode 100644 index 0000000..5d8b026 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/session/SessionEdit.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + DateTimeInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; + +export const SessionEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Session Token" source="sessionToken" /> + <DateTimeInput label="Expires" source="expires" /> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/session/SessionList.tsx b/apps/roi-cacl-2-admin/src/session/SessionList.tsx new file mode 100644 index 0000000..25f9bed --- /dev/null +++ b/apps/roi-cacl-2-admin/src/session/SessionList.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const SessionList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"Sessions"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Session Token" source="sessionToken" /> + <TextField label="Expires" source="expires" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/session/SessionShow.tsx b/apps/roi-cacl-2-admin/src/session/SessionShow.tsx new file mode 100644 index 0000000..e5a065e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/session/SessionShow.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const SessionShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Session Token" source="sessionToken" /> + <TextField label="Expires" source="expires" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/session/SessionTitle.ts b/apps/roi-cacl-2-admin/src/session/SessionTitle.ts new file mode 100644 index 0000000..ad53575 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/session/SessionTitle.ts @@ -0,0 +1,7 @@ +import { Session as TSession } from "../api/session/Session"; + +export const SESSION_TITLE_FIELD = "sessionToken"; + +export const SessionTitle = (record: TSession): string => { + return record.sessionToken?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/setupTests.ts b/apps/roi-cacl-2-admin/src/setupTests.ts new file mode 100644 index 0000000..1dd407a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/setupTests.ts @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import "@testing-library/jest-dom"; diff --git a/apps/roi-cacl-2-admin/src/team/TeamCreate.tsx b/apps/roi-cacl-2-admin/src/team/TeamCreate.tsx new file mode 100644 index 0000000..959ec52 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/team/TeamCreate.tsx @@ -0,0 +1,44 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + BooleanInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { MembershipTitle } from "../membership/MembershipTitle"; + +export const TeamCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Name" source="name" /> + <TextInput label="Slug" source="slug" /> + <TextInput label="Logo" source="logo" /> + <TextInput label="Bio" source="bio" /> + <BooleanInput label="Hide Branding" source="hideBranding" /> + <ReferenceArrayInput + source="eventTypes" + reference="EventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={EventTypeTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="members" + reference="Membership" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={MembershipTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/team/TeamEdit.tsx b/apps/roi-cacl-2-admin/src/team/TeamEdit.tsx new file mode 100644 index 0000000..3652921 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/team/TeamEdit.tsx @@ -0,0 +1,44 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + BooleanInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { MembershipTitle } from "../membership/MembershipTitle"; + +export const TeamEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Name" source="name" /> + <TextInput label="Slug" source="slug" /> + <TextInput label="Logo" source="logo" /> + <TextInput label="Bio" source="bio" /> + <BooleanInput label="Hide Branding" source="hideBranding" /> + <ReferenceArrayInput + source="eventTypes" + reference="EventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={EventTypeTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="members" + reference="Membership" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={MembershipTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/team/TeamList.tsx b/apps/roi-cacl-2-admin/src/team/TeamList.tsx new file mode 100644 index 0000000..e127eb9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/team/TeamList.tsx @@ -0,0 +1,30 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + BooleanField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; + +export const TeamList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"Teams"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Name" source="name" /> + <TextField label="Slug" source="slug" /> + <TextField label="Logo" source="logo" /> + <TextField label="Bio" source="bio" /> + <BooleanField label="Hide Branding" source="hideBranding" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/team/TeamShow.tsx b/apps/roi-cacl-2-admin/src/team/TeamShow.tsx new file mode 100644 index 0000000..cfcb281 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/team/TeamShow.tsx @@ -0,0 +1,127 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + BooleanField, + ReferenceManyField, + Datagrid, + ReferenceField, +} from "react-admin"; + +import { TEAM_TITLE_FIELD } from "./TeamTitle"; +import { SCHEDULE_TITLE_FIELD } from "../schedule/ScheduleTitle"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; +import { HASHEDLINK_TITLE_FIELD } from "../hashedLink/HashedLinkTitle"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const TeamShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Name" source="name" /> + <TextField label="Slug" source="slug" /> + <TextField label="Logo" source="logo" /> + <TextField label="Bio" source="bio" /> + <BooleanField label="Hide Branding" source="hideBranding" /> + <ReferenceManyField + reference="EventType" + target="teamId" + label="EventTypes" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Title" source="title" /> + <TextField label="Slug" source="slug" /> + <TextField label="Description" source="description" /> + <TextField label="Position" source="position" /> + <TextField label="Locations" source="locations" /> + <TextField label="Length" source="length" /> + <BooleanField label="Hidden" source="hidden" /> + <TextField label="User Id" source="userId" /> + <ReferenceField label="Team" source="team.id" reference="Team"> + <TextField source={TEAM_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Event Name" source="eventName" /> + <TextField label="Time Zone" source="timeZone" /> + <TextField label="Period Type" source="periodType" /> + <TextField label="Period Start Date" source="periodStartDate" /> + <TextField label="Period End Date" source="periodEndDate" /> + <TextField label="Period Days" source="periodDays" /> + <BooleanField + label="Period Count Calendar Days" + source="periodCountCalendarDays" + /> + <BooleanField + label="Requires Confirmation" + source="requiresConfirmation" + /> + <TextField label="Recurring Event" source="recurringEvent" /> + <BooleanField label="Disable Guests" source="disableGuests" /> + <BooleanField + label="Hide Calendar Notes" + source="hideCalendarNotes" + /> + <TextField + label="Minimum Booking Notice" + source="minimumBookingNotice" + /> + <TextField label="Before Event Buffer" source="beforeEventBuffer" /> + <TextField label="After Event Buffer" source="afterEventBuffer" /> + <TextField label="Seats Per Time Slot" source="seatsPerTimeSlot" /> + <TextField label="Scheduling Type" source="schedulingType" /> + <ReferenceField + label="Schedule" + source="schedule.id" + reference="Schedule" + > + <TextField source={SCHEDULE_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Price" source="price" /> + <TextField label="Currency" source="currency" /> + <TextField label="Slot Interval" source="slotInterval" /> + <TextField label="Metadata" source="metadata" /> + <TextField + label="Success Redirect Url" + source="successRedirectUrl" + /> + <ReferenceField + label="Destination Calendar" + source="destinationcalendar.id" + reference="DestinationCalendar" + > + <TextField source={DESTINATIONCALENDAR_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Hashed Link" + source="hashedlink.id" + reference="HashedLink" + > + <TextField source={HASHEDLINK_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Membership" + target="teamId" + label="Memberships" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <BooleanField label="Accepted" source="accepted" /> + <TextField label="Role" source="role" /> + <ReferenceField label="Team" source="team.id" reference="Team"> + <TextField source={TEAM_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/team/TeamTitle.ts b/apps/roi-cacl-2-admin/src/team/TeamTitle.ts new file mode 100644 index 0000000..50d6ed6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/team/TeamTitle.ts @@ -0,0 +1,7 @@ +import { Team as TTeam } from "../api/team/Team"; + +export const TEAM_TITLE_FIELD = "name"; + +export const TeamTitle = (record: TTeam): string => { + return record.name?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/theme/theme.ts b/apps/roi-cacl-2-admin/src/theme/theme.ts new file mode 100644 index 0000000..56a1153 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/theme/theme.ts @@ -0,0 +1,33 @@ +import { defaultTheme } from "react-admin"; +import { createTheme, ThemeOptions } from "@material-ui/core/styles"; +import { merge } from "lodash"; +import createPalette from "@material-ui/core/styles/createPalette"; + +const palette = createPalette( + merge({}, defaultTheme.palette, { + primary: { + main: "#20a4f3", + }, + secondary: { + main: "#7950ed", + }, + error: { + main: "#e93c51", + }, + warning: { + main: "#f6aa50", + }, + info: { + main: "#144bc1", + }, + success: { + main: "#31c587", + }, + }) +); + +const themeOptions: ThemeOptions = { + palette, +}; + +export const theme = createTheme(merge({}, defaultTheme, themeOptions)); diff --git a/apps/roi-cacl-2-admin/src/types.ts b/apps/roi-cacl-2-admin/src/types.ts new file mode 100644 index 0000000..45a457d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/types.ts @@ -0,0 +1,13 @@ +import { JsonValue } from "type-fest"; + +export type Credentials = { + username: string; + password: string; +}; +export type LoginMutateResult = { + login: { + username: string; + accessToken: string; + }; +}; +export type InputJsonValue = Omit<JsonValue, "null">; diff --git a/apps/roi-cacl-2-admin/src/user/EnumRoles.ts b/apps/roi-cacl-2-admin/src/user/EnumRoles.ts new file mode 100644 index 0000000..3df7048 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/EnumRoles.ts @@ -0,0 +1,3 @@ +export enum EnumRoles { + User = "user", +} diff --git a/apps/roi-cacl-2-admin/src/user/RolesOptions.ts b/apps/roi-cacl-2-admin/src/user/RolesOptions.ts new file mode 100644 index 0000000..5e30fe9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/RolesOptions.ts @@ -0,0 +1,11 @@ +import { ROLES } from "./roles"; + +declare interface Role { + name: string; + displayName: string; +} + +export const ROLES_OPTIONS = ROLES.map((role: Role) => ({ + value: role.name, + label: role.displayName, +})); diff --git a/apps/roi-cacl-2-admin/src/user/UserCreate.tsx b/apps/roi-cacl-2-admin/src/user/UserCreate.tsx new file mode 100644 index 0000000..428d171 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/UserCreate.tsx @@ -0,0 +1,242 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + DateTimeInput, + NumberInput, + BooleanInput, + SelectInput, + ReferenceArrayInput, + SelectArrayInput, + ReferenceInput, +} from "react-admin"; + +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { CredentialTitle } from "../credential/CredentialTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; +import { MembershipTitle } from "../membership/MembershipTitle"; +import { BookingTitle } from "../booking/BookingTitle"; +import { ScheduleTitle } from "../schedule/ScheduleTitle"; +import { AvailabilityTitle } from "../availability/AvailabilityTitle"; +import { SelectedCalendarTitle } from "../selectedCalendar/SelectedCalendarTitle"; +import { WebhookTitle } from "../webhook/WebhookTitle"; +import { ImpersonationTitle } from "../impersonation/ImpersonationTitle"; +import { ApiKeyTitle } from "../apiKey/ApiKeyTitle"; +import { AccountTitle } from "../account/AccountTitle"; +import { SessionTitle } from "../session/SessionTitle"; +import { FeedbackTitle } from "../feedback/FeedbackTitle"; +import { WorkflowTitle } from "../workflow/WorkflowTitle"; + +export const UserCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Username" source="username" /> + <TextInput label="Name" source="name" /> + <TextInput label="Email" source="email" /> + <DateTimeInput label="Email Verified" source="emailVerified" /> + <TextInput label="Password" source="password" /> + <TextInput label="Bio" source="bio" /> + <TextInput label="Avatar" source="avatar" /> + <TextInput label="Time Zone" source="timeZone" /> + <TextInput label="Week Start" source="weekStart" /> + <NumberInput step={1} label="Start Time" source="startTime" /> + <NumberInput step={1} label="End Time" source="endTime" /> + <NumberInput step={1} label="Buffer Time" source="bufferTime" /> + <BooleanInput label="Hide Branding" source="hideBranding" /> + <TextInput label="Theme" source="theme" /> + <DateTimeInput label="Trial Ends At" source="trialEndsAt" /> + <NumberInput + step={1} + label="Default Schedule Id" + source="defaultScheduleId" + /> + <BooleanInput + label="Completed Onboarding" + source="completedOnboarding" + /> + <TextInput label="Locale" source="locale" /> + <NumberInput step={1} label="Time Format" source="timeFormat" /> + <TextInput label="Two Factor Secret" source="twoFactorSecret" /> + <BooleanInput label="Two Factor Enabled" source="twoFactorEnabled" /> + <SelectInput + source="identityProvider" + label="Identity Provider" + choices={[ + { label: "CAL", value: "CAL" }, + { label: "GOOGLE", value: "GOOGLE" }, + { label: "SAML", value: "SAML" }, + ]} + optionText="label" + optionValue="value" + /> + <TextInput label="Identity Provider Id" source="identityProviderId" /> + <NumberInput step={1} label="Invited To" source="invitedTo" /> + <SelectInput + source="plan" + label="Plan" + choices={[ + { label: "FREE", value: "FREE" }, + { label: "TRIAL", value: "TRIAL" }, + { label: "PRO", value: "PRO" }, + ]} + optionText="label" + optionValue="value" + /> + <TextInput label="Brand Color" source="brandColor" /> + <TextInput label="Dark Brand Color" source="darkBrandColor" /> + <BooleanInput label="Away" source="away" /> + <BooleanInput + label="Allow Dynamic Booking" + source="allowDynamicBooking" + /> + <div /> + <BooleanInput label="Verified" source="verified" /> + <SelectInput + source="role" + label="Role" + choices={[ + { label: "USER", value: "USER" }, + { label: "ADMIN", value: "ADMIN" }, + ]} + optionText="label" + optionValue="value" + /> + <BooleanInput + label="Disable Impersonation" + source="disableImpersonation" + /> + <ReferenceArrayInput + source="eventTypes" + reference="EventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={EventTypeTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="credentials" + reference="Credential" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={CredentialTitle} /> + </ReferenceArrayInput> + <ReferenceInput + source="destinationCalendar.id" + reference="DestinationCalendar" + label="Destination Calendar" + > + <SelectInput optionText={DestinationCalendarTitle} /> + </ReferenceInput> + <ReferenceArrayInput + source="teams" + reference="Membership" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={MembershipTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="bookings" + reference="Booking" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={BookingTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="schedules" + reference="Schedule" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ScheduleTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="availability" + reference="Availability" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={AvailabilityTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="selectedCalendars" + reference="SelectedCalendar" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={SelectedCalendarTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="webhooks" + reference="Webhook" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WebhookTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="impersonatedUsers" + reference="Impersonation" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ImpersonationTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="impersonatedBy" + reference="Impersonation" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ImpersonationTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="apiKeys" + reference="ApiKey" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ApiKeyTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="accounts" + reference="Account" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={AccountTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="sessions" + reference="Session" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={SessionTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="feedback" + reference="Feedback" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={FeedbackTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="workflows" + reference="Workflow" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/user/UserEdit.tsx b/apps/roi-cacl-2-admin/src/user/UserEdit.tsx new file mode 100644 index 0000000..5970d32 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/UserEdit.tsx @@ -0,0 +1,242 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + DateTimeInput, + NumberInput, + BooleanInput, + SelectInput, + ReferenceArrayInput, + SelectArrayInput, + ReferenceInput, +} from "react-admin"; + +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { CredentialTitle } from "../credential/CredentialTitle"; +import { DestinationCalendarTitle } from "../destinationCalendar/DestinationCalendarTitle"; +import { MembershipTitle } from "../membership/MembershipTitle"; +import { BookingTitle } from "../booking/BookingTitle"; +import { ScheduleTitle } from "../schedule/ScheduleTitle"; +import { AvailabilityTitle } from "../availability/AvailabilityTitle"; +import { SelectedCalendarTitle } from "../selectedCalendar/SelectedCalendarTitle"; +import { WebhookTitle } from "../webhook/WebhookTitle"; +import { ImpersonationTitle } from "../impersonation/ImpersonationTitle"; +import { ApiKeyTitle } from "../apiKey/ApiKeyTitle"; +import { AccountTitle } from "../account/AccountTitle"; +import { SessionTitle } from "../session/SessionTitle"; +import { FeedbackTitle } from "../feedback/FeedbackTitle"; +import { WorkflowTitle } from "../workflow/WorkflowTitle"; + +export const UserEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Username" source="username" /> + <TextInput label="Name" source="name" /> + <TextInput label="Email" source="email" /> + <DateTimeInput label="Email Verified" source="emailVerified" /> + <TextInput label="Password" source="password" /> + <TextInput label="Bio" source="bio" /> + <TextInput label="Avatar" source="avatar" /> + <TextInput label="Time Zone" source="timeZone" /> + <TextInput label="Week Start" source="weekStart" /> + <NumberInput step={1} label="Start Time" source="startTime" /> + <NumberInput step={1} label="End Time" source="endTime" /> + <NumberInput step={1} label="Buffer Time" source="bufferTime" /> + <BooleanInput label="Hide Branding" source="hideBranding" /> + <TextInput label="Theme" source="theme" /> + <DateTimeInput label="Trial Ends At" source="trialEndsAt" /> + <NumberInput + step={1} + label="Default Schedule Id" + source="defaultScheduleId" + /> + <BooleanInput + label="Completed Onboarding" + source="completedOnboarding" + /> + <TextInput label="Locale" source="locale" /> + <NumberInput step={1} label="Time Format" source="timeFormat" /> + <TextInput label="Two Factor Secret" source="twoFactorSecret" /> + <BooleanInput label="Two Factor Enabled" source="twoFactorEnabled" /> + <SelectInput + source="identityProvider" + label="Identity Provider" + choices={[ + { label: "CAL", value: "CAL" }, + { label: "GOOGLE", value: "GOOGLE" }, + { label: "SAML", value: "SAML" }, + ]} + optionText="label" + optionValue="value" + /> + <TextInput label="Identity Provider Id" source="identityProviderId" /> + <NumberInput step={1} label="Invited To" source="invitedTo" /> + <SelectInput + source="plan" + label="Plan" + choices={[ + { label: "FREE", value: "FREE" }, + { label: "TRIAL", value: "TRIAL" }, + { label: "PRO", value: "PRO" }, + ]} + optionText="label" + optionValue="value" + /> + <TextInput label="Brand Color" source="brandColor" /> + <TextInput label="Dark Brand Color" source="darkBrandColor" /> + <BooleanInput label="Away" source="away" /> + <BooleanInput + label="Allow Dynamic Booking" + source="allowDynamicBooking" + /> + <div /> + <BooleanInput label="Verified" source="verified" /> + <SelectInput + source="role" + label="Role" + choices={[ + { label: "USER", value: "USER" }, + { label: "ADMIN", value: "ADMIN" }, + ]} + optionText="label" + optionValue="value" + /> + <BooleanInput + label="Disable Impersonation" + source="disableImpersonation" + /> + <ReferenceArrayInput + source="eventTypes" + reference="EventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={EventTypeTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="credentials" + reference="Credential" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={CredentialTitle} /> + </ReferenceArrayInput> + <ReferenceInput + source="destinationCalendar.id" + reference="DestinationCalendar" + label="Destination Calendar" + > + <SelectInput optionText={DestinationCalendarTitle} /> + </ReferenceInput> + <ReferenceArrayInput + source="teams" + reference="Membership" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={MembershipTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="bookings" + reference="Booking" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={BookingTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="schedules" + reference="Schedule" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ScheduleTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="availability" + reference="Availability" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={AvailabilityTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="selectedCalendars" + reference="SelectedCalendar" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={SelectedCalendarTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="webhooks" + reference="Webhook" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WebhookTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="impersonatedUsers" + reference="Impersonation" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ImpersonationTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="impersonatedBy" + reference="Impersonation" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ImpersonationTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="apiKeys" + reference="ApiKey" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={ApiKeyTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="accounts" + reference="Account" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={AccountTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="sessions" + reference="Session" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={SessionTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="feedback" + reference="Feedback" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={FeedbackTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="workflows" + reference="Workflow" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/user/UserList.tsx b/apps/roi-cacl-2-admin/src/user/UserList.tsx new file mode 100644 index 0000000..a38dc76 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/UserList.tsx @@ -0,0 +1,80 @@ +import * as React from "react"; + +import { + List, + Datagrid, + ListProps, + TextField, + BooleanField, + DateField, + ReferenceField, +} from "react-admin"; + +import Pagination from "../Components/Pagination"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; + +export const UserList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"Users"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Username" source="username" /> + <TextField label="Name" source="name" /> + <TextField label="Email" source="email" /> + <TextField label="Email Verified" source="emailVerified" /> + <TextField label="Password" source="password" /> + <TextField label="Bio" source="bio" /> + <TextField label="Avatar" source="avatar" /> + <TextField label="Time Zone" source="timeZone" /> + <TextField label="Week Start" source="weekStart" /> + <TextField label="Start Time" source="startTime" /> + <TextField label="End Time" source="endTime" /> + <TextField label="Buffer Time" source="bufferTime" /> + <BooleanField label="Hide Branding" source="hideBranding" /> + <TextField label="Theme" source="theme" /> + <DateField source="createdDate" label="Created Date" /> + <TextField label="Trial Ends At" source="trialEndsAt" /> + <TextField label="Default Schedule Id" source="defaultScheduleId" /> + <BooleanField + label="Completed Onboarding" + source="completedOnboarding" + /> + <TextField label="Locale" source="locale" /> + <TextField label="Time Format" source="timeFormat" /> + <TextField label="Two Factor Secret" source="twoFactorSecret" /> + <BooleanField label="Two Factor Enabled" source="twoFactorEnabled" /> + <TextField label="Identity Provider" source="identityProvider" /> + <TextField label="Identity Provider Id" source="identityProviderId" /> + <TextField label="Invited To" source="invitedTo" /> + <TextField label="Plan" source="plan" /> + <TextField label="Brand Color" source="brandColor" /> + <TextField label="Dark Brand Color" source="darkBrandColor" /> + <BooleanField label="Away" source="away" /> + <BooleanField + label="Allow Dynamic Booking" + source="allowDynamicBooking" + /> + <TextField label="Metadata" source="metadata" /> + <BooleanField label="Verified" source="verified" /> + <TextField label="Role" source="role" /> + <BooleanField + label="Disable Impersonation" + source="disableImpersonation" + /> + <ReferenceField + label="Destination Calendar" + source="destinationcalendar.id" + reference="DestinationCalendar" + > + <TextField source={DESTINATIONCALENDAR_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/user/UserShow.tsx b/apps/roi-cacl-2-admin/src/user/UserShow.tsx new file mode 100644 index 0000000..6bbbc1a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/UserShow.tsx @@ -0,0 +1,405 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + BooleanField, + DateField, + ReferenceField, + ReferenceManyField, + Datagrid, +} from "react-admin"; + +import { USER_TITLE_FIELD } from "./UserTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; +import { TEAM_TITLE_FIELD } from "../team/TeamTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { DESTINATIONCALENDAR_TITLE_FIELD } from "../destinationCalendar/DestinationCalendarTitle"; +import { DAILYEVENTREFERENCE_TITLE_FIELD } from "../dailyEventReference/DailyEventReferenceTitle"; +import { SCHEDULE_TITLE_FIELD } from "../schedule/ScheduleTitle"; + +export const UserShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Username" source="username" /> + <TextField label="Name" source="name" /> + <TextField label="Email" source="email" /> + <TextField label="Email Verified" source="emailVerified" /> + <TextField label="Password" source="password" /> + <TextField label="Bio" source="bio" /> + <TextField label="Avatar" source="avatar" /> + <TextField label="Time Zone" source="timeZone" /> + <TextField label="Week Start" source="weekStart" /> + <TextField label="Start Time" source="startTime" /> + <TextField label="End Time" source="endTime" /> + <TextField label="Buffer Time" source="bufferTime" /> + <BooleanField label="Hide Branding" source="hideBranding" /> + <TextField label="Theme" source="theme" /> + <DateField source="createdDate" label="Created Date" /> + <TextField label="Trial Ends At" source="trialEndsAt" /> + <TextField label="Default Schedule Id" source="defaultScheduleId" /> + <BooleanField + label="Completed Onboarding" + source="completedOnboarding" + /> + <TextField label="Locale" source="locale" /> + <TextField label="Time Format" source="timeFormat" /> + <TextField label="Two Factor Secret" source="twoFactorSecret" /> + <BooleanField label="Two Factor Enabled" source="twoFactorEnabled" /> + <TextField label="Identity Provider" source="identityProvider" /> + <TextField label="Identity Provider Id" source="identityProviderId" /> + <TextField label="Invited To" source="invitedTo" /> + <TextField label="Plan" source="plan" /> + <TextField label="Brand Color" source="brandColor" /> + <TextField label="Dark Brand Color" source="darkBrandColor" /> + <BooleanField label="Away" source="away" /> + <BooleanField + label="Allow Dynamic Booking" + source="allowDynamicBooking" + /> + <TextField label="Metadata" source="metadata" /> + <BooleanField label="Verified" source="verified" /> + <TextField label="Role" source="role" /> + <BooleanField + label="Disable Impersonation" + source="disableImpersonation" + /> + <ReferenceField + label="Destination Calendar" + source="destinationcalendar.id" + reference="DestinationCalendar" + > + <TextField source={DESTINATIONCALENDAR_TITLE_FIELD} /> + </ReferenceField> + <ReferenceManyField + reference="Credential" + target="userId" + label="Credentials" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Type Field" source="typeField" /> + <TextField label="Key" source="key" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="App Field" + source="appmodel.id" + reference="AppModel" + > + <TextField source={APPMODEL_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Membership" + target="userId" + label="Memberships" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <BooleanField label="Accepted" source="accepted" /> + <TextField label="Role" source="role" /> + <ReferenceField label="Team" source="team.id" reference="Team"> + <TextField source={TEAM_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Booking" + target="userId" + label="Bookings" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Uid" source="uid" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Title" source="title" /> + <TextField label="Description" source="description" /> + <TextField label="Custom Inputs" source="customInputs" /> + <TextField label="Start Time" source="startTime" /> + <TextField label="End Time" source="endTime" /> + <TextField label="Location" source="location" /> + <DateField source="createdAt" label="Created At" /> + <TextField label="Updated At" source="updatedAt" /> + <TextField label="Status" source="status" /> + <BooleanField label="Paid" source="paid" /> + <TextField + label="Cancellation Reason" + source="cancellationReason" + /> + <TextField label="Rejection Reason" source="rejectionReason" /> + <TextField + label="Dynamic Event Slug Ref" + source="dynamicEventSlugRef" + /> + <TextField + label="Dynamic Group Slug Ref" + source="dynamicGroupSlugRef" + /> + <BooleanField label="Rescheduled" source="rescheduled" /> + <TextField label="From Reschedule" source="fromReschedule" /> + <TextField label="Recurring Event Id" source="recurringEventId" /> + <TextField label="Sms Reminder Number" source="smsReminderNumber" /> + <ReferenceField + label="Destination Calendar" + source="destinationcalendar.id" + reference="DestinationCalendar" + > + <TextField source={DESTINATIONCALENDAR_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Daily Ref" + source="dailyeventreference.id" + reference="DailyEventReference" + > + <TextField source={DAILYEVENTREFERENCE_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Schedule" + target="userId" + label="Schedules" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Name" source="name" /> + <TextField label="Time Zone" source="timeZone" /> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Availability" + target="userId" + label="Availabilities" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Days" source="days" /> + <TextField label="Start Time" source="startTime" /> + <TextField label="End Time" source="endTime" /> + <TextField label="Date" source="date" /> + <ReferenceField + label="Schedule" + source="schedule.id" + reference="Schedule" + > + <TextField source={SCHEDULE_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="SelectedCalendar" + target="userId" + label="SelectedCalendars" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Integration" source="integration" /> + <TextField label="External Id" source="externalId" /> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Webhook" + target="userId" + label="Webhooks" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Subscriber Url" source="subscriberUrl" /> + <TextField label="Payload Template" source="payloadTemplate" /> + <DateField source="createdAt" label="Created At" /> + <BooleanField label="Active" source="active" /> + <TextField label="Event Triggers" source="eventTriggers" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="App Field" + source="appmodel.id" + reference="AppModel" + > + <TextField source={APPMODEL_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Secret" source="secret" /> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Impersonation" + target="impersonatedUserId" + label="Impersonations" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <DateField source="createdAt" label="Created At" /> + <ReferenceField + label="Impersonated User" + source="user.id" + reference="User" + > + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Impersonated By" + source="user.id" + reference="User" + > + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Impersonation" + target="impersonatedById" + label="Impersonations" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <DateField source="createdAt" label="Created At" /> + <ReferenceField + label="Impersonated User" + source="user.id" + reference="User" + > + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Impersonated By" + source="user.id" + reference="User" + > + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField reference="ApiKey" target="userId" label="ApiKeys"> + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Note" source="note" /> + <DateField source="createdAt" label="Created At" /> + <TextField label="Expires At" source="expiresAt" /> + <TextField label="Last Used At" source="lastUsedAt" /> + <TextField label="Hashed Key" source="hashedKey" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="App Field" + source="appmodel.id" + reference="AppModel" + > + <TextField source={APPMODEL_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Account" + target="userId" + label="Accounts" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Type Field" source="typeField" /> + <TextField label="Provider" source="provider" /> + <TextField label="Provider Account Id" source="providerAccountId" /> + <TextField label="Refresh Token" source="refreshToken" /> + <TextField label="Access Token" source="accessToken" /> + <TextField label="Expires At" source="expiresAt" /> + <TextField label="Token Type" source="tokenType" /> + <TextField label="Scope" source="scope" /> + <TextField label="Id Token" source="idToken" /> + <TextField label="Session State" source="sessionState" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Session" + target="userId" + label="Sessions" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Session Token" source="sessionToken" /> + <TextField label="Expires" source="expires" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Feedback" + target="userId" + label="Feedbacks" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Date" source="date" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Rating" source="rating" /> + <TextField label="Comment" source="comment" /> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="Workflow" + target="userId" + label="Workflows" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Name" source="name" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Trigger" source="trigger" /> + <TextField label="Time" source="time" /> + <TextField label="Time Unit" source="timeUnit" /> + </Datagrid> + </ReferenceManyField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/user/UserTitle.ts b/apps/roi-cacl-2-admin/src/user/UserTitle.ts new file mode 100644 index 0000000..65b5055 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/UserTitle.ts @@ -0,0 +1,7 @@ +import { User as TUser } from "../api/user/User"; + +export const USER_TITLE_FIELD = "username"; + +export const UserTitle = (record: TUser): string => { + return record.username?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/user/roles.ts b/apps/roi-cacl-2-admin/src/user/roles.ts new file mode 100644 index 0000000..732870a --- /dev/null +++ b/apps/roi-cacl-2-admin/src/user/roles.ts @@ -0,0 +1,6 @@ +export const ROLES = [ + { + name: "user", + displayName: "User", + }, +]; diff --git a/apps/roi-cacl-2-admin/src/util/BooleanFilter.ts b/apps/roi-cacl-2-admin/src/util/BooleanFilter.ts new file mode 100644 index 0000000..a142d58 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/BooleanFilter.ts @@ -0,0 +1,4 @@ +export class BooleanFilter { + equals?: boolean; + not?: boolean; +} diff --git a/apps/roi-cacl-2-admin/src/util/BooleanNullableFilter.ts b/apps/roi-cacl-2-admin/src/util/BooleanNullableFilter.ts new file mode 100644 index 0000000..b94aefc --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/BooleanNullableFilter.ts @@ -0,0 +1,4 @@ +export class BooleanNullableFilter { + equals?: boolean | null; + not?: boolean | null; +} diff --git a/apps/roi-cacl-2-admin/src/util/DateTimeFilter.ts b/apps/roi-cacl-2-admin/src/util/DateTimeFilter.ts new file mode 100644 index 0000000..cd8d213 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/DateTimeFilter.ts @@ -0,0 +1,10 @@ +export class DateTimeFilter { + equals?: Date; + not?: Date; + in?: Date[]; + notIn?: Date[]; + lt?: Date; + lte?: Date; + gt?: Date; + gte?: Date; +} diff --git a/apps/roi-cacl-2-admin/src/util/DateTimeNullableFilter.ts b/apps/roi-cacl-2-admin/src/util/DateTimeNullableFilter.ts new file mode 100644 index 0000000..2f9c7b3 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/DateTimeNullableFilter.ts @@ -0,0 +1,10 @@ +export class DateTimeNullableFilter { + equals?: Date | null; + in?: Date[] | null; + notIn?: Date[] | null; + lt?: Date; + lte?: Date; + gt?: Date; + gte?: Date; + not?: Date; +} diff --git a/apps/roi-cacl-2-admin/src/util/FloatFilter.ts b/apps/roi-cacl-2-admin/src/util/FloatFilter.ts new file mode 100644 index 0000000..62aeb14 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/FloatFilter.ts @@ -0,0 +1,10 @@ +export class FloatFilter { + equals?: number; + in?: number[]; + notIn?: number[]; + lt?: number; + lte?: number; + gt?: number; + gte?: number; + not?: number; +} diff --git a/apps/roi-cacl-2-admin/src/util/FloatNullableFilter.ts b/apps/roi-cacl-2-admin/src/util/FloatNullableFilter.ts new file mode 100644 index 0000000..d7bb163 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/FloatNullableFilter.ts @@ -0,0 +1,10 @@ +export class FloatNullableFilter { + equals?: number | null; + in?: number[] | null; + notIn?: number[] | null; + lt?: number; + lte?: number; + gt?: number; + gte?: number; + not?: number; +} diff --git a/apps/roi-cacl-2-admin/src/util/IntFilter.ts b/apps/roi-cacl-2-admin/src/util/IntFilter.ts new file mode 100644 index 0000000..3dc0221 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/IntFilter.ts @@ -0,0 +1,10 @@ +export class IntFilter { + equals?: number; + in?: number[]; + notIn?: number[]; + lt?: number; + lte?: number; + gt?: number; + gte?: number; + not?: number; +} diff --git a/apps/roi-cacl-2-admin/src/util/IntNullableFilter.ts b/apps/roi-cacl-2-admin/src/util/IntNullableFilter.ts new file mode 100644 index 0000000..2107cae --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/IntNullableFilter.ts @@ -0,0 +1,10 @@ +export class IntNullableFilter { + equals?: number | null; + in?: number[] | null; + notIn?: number[] | null; + lt?: number; + lte?: number; + gt?: number; + gte?: number; + not?: number; +} diff --git a/apps/roi-cacl-2-admin/src/util/JsonFilter.ts b/apps/roi-cacl-2-admin/src/util/JsonFilter.ts new file mode 100644 index 0000000..cc44763 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/JsonFilter.ts @@ -0,0 +1,5 @@ +import { InputJsonValue } from "../types"; +export class JsonFilter { + equals?: InputJsonValue; + not?: InputJsonValue; +} diff --git a/apps/roi-cacl-2-admin/src/util/JsonNullableFilter.ts b/apps/roi-cacl-2-admin/src/util/JsonNullableFilter.ts new file mode 100644 index 0000000..e6d1506 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/JsonNullableFilter.ts @@ -0,0 +1,5 @@ +import { JsonValue } from "type-fest"; +export class JsonNullableFilter { + equals?: JsonValue | null; + not?: JsonValue | null; +} diff --git a/apps/roi-cacl-2-admin/src/util/MetaQueryPayload.ts b/apps/roi-cacl-2-admin/src/util/MetaQueryPayload.ts new file mode 100644 index 0000000..bc3175b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/MetaQueryPayload.ts @@ -0,0 +1,3 @@ +export class MetaQueryPayload { + count!: number; +} diff --git a/apps/roi-cacl-2-admin/src/util/QueryMode.ts b/apps/roi-cacl-2-admin/src/util/QueryMode.ts new file mode 100644 index 0000000..8a2164e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/QueryMode.ts @@ -0,0 +1,4 @@ +export enum QueryMode { + Default = "default", + Insensitive = "insensitive", +} diff --git a/apps/roi-cacl-2-admin/src/util/SortOrder.ts b/apps/roi-cacl-2-admin/src/util/SortOrder.ts new file mode 100644 index 0000000..a5bcdb6 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/SortOrder.ts @@ -0,0 +1,4 @@ +export enum SortOrder { + Asc = "asc", + Desc = "desc", +} diff --git a/apps/roi-cacl-2-admin/src/util/StringFilter.ts b/apps/roi-cacl-2-admin/src/util/StringFilter.ts new file mode 100644 index 0000000..c2e26c5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/StringFilter.ts @@ -0,0 +1,16 @@ +import { QueryMode } from "./QueryMode"; + +export class StringFilter { + equals?: string; + in?: string[]; + notIn?: string[]; + lt?: string; + lte?: string; + gt?: string; + gte?: string; + contains?: string; + startsWith?: string; + endsWith?: string; + mode?: QueryMode; + not?: string; +} diff --git a/apps/roi-cacl-2-admin/src/util/StringNullableFilter.ts b/apps/roi-cacl-2-admin/src/util/StringNullableFilter.ts new file mode 100644 index 0000000..e1e37ec --- /dev/null +++ b/apps/roi-cacl-2-admin/src/util/StringNullableFilter.ts @@ -0,0 +1,15 @@ +import { QueryMode } from "./QueryMode"; +export class StringNullableFilter { + equals?: string | null; + in?: string[] | null; + notIn?: string[] | null; + lt?: string; + lte?: string; + gt?: string; + gte?: string; + contains?: string; + startsWith?: string; + endsWith?: string; + mode?: QueryMode; + not?: string; +} diff --git a/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenCreate.tsx b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenCreate.tsx new file mode 100644 index 0000000..82a2a62 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenCreate.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + TextInput, + DateTimeInput, +} from "react-admin"; + +export const VerificationTokenCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Identifier" source="identifier" /> + <TextInput label="Token" source="token" /> + <DateTimeInput label="Expires" source="expires" /> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenEdit.tsx b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenEdit.tsx new file mode 100644 index 0000000..7056bf7 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenEdit.tsx @@ -0,0 +1,20 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + TextInput, + DateTimeInput, +} from "react-admin"; + +export const VerificationTokenEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Identifier" source="identifier" /> + <TextInput label="Token" source="token" /> + <DateTimeInput label="Expires" source="expires" /> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenList.tsx b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenList.tsx new file mode 100644 index 0000000..84d74b0 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenList.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { List, Datagrid, ListProps, TextField, DateField } from "react-admin"; +import Pagination from "../Components/Pagination"; + +export const VerificationTokenList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"VerificationTokens"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Identifier" source="identifier" /> + <TextField label="Token" source="token" /> + <TextField label="Expires" source="expires" /> + <DateField source="createdAt" label="Created At" /> + <DateField source="updatedAt" label="Updated At" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenShow.tsx b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenShow.tsx new file mode 100644 index 0000000..202dd0d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenShow.tsx @@ -0,0 +1,23 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + DateField, +} from "react-admin"; + +export const VerificationTokenShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Identifier" source="identifier" /> + <TextField label="Token" source="token" /> + <TextField label="Expires" source="expires" /> + <DateField source="createdAt" label="Created At" /> + <DateField source="updatedAt" label="Updated At" /> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenTitle.ts b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenTitle.ts new file mode 100644 index 0000000..61c17c9 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/verificationToken/VerificationTokenTitle.ts @@ -0,0 +1,7 @@ +import { VerificationToken as TVerificationToken } from "../api/verificationToken/VerificationToken"; + +export const VERIFICATIONTOKEN_TITLE_FIELD = "identifier"; + +export const VerificationTokenTitle = (record: TVerificationToken): string => { + return record.identifier?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/webhook/WebhookCreate.tsx b/apps/roi-cacl-2-admin/src/webhook/WebhookCreate.tsx new file mode 100644 index 0000000..cc7ae3c --- /dev/null +++ b/apps/roi-cacl-2-admin/src/webhook/WebhookCreate.tsx @@ -0,0 +1,57 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + BooleanInput, + SelectArrayInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { AppModelTitle } from "../appModel/AppModelTitle"; + +export const WebhookCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Subscriber Url" source="subscriberUrl" /> + <TextInput label="Payload Template" source="payloadTemplate" /> + <BooleanInput label="Active" source="active" /> + <SelectArrayInput + label="Event Triggers" + source="eventTriggers" + choices={[ + { label: "BOOKING_CREATED", value: "BOOKING_CREATED" }, + { label: "BOOKING_RESCHEDULED", value: "BOOKING_RESCHEDULED" }, + { label: "BOOKING_CANCELLED", value: "BOOKING_CANCELLED" }, + ]} + optionText="label" + optionValue="value" + /> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <ReferenceInput + source="eventType.id" + reference="EventType" + label="Event Type" + > + <SelectInput optionText={EventTypeTitle} /> + </ReferenceInput> + <ReferenceInput + source="appField.id" + reference="AppModel" + label="App Field" + > + <SelectInput optionText={AppModelTitle} /> + </ReferenceInput> + <TextInput label="Secret" source="secret" /> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/webhook/WebhookEdit.tsx b/apps/roi-cacl-2-admin/src/webhook/WebhookEdit.tsx new file mode 100644 index 0000000..6fbc2a5 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/webhook/WebhookEdit.tsx @@ -0,0 +1,57 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + BooleanInput, + SelectArrayInput, + ReferenceInput, + SelectInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; +import { AppModelTitle } from "../appModel/AppModelTitle"; + +export const WebhookEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Subscriber Url" source="subscriberUrl" /> + <TextInput label="Payload Template" source="payloadTemplate" /> + <BooleanInput label="Active" source="active" /> + <SelectArrayInput + label="Event Triggers" + source="eventTriggers" + choices={[ + { label: "BOOKING_CREATED", value: "BOOKING_CREATED" }, + { label: "BOOKING_RESCHEDULED", value: "BOOKING_RESCHEDULED" }, + { label: "BOOKING_CANCELLED", value: "BOOKING_CANCELLED" }, + ]} + optionText="label" + optionValue="value" + /> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <ReferenceInput + source="eventType.id" + reference="EventType" + label="Event Type" + > + <SelectInput optionText={EventTypeTitle} /> + </ReferenceInput> + <ReferenceInput + source="appField.id" + reference="AppModel" + label="App Field" + > + <SelectInput optionText={AppModelTitle} /> + </ReferenceInput> + <TextInput label="Secret" source="secret" /> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/webhook/WebhookList.tsx b/apps/roi-cacl-2-admin/src/webhook/WebhookList.tsx new file mode 100644 index 0000000..afc58aa --- /dev/null +++ b/apps/roi-cacl-2-admin/src/webhook/WebhookList.tsx @@ -0,0 +1,55 @@ +import * as React from "react"; + +import { + List, + Datagrid, + ListProps, + TextField, + DateField, + BooleanField, + ReferenceField, +} from "react-admin"; + +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; + +export const WebhookList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"Webhooks"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Subscriber Url" source="subscriberUrl" /> + <TextField label="Payload Template" source="payloadTemplate" /> + <DateField source="createdAt" label="Created At" /> + <BooleanField label="Active" source="active" /> + <TextField label="Event Triggers" source="eventTriggers" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="App Field" + source="appmodel.id" + reference="AppModel" + > + <TextField source={APPMODEL_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Secret" source="secret" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/webhook/WebhookShow.tsx b/apps/roi-cacl-2-admin/src/webhook/WebhookShow.tsx new file mode 100644 index 0000000..a4c4676 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/webhook/WebhookShow.tsx @@ -0,0 +1,48 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + DateField, + BooleanField, + ReferenceField, +} from "react-admin"; + +import { USER_TITLE_FIELD } from "../user/UserTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { APPMODEL_TITLE_FIELD } from "../appModel/AppModelTitle"; + +export const WebhookShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Subscriber Url" source="subscriberUrl" /> + <TextField label="Payload Template" source="payloadTemplate" /> + <DateField source="createdAt" label="Created At" /> + <BooleanField label="Active" source="active" /> + <TextField label="Event Triggers" source="eventTriggers" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="App Field" + source="appmodel.id" + reference="AppModel" + > + <TextField source={APPMODEL_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Secret" source="secret" /> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/webhook/WebhookTitle.ts b/apps/roi-cacl-2-admin/src/webhook/WebhookTitle.ts new file mode 100644 index 0000000..2141558 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/webhook/WebhookTitle.ts @@ -0,0 +1,7 @@ +import { Webhook as TWebhook } from "../api/webhook/Webhook"; + +export const WEBHOOK_TITLE_FIELD = "subscriberUrl"; + +export const WebhookTitle = (record: TWebhook): string => { + return record.subscriberUrl?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/workflow/WorkflowCreate.tsx b/apps/roi-cacl-2-admin/src/workflow/WorkflowCreate.tsx new file mode 100644 index 0000000..e3f9653 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflow/WorkflowCreate.tsx @@ -0,0 +1,70 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + TextInput, + ReferenceInput, + SelectInput, + NumberInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { WorkflowStepTitle } from "../workflowStep/WorkflowStepTitle"; +import { WorkflowsOnEventTypeTitle } from "../workflowsOnEventType/WorkflowsOnEventTypeTitle"; + +export const WorkflowCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <TextInput label="Name" source="name" /> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <SelectInput + source="trigger" + label="Trigger" + choices={[ + { label: "BEFORE_EVENT", value: "BEFORE_EVENT" }, + { label: "EVENT_CANCELLED", value: "EVENT_CANCELLED" }, + { label: "NEW_EVENT", value: "NEW_EVENT" }, + ]} + optionText="label" + optionValue="value" + /> + <NumberInput step={1} label="Time" source="time" /> + <SelectInput + source="timeUnit" + label="Time Unit" + choices={[ + { label: "DAY", value: "DAY" }, + { label: "HOUR", value: "HOUR" }, + { label: "MINUTE", value: "MINUTE" }, + ]} + optionText="label" + allowEmpty + optionValue="value" + /> + <ReferenceArrayInput + source="steps" + reference="WorkflowStep" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowStepTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="activeOn" + reference="WorkflowsOnEventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowsOnEventTypeTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflow/WorkflowEdit.tsx b/apps/roi-cacl-2-admin/src/workflow/WorkflowEdit.tsx new file mode 100644 index 0000000..d571271 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflow/WorkflowEdit.tsx @@ -0,0 +1,70 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + TextInput, + ReferenceInput, + SelectInput, + NumberInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { UserTitle } from "../user/UserTitle"; +import { WorkflowStepTitle } from "../workflowStep/WorkflowStepTitle"; +import { WorkflowsOnEventTypeTitle } from "../workflowsOnEventType/WorkflowsOnEventTypeTitle"; + +export const WorkflowEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <TextInput label="Name" source="name" /> + <ReferenceInput source="user.id" reference="User" label="User"> + <SelectInput optionText={UserTitle} /> + </ReferenceInput> + <SelectInput + source="trigger" + label="Trigger" + choices={[ + { label: "BEFORE_EVENT", value: "BEFORE_EVENT" }, + { label: "EVENT_CANCELLED", value: "EVENT_CANCELLED" }, + { label: "NEW_EVENT", value: "NEW_EVENT" }, + ]} + optionText="label" + optionValue="value" + /> + <NumberInput step={1} label="Time" source="time" /> + <SelectInput + source="timeUnit" + label="Time Unit" + choices={[ + { label: "DAY", value: "DAY" }, + { label: "HOUR", value: "HOUR" }, + { label: "MINUTE", value: "MINUTE" }, + ]} + optionText="label" + allowEmpty + optionValue="value" + /> + <ReferenceArrayInput + source="steps" + reference="WorkflowStep" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowStepTitle} /> + </ReferenceArrayInput> + <ReferenceArrayInput + source="activeOn" + reference="WorkflowsOnEventType" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowsOnEventTypeTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflow/WorkflowList.tsx b/apps/roi-cacl-2-admin/src/workflow/WorkflowList.tsx new file mode 100644 index 0000000..e0e252b --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflow/WorkflowList.tsx @@ -0,0 +1,33 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const WorkflowList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"Workflows"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Name" source="name" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Trigger" source="trigger" /> + <TextField label="Time" source="time" /> + <TextField label="Time Unit" source="timeUnit" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflow/WorkflowShow.tsx b/apps/roi-cacl-2-admin/src/workflow/WorkflowShow.tsx new file mode 100644 index 0000000..0b46214 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflow/WorkflowShow.tsx @@ -0,0 +1,77 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + ReferenceManyField, + Datagrid, +} from "react-admin"; + +import { WORKFLOW_TITLE_FIELD } from "./WorkflowTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; +import { USER_TITLE_FIELD } from "../user/UserTitle"; + +export const WorkflowShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Name" source="name" /> + <ReferenceField label="User" source="user.id" reference="User"> + <TextField source={USER_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Trigger" source="trigger" /> + <TextField label="Time" source="time" /> + <TextField label="Time Unit" source="timeUnit" /> + <ReferenceManyField + reference="WorkflowStep" + target="workflowId" + label="WorkflowSteps" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Step Number" source="stepNumber" /> + <TextField label="Action" source="action" /> + <ReferenceField + label="Workflow" + source="workflow.id" + reference="Workflow" + > + <TextField source={WORKFLOW_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Send To" source="sendTo" /> + <TextField label="Reminder Body" source="reminderBody" /> + <TextField label="Email Subject" source="emailSubject" /> + <TextField label="Template" source="template" /> + </Datagrid> + </ReferenceManyField> + <ReferenceManyField + reference="WorkflowsOnEventType" + target="workflowId" + label="WorkflowsOnEventTypes" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField + label="Workflow" + source="workflow.id" + reference="Workflow" + > + <TextField source={WORKFLOW_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflow/WorkflowTitle.ts b/apps/roi-cacl-2-admin/src/workflow/WorkflowTitle.ts new file mode 100644 index 0000000..7f52fbe --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflow/WorkflowTitle.ts @@ -0,0 +1,7 @@ +import { Workflow as TWorkflow } from "../api/workflow/Workflow"; + +export const WORKFLOW_TITLE_FIELD = "name"; + +export const WorkflowTitle = (record: TWorkflow): string => { + return record.name?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderCreate.tsx b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderCreate.tsx new file mode 100644 index 0000000..9733519 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderCreate.tsx @@ -0,0 +1,49 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + ReferenceInput, + SelectInput, + DateTimeInput, + TextInput, + BooleanInput, +} from "react-admin"; + +import { BookingTitle } from "../booking/BookingTitle"; +import { WorkflowStepTitle } from "../workflowStep/WorkflowStepTitle"; + +export const WorkflowReminderCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <ReferenceInput source="booking.id" reference="Booking" label="Booking"> + <SelectInput optionText={BookingTitle} /> + </ReferenceInput> + <SelectInput + source="method" + label="Method" + choices={[ + { label: "EMAIL", value: "EMAIL" }, + { label: "SMS", value: "SMS" }, + ]} + optionText="label" + optionValue="value" + /> + <DateTimeInput label="Scheduled Date" source="scheduledDate" /> + <TextInput label="Reference Id" source="referenceId" /> + <BooleanInput label="Scheduled" source="scheduled" /> + <ReferenceInput + source="workflowStep.id" + reference="WorkflowStep" + label="Workflow Step" + > + <SelectInput optionText={WorkflowStepTitle} /> + </ReferenceInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderEdit.tsx b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderEdit.tsx new file mode 100644 index 0000000..b2ea942 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderEdit.tsx @@ -0,0 +1,47 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + ReferenceInput, + SelectInput, + DateTimeInput, + TextInput, + BooleanInput, +} from "react-admin"; + +import { BookingTitle } from "../booking/BookingTitle"; +import { WorkflowStepTitle } from "../workflowStep/WorkflowStepTitle"; + +export const WorkflowReminderEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <ReferenceInput source="booking.id" reference="Booking" label="Booking"> + <SelectInput optionText={BookingTitle} /> + </ReferenceInput> + <SelectInput + source="method" + label="Method" + choices={[ + { label: "EMAIL", value: "EMAIL" }, + { label: "SMS", value: "SMS" }, + ]} + optionText="label" + optionValue="value" + /> + <DateTimeInput label="Scheduled Date" source="scheduledDate" /> + <TextInput label="Reference Id" source="referenceId" /> + <BooleanInput label="Scheduled" source="scheduled" /> + <ReferenceInput + source="workflowStep.id" + reference="WorkflowStep" + label="Workflow Step" + > + <SelectInput optionText={WorkflowStepTitle} /> + </ReferenceInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderList.tsx b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderList.tsx new file mode 100644 index 0000000..bd470fa --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderList.tsx @@ -0,0 +1,42 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; +import { WORKFLOWSTEP_TITLE_FIELD } from "../workflowStep/WorkflowStepTitle"; + +export const WorkflowReminderList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"WorkflowReminders"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField label="Booking" source="booking.id" reference="Booking"> + <TextField source={BOOKING_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Method" source="method" /> + <TextField label="Scheduled Date" source="scheduledDate" /> + <TextField label="Reference Id" source="referenceId" /> + <BooleanField label="Scheduled" source="scheduled" /> + <ReferenceField + label="Workflow Step" + source="workflowstep.id" + reference="WorkflowStep" + > + <TextField source={WORKFLOWSTEP_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderShow.tsx b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderShow.tsx new file mode 100644 index 0000000..4626d5d --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderShow.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + BooleanField, +} from "react-admin"; +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; +import { WORKFLOWSTEP_TITLE_FIELD } from "../workflowStep/WorkflowStepTitle"; + +export const WorkflowReminderShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <ReferenceField label="Booking" source="booking.id" reference="Booking"> + <TextField source={BOOKING_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Method" source="method" /> + <TextField label="Scheduled Date" source="scheduledDate" /> + <TextField label="Reference Id" source="referenceId" /> + <BooleanField label="Scheduled" source="scheduled" /> + <ReferenceField + label="Workflow Step" + source="workflowstep.id" + reference="WorkflowStep" + > + <TextField source={WORKFLOWSTEP_TITLE_FIELD} /> + </ReferenceField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderTitle.ts b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderTitle.ts new file mode 100644 index 0000000..700d407 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowReminder/WorkflowReminderTitle.ts @@ -0,0 +1,7 @@ +import { WorkflowReminder as TWorkflowReminder } from "../api/workflowReminder/WorkflowReminder"; + +export const WORKFLOWREMINDER_TITLE_FIELD = "referenceId"; + +export const WorkflowReminderTitle = (record: TWorkflowReminder): string => { + return record.referenceId?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepCreate.tsx b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepCreate.tsx new file mode 100644 index 0000000..5487b90 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepCreate.tsx @@ -0,0 +1,66 @@ +import * as React from "react"; + +import { + Create, + SimpleForm, + CreateProps, + NumberInput, + SelectInput, + ReferenceInput, + TextInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { WorkflowTitle } from "../workflow/WorkflowTitle"; +import { WorkflowReminderTitle } from "../workflowReminder/WorkflowReminderTitle"; + +export const WorkflowStepCreate = (props: CreateProps): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <NumberInput step={1} label="Step Number" source="stepNumber" /> + <SelectInput + source="action" + label="Action" + choices={[ + { label: "EMAIL_HOST", value: "EMAIL_HOST" }, + { label: "EMAIL_ATTENDEE", value: "EMAIL_ATTENDEE" }, + { label: "SMS_ATTENDEE", value: "SMS_ATTENDEE" }, + { label: "SMS_NUMBER", value: "SMS_NUMBER" }, + ]} + optionText="label" + optionValue="value" + /> + <ReferenceInput + source="workflow.id" + reference="Workflow" + label="Workflow" + > + <SelectInput optionText={WorkflowTitle} /> + </ReferenceInput> + <TextInput label="Send To" source="sendTo" /> + <TextInput label="Reminder Body" source="reminderBody" /> + <TextInput label="Email Subject" source="emailSubject" /> + <SelectInput + source="template" + label="Template" + choices={[ + { label: "REMINDER", value: "REMINDER" }, + { label: "CUSTOM", value: "CUSTOM" }, + ]} + optionText="label" + optionValue="value" + /> + <ReferenceArrayInput + source="workflowReminders" + reference="WorkflowReminder" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowReminderTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepEdit.tsx b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepEdit.tsx new file mode 100644 index 0000000..fa1f7db --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepEdit.tsx @@ -0,0 +1,66 @@ +import * as React from "react"; + +import { + Edit, + SimpleForm, + EditProps, + NumberInput, + SelectInput, + ReferenceInput, + TextInput, + ReferenceArrayInput, + SelectArrayInput, +} from "react-admin"; + +import { WorkflowTitle } from "../workflow/WorkflowTitle"; +import { WorkflowReminderTitle } from "../workflowReminder/WorkflowReminderTitle"; + +export const WorkflowStepEdit = (props: EditProps): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <NumberInput step={1} label="Step Number" source="stepNumber" /> + <SelectInput + source="action" + label="Action" + choices={[ + { label: "EMAIL_HOST", value: "EMAIL_HOST" }, + { label: "EMAIL_ATTENDEE", value: "EMAIL_ATTENDEE" }, + { label: "SMS_ATTENDEE", value: "SMS_ATTENDEE" }, + { label: "SMS_NUMBER", value: "SMS_NUMBER" }, + ]} + optionText="label" + optionValue="value" + /> + <ReferenceInput + source="workflow.id" + reference="Workflow" + label="Workflow" + > + <SelectInput optionText={WorkflowTitle} /> + </ReferenceInput> + <TextInput label="Send To" source="sendTo" /> + <TextInput label="Reminder Body" source="reminderBody" /> + <TextInput label="Email Subject" source="emailSubject" /> + <SelectInput + source="template" + label="Template" + choices={[ + { label: "REMINDER", value: "REMINDER" }, + { label: "CUSTOM", value: "CUSTOM" }, + ]} + optionText="label" + optionValue="value" + /> + <ReferenceArrayInput + source="workflowReminders" + reference="WorkflowReminder" + parse={(value: any) => value && value.map((v: any) => ({ id: v }))} + format={(value: any) => value && value.map((v: any) => v.id)} + > + <SelectArrayInput optionText={WorkflowReminderTitle} /> + </ReferenceArrayInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepList.tsx b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepList.tsx new file mode 100644 index 0000000..66a2c33 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepList.tsx @@ -0,0 +1,39 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { WORKFLOW_TITLE_FIELD } from "../workflow/WorkflowTitle"; + +export const WorkflowStepList = (props: ListProps): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"WorkflowSteps"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <TextField label="Step Number" source="stepNumber" /> + <TextField label="Action" source="action" /> + <ReferenceField + label="Workflow" + source="workflow.id" + reference="Workflow" + > + <TextField source={WORKFLOW_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Send To" source="sendTo" /> + <TextField label="Reminder Body" source="reminderBody" /> + <TextField label="Email Subject" source="emailSubject" /> + <TextField label="Template" source="template" /> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepShow.tsx b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepShow.tsx new file mode 100644 index 0000000..0f377c2 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepShow.tsx @@ -0,0 +1,66 @@ +import * as React from "react"; + +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, + ReferenceManyField, + Datagrid, + BooleanField, +} from "react-admin"; + +import { BOOKING_TITLE_FIELD } from "../booking/BookingTitle"; +import { WORKFLOWSTEP_TITLE_FIELD } from "./WorkflowStepTitle"; +import { WORKFLOW_TITLE_FIELD } from "../workflow/WorkflowTitle"; + +export const WorkflowStepShow = (props: ShowProps): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <TextField label="Step Number" source="stepNumber" /> + <TextField label="Action" source="action" /> + <ReferenceField + label="Workflow" + source="workflow.id" + reference="Workflow" + > + <TextField source={WORKFLOW_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Send To" source="sendTo" /> + <TextField label="Reminder Body" source="reminderBody" /> + <TextField label="Email Subject" source="emailSubject" /> + <TextField label="Template" source="template" /> + <ReferenceManyField + reference="WorkflowReminder" + target="workflowStepId" + label="WorkflowReminders" + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField + label="Booking" + source="booking.id" + reference="Booking" + > + <TextField source={BOOKING_TITLE_FIELD} /> + </ReferenceField> + <TextField label="Method" source="method" /> + <TextField label="Scheduled Date" source="scheduledDate" /> + <TextField label="Reference Id" source="referenceId" /> + <BooleanField label="Scheduled" source="scheduled" /> + <ReferenceField + label="Workflow Step" + source="workflowstep.id" + reference="WorkflowStep" + > + <TextField source={WORKFLOWSTEP_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </ReferenceManyField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepTitle.ts b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepTitle.ts new file mode 100644 index 0000000..9e70288 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowStep/WorkflowStepTitle.ts @@ -0,0 +1,7 @@ +import { WorkflowStep as TWorkflowStep } from "../api/workflowStep/WorkflowStep"; + +export const WORKFLOWSTEP_TITLE_FIELD = "sendTo"; + +export const WorkflowStepTitle = (record: TWorkflowStep): string => { + return record.sendTo?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeCreate.tsx b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeCreate.tsx new file mode 100644 index 0000000..8564068 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeCreate.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; +import { + Create, + SimpleForm, + CreateProps, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { WorkflowTitle } from "../workflow/WorkflowTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; + +export const WorkflowsOnEventTypeCreate = ( + props: CreateProps +): React.ReactElement => { + return ( + <Create {...props}> + <SimpleForm> + <ReferenceInput + source="workflow.id" + reference="Workflow" + label="Workflow" + > + <SelectInput optionText={WorkflowTitle} /> + </ReferenceInput> + <ReferenceInput + source="eventType.id" + reference="EventType" + label="Event Type" + > + <SelectInput optionText={EventTypeTitle} /> + </ReferenceInput> + </SimpleForm> + </Create> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeEdit.tsx b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeEdit.tsx new file mode 100644 index 0000000..a6f86fb --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeEdit.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; +import { + Edit, + SimpleForm, + EditProps, + ReferenceInput, + SelectInput, +} from "react-admin"; +import { WorkflowTitle } from "../workflow/WorkflowTitle"; +import { EventTypeTitle } from "../eventType/EventTypeTitle"; + +export const WorkflowsOnEventTypeEdit = ( + props: EditProps +): React.ReactElement => { + return ( + <Edit {...props}> + <SimpleForm> + <ReferenceInput + source="workflow.id" + reference="Workflow" + label="Workflow" + > + <SelectInput optionText={WorkflowTitle} /> + </ReferenceInput> + <ReferenceInput + source="eventType.id" + reference="EventType" + label="Event Type" + > + <SelectInput optionText={EventTypeTitle} /> + </ReferenceInput> + </SimpleForm> + </Edit> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeList.tsx b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeList.tsx new file mode 100644 index 0000000..8f9650e --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeList.tsx @@ -0,0 +1,43 @@ +import * as React from "react"; +import { + List, + Datagrid, + ListProps, + TextField, + ReferenceField, +} from "react-admin"; +import Pagination from "../Components/Pagination"; +import { WORKFLOW_TITLE_FIELD } from "../workflow/WorkflowTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const WorkflowsOnEventTypeList = ( + props: ListProps +): React.ReactElement => { + return ( + <List + {...props} + bulkActionButtons={false} + title={"WorkflowsOnEventTypes"} + perPage={50} + pagination={<Pagination />} + > + <Datagrid rowClick="show"> + <TextField label="ID" source="id" /> + <ReferenceField + label="Workflow" + source="workflow.id" + reference="Workflow" + > + <TextField source={WORKFLOW_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + </Datagrid> + </List> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeShow.tsx b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeShow.tsx new file mode 100644 index 0000000..8019d07 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeShow.tsx @@ -0,0 +1,36 @@ +import * as React from "react"; +import { + Show, + SimpleShowLayout, + ShowProps, + TextField, + ReferenceField, +} from "react-admin"; +import { WORKFLOW_TITLE_FIELD } from "../workflow/WorkflowTitle"; +import { EVENTTYPE_TITLE_FIELD } from "../eventType/EventTypeTitle"; + +export const WorkflowsOnEventTypeShow = ( + props: ShowProps +): React.ReactElement => { + return ( + <Show {...props}> + <SimpleShowLayout> + <TextField label="ID" source="id" /> + <ReferenceField + label="Workflow" + source="workflow.id" + reference="Workflow" + > + <TextField source={WORKFLOW_TITLE_FIELD} /> + </ReferenceField> + <ReferenceField + label="Event Type" + source="eventtype.id" + reference="EventType" + > + <TextField source={EVENTTYPE_TITLE_FIELD} /> + </ReferenceField> + </SimpleShowLayout> + </Show> + ); +}; diff --git a/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeTitle.ts b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeTitle.ts new file mode 100644 index 0000000..39d9403 --- /dev/null +++ b/apps/roi-cacl-2-admin/src/workflowsOnEventType/WorkflowsOnEventTypeTitle.ts @@ -0,0 +1,9 @@ +import { WorkflowsOnEventType as TWorkflowsOnEventType } from "../api/workflowsOnEventType/WorkflowsOnEventType"; + +export const WORKFLOWSONEVENTTYPE_TITLE_FIELD = "id"; + +export const WorkflowsOnEventTypeTitle = ( + record: TWorkflowsOnEventType +): string => { + return record.id?.toString() || String(record.id); +}; diff --git a/apps/roi-cacl-2-admin/tsconfig.json b/apps/roi-cacl-2-admin/tsconfig.json new file mode 100644 index 0000000..31cc780 --- /dev/null +++ b/apps/roi-cacl-2-admin/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strict": true + }, + "include": ["src"], + "exclude": ["./node_modules"] +} diff --git a/apps/roi-cacl-2/.dockerignore b/apps/roi-cacl-2/.dockerignore new file mode 100644 index 0000000..cb5c30b --- /dev/null +++ b/apps/roi-cacl-2/.dockerignore @@ -0,0 +1,8 @@ +.dockerignore +docker-compose.yml +Dockerfile +dist/ +node_modules +.env +.gitignore +.prettierignore \ No newline at end of file diff --git a/apps/roi-cacl-2/.env b/apps/roi-cacl-2/.env new file mode 100644 index 0000000..7cfbc4e --- /dev/null +++ b/apps/roi-cacl-2/.env @@ -0,0 +1,8 @@ +BCRYPT_SALT=10 +COMPOSE_PROJECT_NAME=amp_cluva7ffe00011upfyk074oua +DB_NAME=my-db +DB_PASSWORD=admin +DB_PORT=5432 +DB_URL=postgres://admin:admin@localhost:5432/my-db +DB_USER=admin +PORT=3000 \ No newline at end of file diff --git a/apps/roi-cacl-2/.gitignore b/apps/roi-cacl-2/.gitignore new file mode 100644 index 0000000..08c9980 --- /dev/null +++ b/apps/roi-cacl-2/.gitignore @@ -0,0 +1,5 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +/node_modules +/dist +.DS_Store diff --git a/apps/roi-cacl-2/.prettierignore b/apps/roi-cacl-2/.prettierignore new file mode 100644 index 0000000..e48f355 --- /dev/null +++ b/apps/roi-cacl-2/.prettierignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +prisma/migrations/ +package-lock.json +coverage/ \ No newline at end of file diff --git a/apps/roi-cacl-2/Dockerfile b/apps/roi-cacl-2/Dockerfile new file mode 100644 index 0000000..80dd8d3 --- /dev/null +++ b/apps/roi-cacl-2/Dockerfile @@ -0,0 +1,68 @@ +# multi-stage: base (build) +FROM node:18.13.0 AS base + +# create directory where the application will be built +WORKDIR /app + +# copy over the dependency manifests, both the package.json +# and the package-lock.json are copied over +COPY package*.json ./ + +# installs packages and their dependencies +RUN npm install + +# copy over the prisma schema +COPY prisma/schema.prisma ./prisma/ + +# generate the prisma client based on the schema +RUN npm run prisma:generate + +# copy over the code base +COPY . . + +# create the bundle of the application +RUN npm run build + +# multi-stage: production (runtime) +FROM node:18.13.0-slim AS production + +# create arguments of builds time variables +ARG user=amplication +ARG group=${user} +ARG uid=1001 +ARG gid=$uid + +# [temporary] work around to be able to run prisma +RUN apt-get update -y && apt-get install -y openssl + +# create directory where the application will be executed from +WORKDIR /app + +# add the user and group +RUN groupadd --gid ${gid} ${user} +RUN useradd --uid ${uid} --gid ${gid} -m ${user} + +# copy over the bundled code from the build stage +COPY --from=base /app/node_modules/ ./node_modules +COPY --from=base /app/package.json ./package.json +COPY --from=base /app/dist ./dist +COPY --from=base /app/prisma ./prisma +COPY --from=base /app/scripts ./scripts +COPY --from=base /app/src ./src +COPY --from=base /app/tsconfig* ./ + +# change ownership of the workspace directory +RUN chown -R ${uid}:${gid} /app/ + +# get rid of the development dependencies +RUN npm install --production + +# set user to the created non-privileged user +USER ${user} + +# expose a specific port on the docker container +ENV PORT=3000 +EXPOSE ${PORT} + +# start the server using the previously build application +CMD [ "node", "./dist/main.js" ] diff --git a/apps/roi-cacl-2/README.md b/apps/roi-cacl-2/README.md new file mode 100644 index 0000000..bca0445 --- /dev/null +++ b/apps/roi-cacl-2/README.md @@ -0,0 +1,64 @@ +<p align="right"> + <a href="https://amplication.com" target="_blank"> + <img alt="amplication-logo" height="70" alt="Amplication Logo" src="https://amplication.com/images/logo.svg"/> + </a> +</p> + +# Introduction + +This service was generated with Amplication. The server-side of the generated project. This component provides the different backend services - i.e., REST API, GraphQL API, authentication, authorization, logging, data validation and the connection to the database. Additional information about the server component and the architecture around it, can be found on the [documentation](https://docs.amplication.com/guides/getting-started) site. + +# Getting started + +## Step 1: Configuration + +Configuration for the server component can be provided through the use of environment variables. These can be passed to the application via the use of the `.env` file in the base directory of the generated service. Below a table can be found which show the different variables that can be passed - these are the variables which exist by default, through the use of plugins additional integrations could require additional values. These values are provided default values after generation, change them to the desired values. + +| Variable | Description | Value | +| -------------------- | -------------------------------------------- | ------------------------------------------------------------------- | +| BCRYPT_SALT | the string used for hashing | [random-string] | +| COMPOSE_PROJECT_NAME | the identifier of the service plus prefix | amp_[service-identifier] | +| PORT | the port on which to run the server | 3000 | +| DB_URL | the connection url for the database | [db-provider]://[username]:[password]@localhost:[db-port]/[db-name] | +| DB_PORT | the port used by the database instance | [db-provider-port] | +| DB_USER | the username used to connect to the database | [username] | +| DB_PASSWORD | the password used to connect to the database | [password] | +| DB_NAME | the name of the database | [service-name] / [project-name] | +| JWT_SECRET_KEY | the secret used to sign the json-web token | [secret] | +| JWT_EXPIRATION | the expiration time for the json-web token | 2d | + +> **Note** +> Amplication generates default values and stores them under the .env file. It is advised to use some form of secrets manager/vault solution when using in production. + +## Step 2.1: Scripts - pre-requisites + +After configuration of the server the next step would be to run the application. Before running the server side of the component, make sure that the different pre-requisites are met - i.e., node.js [^16.x], npm, docker. After the setup of the pre-requisites the server component can be started. + +```sh +# installation of the dependencies +$ npm install + +# generate the prisma client +$ npm run prisma:generate +``` + +## Step 2.2: Scripts - local development + +```sh +# start the database where the server component will connect to +$ npm run docker:dev + +# initialize the database +$ npm run db:init + +# start the server component +$ npm run start +``` +By default, your app comes with one user with the username "admin" and password "admin". + +## Step 2.2: Scripts - container based development + +```shell +# start the server component as a docker container +$ npm run compose:up +``` diff --git a/apps/roi-cacl-2/docker-compose.dev.yml b/apps/roi-cacl-2/docker-compose.dev.yml new file mode 100644 index 0000000..8d7c358 --- /dev/null +++ b/apps/roi-cacl-2/docker-compose.dev.yml @@ -0,0 +1,13 @@ +version: "3" +services: + db: + image: postgres:12 + ports: + - ${DB_PORT}:5432 + environment: + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + volumes: + - postgres:/var/lib/postgresql/data +volumes: + postgres: ~ diff --git a/apps/roi-cacl-2/docker-compose.yml b/apps/roi-cacl-2/docker-compose.yml new file mode 100644 index 0000000..ef3a7a5 --- /dev/null +++ b/apps/roi-cacl-2/docker-compose.yml @@ -0,0 +1,47 @@ +version: "3" +services: + server: + build: + context: . + args: + NPM_LOG_LEVEL: notice + ports: + - ${PORT}:3000 + environment: + BCRYPT_SALT: ${BCRYPT_SALT} + DB_URL: postgres://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME} + depends_on: + - migrate + restart: on-failure + migrate: + build: + context: . + args: + NPM_LOG_LEVEL: notice + command: npm run db:init + working_dir: /app/server + environment: + BCRYPT_SALT: ${BCRYPT_SALT} + DB_URL: postgres://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME} + depends_on: + db: + condition: service_healthy + db: + image: postgres:12 + ports: + - ${DB_PORT}:5432 + environment: + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_DB: ${DB_NAME} + volumes: + - postgres:/var/lib/postgresql/data + healthcheck: + test: + - CMD-SHELL + - pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER} + timeout: 45s + interval: 10s + retries: 10 +volumes: + postgres: ~ diff --git a/apps/roi-cacl-2/nest-cli.json b/apps/roi-cacl-2/nest-cli.json new file mode 100644 index 0000000..b7b60ae --- /dev/null +++ b/apps/roi-cacl-2/nest-cli.json @@ -0,0 +1,10 @@ +{ + "sourceRoot": "src", + "compilerOptions": { + "assets": [ + { + "include": "swagger/**/*" + } + ] + } +} diff --git a/apps/roi-cacl-2/package.json b/apps/roi-cacl-2/package.json new file mode 100644 index 0000000..7a1faeb --- /dev/null +++ b/apps/roi-cacl-2/package.json @@ -0,0 +1,73 @@ +{ + "name": "@roi-cacl-2/server", + "private": true, + "scripts": { + "start": "nest start", + "start:watch": "nest start --watch", + "start:debug": "nest start --debug --watch", + "build": "nest build", + "test": "jest", + "seed": "ts-node scripts/seed.ts", + "db:migrate-save": "prisma migrate dev", + "db:migrate-up": "prisma migrate deploy", + "db:clean": "prisma migrate reset", + "db:init": "run-s \"db:migrate-save -- --name 'initial version'\" db:migrate-up seed", + "prisma:generate": "prisma generate", + "docker:dev": "docker-compose -f docker-compose.dev.yml up -d", + "package:container": "docker build .", + "compose:up": "docker-compose up -d", + "compose:down": "docker-compose down --volumes" + }, + "dependencies": { + "@apollo/server": "^4.9.4", + "@nestjs/apollo": "12.0.9", + "@nestjs/common": "10.2.7", + "@nestjs/config": "3.1.1", + "@nestjs/core": "10.2.7", + "@nestjs/graphql": "12.0.9", + "@nestjs/jwt": "^10.1.1", + "@nestjs/passport": "^10.0.2", + "@nestjs/platform-express": "10.2.7", + "@nestjs/serve-static": "4.0.0", + "@nestjs/swagger": "7.1.13", + "@prisma/client": "^5.4.2", + "@types/bcrypt": "5.0.0", + "bcrypt": "5.1.1", + "class-transformer": "0.5.1", + "class-validator": "0.14.0", + "dotenv": "16.3.1", + "graphql": "^16.8.1", + "graphql-type-json": "0.3.2", + "npm-run-all": "4.1.5", + "passport": "0.6.0", + "passport-http": "0.3.0", + "passport-jwt": "4.0.1", + "reflect-metadata": "0.1.13", + "ts-node": "10.9.2", + "type-fest": "2.19.0", + "validator": "13.11.0" + }, + "devDependencies": { + "@nestjs/cli": "^10.1.18", + "@nestjs/testing": "^10.2.7", + "@types/express": "^4.17.19", + "@types/graphql-type-json": "0.3.3", + "@types/jest": "^29.5.5", + "@types/normalize-path": "3.0.0", + "@types/passport-http": "0.3.9", + "@types/passport-jwt": "3.0.10", + "@types/supertest": "^2.0.14", + "@types/validator": "^13.11.2", + "jest": "^29.7.0", + "jest-mock-extended": "^3.0.5", + "prisma": "^5.4.2", + "supertest": "^6.3.3", + "ts-jest": "^29.1.1", + "typescript": "^5.4.3" + }, + "jest": { + "preset": "ts-jest", + "testEnvironment": "node", + "modulePathIgnorePatterns": ["<rootDir>/dist/"] + } +} diff --git a/apps/roi-cacl-2/prisma/schema.prisma b/apps/roi-cacl-2/prisma/schema.prisma new file mode 100644 index 0000000..b38e738 --- /dev/null +++ b/apps/roi-cacl-2/prisma/schema.prisma @@ -0,0 +1,553 @@ +datasource db { + provider = "postgresql" + url = env("DB_URL") +} + +generator client { + provider = "prisma-client-js" +} + +model EventType { + id Int @id @default(autoincrement()) + title String + slug String + description String? + position Int @default(0) + locations Json? + length Int + hidden Boolean @default(false) + users User[] + userId Int? + team Team? @relation(fields: [teamId], references: [id]) + teamId Int? + eventName String? + timeZone String? + periodType EnumEventTypePeriodType @default(UNLIMITED) + periodStartDate DateTime? + periodEndDate DateTime? + periodDays Int? + periodCountCalendarDays Boolean? + requiresConfirmation Boolean @default(false) + recurringEvent Json? + disableGuests Boolean @default(false) + hideCalendarNotes Boolean @default(false) + minimumBookingNotice Int @default(120) + beforeEventBuffer Int @default(0) + afterEventBuffer Int @default(0) + seatsPerTimeSlot Int? + schedulingType EnumEventTypeSchedulingType? + schedule Schedule? @relation(fields: [scheduleId], references: [id]) + scheduleId Int? + price Int @default(0) + currency String @default("usd") + slotInterval Int? + metadata Json? + successRedirectUrl String? + destinationCalendar DestinationCalendar? + bookings Booking[] + availability Availability[] + customInputs EventTypeCustomInput[] + webhooks Webhook[] + hashedLink HashedLink? + workflows WorkflowsOnEventType[] + + @@unique([userId, slug]) + @@unique([teamId, slug]) +} + +model Credential { + id Int @id @default(autoincrement()) + typeField String @map("type") + key Json + user User? @relation(fields: [userId], references: [id]) + userId Int? + appField AppModel? @relation(fields: [appId], references: [id]) + appId String? + destinationCalendars DestinationCalendar[] +} + +model DestinationCalendar { + id Int @id @default(autoincrement()) + integration String + externalId String + user User? @relation(fields: [userId], references: [id]) + userId Int? @unique + booking Booking? @relation(fields: [bookingId], references: [id]) + bookingId Int? @unique + eventType EventType? @relation(fields: [eventTypeId], references: [id]) + eventTypeId Int? @unique + credential Credential? @relation(fields: [credentialId], references: [id]) + credentialId Int? +} + +model User { + id Int @id @default(autoincrement()) + username String? @unique + name String? + email String @unique + emailVerified DateTime? + password String? + bio String? + avatar String? + timeZone String @default("Europe/London") + weekStart String @default("Sunday") + startTime Int @default(0) + endTime Int @default(1440) + bufferTime Int @default(0) + hideBranding Boolean @default(false) + theme String? + createdDate DateTime @default(now()) @map(name: "created") + trialEndsAt DateTime? + defaultScheduleId Int? + completedOnboarding Boolean @default(false) + locale String? + timeFormat Int? @default(12) + twoFactorSecret String? + twoFactorEnabled Boolean @default(false) + identityProvider EnumUserIdentityProvider @default(CAL) + identityProviderId String? + invitedTo Int? + plan EnumUserPlan @default(TRIAL) + brandColor String @default("#292929") + darkBrandColor String @default("#fafafa") + away Boolean @default(false) + allowDynamicBooking Boolean? @default(true) + metadata Json? + verified Boolean? @default(false) + role EnumUserRole @default(USER) + disableImpersonation Boolean @default(false) + eventTypes EventType[] + credentials Credential[] + destinationCalendar DestinationCalendar? + teams Membership[] + bookings Booking[] + schedules Schedule[] + availability Availability[] + selectedCalendars SelectedCalendar[] + webhooks Webhook[] + impersonatedUsers Impersonation[] @relation(name: "impersonatedUser") + impersonatedBy Impersonation[] @relation(name: "ImpersonationImpersonatedByUserImpersonatedBy") + apiKeys ApiKey[] + accounts Account[] + sessions Session[] + feedback Feedback[] + workflows Workflow[] + + @@map(name: "users") +} + +model Team { + id Int @id @default(autoincrement()) + name String? + slug String? @unique + logo String? + bio String? + hideBranding Boolean @default(false) + eventTypes EventType[] + members Membership[] +} + +model Membership { + id Int @id @default(autoincrement()) + accepted Boolean @default(false) + role EnumMembershipRole + team Team @relation(fields: [teamId], references: [id]) + teamId Int + user User @relation(fields: [userId], references: [id]) + userId Int + + @@unique([userId, teamId]) +} + +model VerificationToken { + id Int @id @default(autoincrement()) + identifier String + token String @unique + expires DateTime + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + @@unique([identifier, token]) +} + +model BookingReference { + id Int @id @default(autoincrement()) + typeField String @map("type") + uid String + meetingId String? + meetingPassword String? + meetingUrl String? + booking Booking? @relation(fields: [bookingId], references: [id]) + bookingId Int? + externalCalendarId String? + deleted Boolean? +} + +model Attendee { + id Int @id @default(autoincrement()) + email String + name String + timeZone String + locale String? @default("en") + booking Booking? @relation(fields: [bookingId], references: [id]) + bookingId Int? +} + +model DailyEventReference { + id Int @id @default(autoincrement()) + dailyurl String @default("dailycallurl") + dailytoken String @default("dailytoken") + booking Booking? @relation(fields: [bookingId], references: [id]) + bookingId Int? @unique +} + +model Booking { + id Int @id @default(autoincrement()) + uid String @unique + user User? @relation(fields: [userId], references: [id]) + userId Int? + eventType EventType? @relation(fields: [eventTypeId], references: [id]) + eventTypeId Int? + title String + description String? + customInputs Json? + startTime DateTime + endTime DateTime + location String? + createdAt DateTime @default(now()) + updatedAt DateTime? + status EnumBookingStatus @default(ACCEPTED) + paid Boolean @default(false) + cancellationReason String? + rejectionReason String? + dynamicEventSlugRef String? + dynamicGroupSlugRef String? + rescheduled Boolean? + fromReschedule String? + recurringEventId String? + smsReminderNumber String? + destinationCalendar DestinationCalendar? + references BookingReference[] + attendees Attendee[] + dailyRef DailyEventReference? + payment Payment[] + workflowReminders WorkflowReminder[] +} + +model Schedule { + id Int @id @default(autoincrement()) + user User @relation(fields: [userId], references: [id]) + userId Int + name String + timeZone String? + eventType EventType[] + availability Availability[] +} + +model Availability { + id Int @id @default(autoincrement()) + user User? @relation(fields: [userId], references: [id]) + userId Int? + eventType EventType? @relation(fields: [eventTypeId], references: [id]) + eventTypeId Int? + days Int + startTime DateTime @db.Time + endTime DateTime @db.Time + date DateTime? @db.Date + schedule Schedule? @relation(fields: [scheduleId], references: [id]) + scheduleId Int? +} + +model SelectedCalendar { + id Int @id @default(autoincrement()) + user User @relation(fields: [userId], references: [id]) + userId Int + integration String + externalId String + + @@unique([userId, integration, externalId]) +} + +model EventTypeCustomInput { + id Int @id @default(autoincrement()) + eventType EventType @relation(fields: [eventTypeId], references: [id]) + eventTypeId Int + label String + type EnumEventTypeCustomInputType + required Boolean + placeholder String @default("") +} + +model ResetPasswordRequest { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + email String + expires DateTime +} + +model ReminderMail { + id Int @id @default(autoincrement()) + referenceId Int + reminderType EnumReminderMailReminderType + elapsedMinutes Int + createdAt DateTime @default(now()) +} + +model Payment { + id Int @id @default(autoincrement()) + uid String @unique + type EnumPaymentType + booking Booking? @relation(fields: [bookingId], references: [id]) + bookingId Int? + amount Int + fee Int + currency String + success Boolean + refunded Boolean + data Json + externalId String @unique +} + +model Webhook { + id String @id @unique @default(cuid()) + subscriberUrl String + payloadTemplate String? + createdAt DateTime @default(now()) + active Boolean @default(true) + eventTriggers EnumWebhookEventTriggers[] + user User? @relation(fields: [userId], references: [id]) + userId Int? + eventType EventType? @relation(fields: [eventTypeId], references: [id]) + eventTypeId Int? + appField AppModel? @relation(fields: [appId], references: [id]) + appId String? + secret String? +} + +model Impersonation { + id Int @id @default(autoincrement()) + createdAt DateTime @default(now()) + impersonatedUser User @relation(name: "impersonatedUser", fields: [impersonatedUserId], references: [id]) + impersonatedUserId Int + impersonatedBy User @relation(name: "ImpersonationImpersonatedByUserImpersonatedBy", fields: [impersonatedById], references: [id]) + impersonatedById Int + + @@map("Impersonations") +} + +model ApiKey { + id String @id @unique @default(cuid()) + note String? + createdAt DateTime @default(now()) + expiresAt DateTime? + lastUsedAt DateTime? + hashedKey String @unique + user User? @relation(fields: [userId], references: [id]) + userId Int? + appField AppModel? @relation(fields: [appId], references: [id]) + appId String? +} + +model HashedLink { + id Int @id @default(autoincrement()) + link String @unique + eventType EventType @relation(fields: [eventTypeId], references: [id]) + eventTypeId Int @unique +} + +model Account { + id String @id @default(cuid()) + typeField String @map("type") + provider String + providerAccountId String + refreshToken String? @map("refresh_token") @db.Text + accessToken String? @map("access_token") @db.Text + expiresAt Int? @map("expires_at") + tokenType String? @map("token_type") + scope String? + idToken String? @map("id_token") @db.Text + sessionState String? @map("session_state") + user User? @relation(fields: [userId], references: [id]) + userId Int? + + @@unique([provider, providerAccountId]) +} + +model Session { + id String @id @default(cuid()) + sessionToken String @unique + expires DateTime + user User? @relation(fields: [userId], references: [id]) + userId Int? +} + +model AppModel { + id String @id @unique @default(cuid()) @map("slug") + dirName String @unique + keys Json? + categories EnumAppModelCategories[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + credentials Credential[] + webhook Webhook[] + apiKey ApiKey[] + + @@map("App") +} + +model Feedback { + id Int @id @default(autoincrement()) + date DateTime + user User @relation(fields: [userId], references: [id]) + userId Int + rating String + comment String? +} + +model WorkflowStep { + id Int @id @default(autoincrement()) + stepNumber Int + action EnumWorkflowStepAction + workflow Workflow @relation(fields: [workflowId], references: [id]) + workflowId Int + sendTo String? + reminderBody String? + emailSubject String? + template EnumWorkflowStepTemplate @default(REMINDER) + workflowReminders WorkflowReminder[] +} + +model Workflow { + id Int @id @default(autoincrement()) + name String + user User @relation(fields: [userId], references: [id]) + userId Int + trigger EnumWorkflowTrigger + time Int? + timeUnit EnumWorkflowTimeUnit? + steps WorkflowStep[] + activeOn WorkflowsOnEventType[] +} + +model WorkflowsOnEventType { + id Int @id @default(autoincrement()) + workflow Workflow @relation(fields: [workflowId], references: [id]) + workflowId Int + eventType EventType @relation(fields: [eventTypeId], references: [id]) + eventTypeId Int + + @@map("WorkflowsOnEventTypes") +} + +model WorkflowReminder { + id Int @id @default(autoincrement()) + booking Booking? @relation(fields: [bookingUid], references: [id]) + bookingUid Int? + method EnumWorkflowReminderMethod + scheduledDate DateTime + referenceId String? @unique + scheduled Boolean + workflowStep WorkflowStep @relation(fields: [workflowStepId], references: [id]) + workflowStepId Int +} + +enum EnumEventTypePeriodType { + UNLIMITED + ROLLING + RANGE +} + +enum EnumEventTypeSchedulingType { + ROUND_ROBIN + COLLECTIVE +} + +enum EnumUserIdentityProvider { + CAL + GOOGLE + SAML +} + +enum EnumUserPlan { + FREE + TRIAL + PRO +} + +enum EnumUserRole { + USER + ADMIN +} + +enum EnumMembershipRole { + MEMBER + ADMIN + OWNER +} + +enum EnumBookingStatus { + CANCELLED + ACCEPTED + REJECTED + PENDING +} + +enum EnumEventTypeCustomInputType { + TEXT + TEXTLONG + NUMBER + BOOL +} + +enum EnumReminderMailReminderType { + PENDING_BOOKING_CONFIRMATION +} + +enum EnumPaymentType { + STRIPE +} + +enum EnumWebhookEventTriggers { + BOOKING_CREATED + BOOKING_RESCHEDULED + BOOKING_CANCELLED +} + +enum EnumAppModelCategories { + calendar + messaging + other + payment + video + web3 +} + +enum EnumWorkflowStepAction { + EMAIL_HOST + EMAIL_ATTENDEE + SMS_ATTENDEE + SMS_NUMBER +} + +enum EnumWorkflowStepTemplate { + REMINDER + CUSTOM +} + +enum EnumWorkflowTrigger { + BEFORE_EVENT + EVENT_CANCELLED + NEW_EVENT +} + +enum EnumWorkflowTimeUnit { + DAY + HOUR + MINUTE +} + +enum EnumWorkflowReminderMethod { + EMAIL + SMS +} diff --git a/apps/roi-cacl-2/scripts/customSeed.ts b/apps/roi-cacl-2/scripts/customSeed.ts new file mode 100644 index 0000000..26ccaf4 --- /dev/null +++ b/apps/roi-cacl-2/scripts/customSeed.ts @@ -0,0 +1,7 @@ +import { PrismaClient } from "@prisma/client"; + +export async function customSeed() { + const client = new PrismaClient(); + + client.$disconnect(); +} diff --git a/apps/roi-cacl-2/scripts/seed.ts b/apps/roi-cacl-2/scripts/seed.ts new file mode 100644 index 0000000..04cee65 --- /dev/null +++ b/apps/roi-cacl-2/scripts/seed.ts @@ -0,0 +1,25 @@ +import * as dotenv from "dotenv"; +import { PrismaClient } from "@prisma/client"; +import { customSeed } from "./customSeed"; + +if (require.main === module) { + dotenv.config(); + + const { BCRYPT_SALT } = process.env; + + if (!BCRYPT_SALT) { + throw new Error("BCRYPT_SALT environment variable must be defined"); + } +} + +async function seed() { + console.info("Seeding database..."); + + const client = new PrismaClient(); + void client.$disconnect(); + + console.info("Seeding database with custom seed..."); + customSeed(); + + console.info("Seeded database successfully"); +} diff --git a/apps/roi-cacl-2/src/account/account.controller.ts b/apps/roi-cacl-2/src/account/account.controller.ts new file mode 100644 index 0000000..eb68f76 --- /dev/null +++ b/apps/roi-cacl-2/src/account/account.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { AccountService } from "./account.service"; +import { AccountControllerBase } from "./base/account.controller.base"; + +@swagger.ApiTags("accounts") +@common.Controller("accounts") +export class AccountController extends AccountControllerBase { + constructor(protected readonly service: AccountService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/account/account.module.ts b/apps/roi-cacl-2/src/account/account.module.ts new file mode 100644 index 0000000..bc6b28a --- /dev/null +++ b/apps/roi-cacl-2/src/account/account.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { AccountModuleBase } from "./base/account.module.base"; +import { AccountService } from "./account.service"; +import { AccountController } from "./account.controller"; +import { AccountResolver } from "./account.resolver"; + +@Module({ + imports: [AccountModuleBase], + controllers: [AccountController], + providers: [AccountService, AccountResolver], + exports: [AccountService], +}) +export class AccountModule {} diff --git a/apps/roi-cacl-2/src/account/account.resolver.ts b/apps/roi-cacl-2/src/account/account.resolver.ts new file mode 100644 index 0000000..c6a50f6 --- /dev/null +++ b/apps/roi-cacl-2/src/account/account.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { AccountResolverBase } from "./base/account.resolver.base"; +import { Account } from "./base/Account"; +import { AccountService } from "./account.service"; + +@graphql.Resolver(() => Account) +export class AccountResolver extends AccountResolverBase { + constructor(protected readonly service: AccountService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/account/account.service.ts b/apps/roi-cacl-2/src/account/account.service.ts new file mode 100644 index 0000000..3db12e3 --- /dev/null +++ b/apps/roi-cacl-2/src/account/account.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { AccountServiceBase } from "./base/account.service.base"; + +@Injectable() +export class AccountService extends AccountServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/account/base/Account.ts b/apps/roi-cacl-2/src/account/base/Account.ts new file mode 100644 index 0000000..8e67b86 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/Account.ts @@ -0,0 +1,139 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsInt, ValidateNested } from "class-validator"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; + +@ObjectType() +class Account { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + typeField!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + provider!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + providerAccountId!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + refreshToken!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + accessToken!: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + expiresAt!: number | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + tokenType!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + scope!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + idToken!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + sessionState!: string | null; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; +} + +export { Account as Account }; diff --git a/apps/roi-cacl-2/src/account/base/AccountCountArgs.ts b/apps/roi-cacl-2/src/account/base/AccountCountArgs.ts new file mode 100644 index 0000000..61b52bf --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AccountWhereInput } from "./AccountWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class AccountCountArgs { + @ApiProperty({ + required: false, + type: () => AccountWhereInput, + }) + @Field(() => AccountWhereInput, { nullable: true }) + @Type(() => AccountWhereInput) + where?: AccountWhereInput; +} + +export { AccountCountArgs as AccountCountArgs }; diff --git a/apps/roi-cacl-2/src/account/base/AccountCreateInput.ts b/apps/roi-cacl-2/src/account/base/AccountCreateInput.ts new file mode 100644 index 0000000..5792b2e --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountCreateInput.ts @@ -0,0 +1,134 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsInt, ValidateNested } from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class AccountCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + typeField!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + provider!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + providerAccountId!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + refreshToken?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + accessToken?: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + expiresAt?: number | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + tokenType?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + scope?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + idToken?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + sessionState?: string | null; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; +} + +export { AccountCreateInput as AccountCreateInput }; diff --git a/apps/roi-cacl-2/src/account/base/AccountFindManyArgs.ts b/apps/roi-cacl-2/src/account/base/AccountFindManyArgs.ts new file mode 100644 index 0000000..3ae903b --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AccountWhereInput } from "./AccountWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { AccountOrderByInput } from "./AccountOrderByInput"; + +@ArgsType() +class AccountFindManyArgs { + @ApiProperty({ + required: false, + type: () => AccountWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => AccountWhereInput, { nullable: true }) + @Type(() => AccountWhereInput) + where?: AccountWhereInput; + + @ApiProperty({ + required: false, + type: [AccountOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [AccountOrderByInput], { nullable: true }) + @Type(() => AccountOrderByInput) + orderBy?: Array<AccountOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { AccountFindManyArgs as AccountFindManyArgs }; diff --git a/apps/roi-cacl-2/src/account/base/AccountFindUniqueArgs.ts b/apps/roi-cacl-2/src/account/base/AccountFindUniqueArgs.ts new file mode 100644 index 0000000..c6e1074 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AccountWhereUniqueInput } from "./AccountWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class AccountFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => AccountWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AccountWhereUniqueInput) + @Field(() => AccountWhereUniqueInput, { nullable: false }) + where!: AccountWhereUniqueInput; +} + +export { AccountFindUniqueArgs as AccountFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/account/base/AccountListRelationFilter.ts b/apps/roi-cacl-2/src/account/base/AccountListRelationFilter.ts new file mode 100644 index 0000000..cf19aa3 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AccountWhereInput } from "./AccountWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class AccountListRelationFilter { + @ApiProperty({ + required: false, + type: () => AccountWhereInput, + }) + @ValidateNested() + @Type(() => AccountWhereInput) + @IsOptional() + @Field(() => AccountWhereInput, { + nullable: true, + }) + every?: AccountWhereInput; + + @ApiProperty({ + required: false, + type: () => AccountWhereInput, + }) + @ValidateNested() + @Type(() => AccountWhereInput) + @IsOptional() + @Field(() => AccountWhereInput, { + nullable: true, + }) + some?: AccountWhereInput; + + @ApiProperty({ + required: false, + type: () => AccountWhereInput, + }) + @ValidateNested() + @Type(() => AccountWhereInput) + @IsOptional() + @Field(() => AccountWhereInput, { + nullable: true, + }) + none?: AccountWhereInput; +} +export { AccountListRelationFilter as AccountListRelationFilter }; diff --git a/apps/roi-cacl-2/src/account/base/AccountOrderByInput.ts b/apps/roi-cacl-2/src/account/base/AccountOrderByInput.ts new file mode 100644 index 0000000..0a7db12 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountOrderByInput.ts @@ -0,0 +1,155 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class AccountOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + typeField?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + provider?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + providerAccountId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + refreshToken?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + accessToken?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + expiresAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + tokenType?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + scope?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + idToken?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + sessionState?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; +} + +export { AccountOrderByInput as AccountOrderByInput }; diff --git a/apps/roi-cacl-2/src/account/base/AccountUpdateInput.ts b/apps/roi-cacl-2/src/account/base/AccountUpdateInput.ts new file mode 100644 index 0000000..edd0e4b --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountUpdateInput.ts @@ -0,0 +1,143 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsInt, ValidateNested } from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class AccountUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + typeField?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + provider?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + providerAccountId?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + refreshToken?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + accessToken?: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + expiresAt?: number | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + tokenType?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + scope?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + idToken?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + sessionState?: string | null; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; +} + +export { AccountUpdateInput as AccountUpdateInput }; diff --git a/apps/roi-cacl-2/src/account/base/AccountWhereInput.ts b/apps/roi-cacl-2/src/account/base/AccountWhereInput.ts new file mode 100644 index 0000000..47723ba --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountWhereInput.ts @@ -0,0 +1,157 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { StringFilter } from "../../util/StringFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class AccountWhereInput { + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + id?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + typeField?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + provider?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + providerAccountId?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + refreshToken?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + accessToken?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + expiresAt?: IntNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + tokenType?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + scope?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + idToken?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + sessionState?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; +} + +export { AccountWhereInput as AccountWhereInput }; diff --git a/apps/roi-cacl-2/src/account/base/AccountWhereUniqueInput.ts b/apps/roi-cacl-2/src/account/base/AccountWhereUniqueInput.ts new file mode 100644 index 0000000..b62d580 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/AccountWhereUniqueInput.ts @@ -0,0 +1,27 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString } from "class-validator"; + +@InputType() +class AccountWhereUniqueInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; +} + +export { AccountWhereUniqueInput as AccountWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/account/base/CreateAccountArgs.ts b/apps/roi-cacl-2/src/account/base/CreateAccountArgs.ts new file mode 100644 index 0000000..6a7791f --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/CreateAccountArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AccountCreateInput } from "./AccountCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateAccountArgs { + @ApiProperty({ + required: true, + type: () => AccountCreateInput, + }) + @ValidateNested() + @Type(() => AccountCreateInput) + @Field(() => AccountCreateInput, { nullable: false }) + data!: AccountCreateInput; +} + +export { CreateAccountArgs as CreateAccountArgs }; diff --git a/apps/roi-cacl-2/src/account/base/DeleteAccountArgs.ts b/apps/roi-cacl-2/src/account/base/DeleteAccountArgs.ts new file mode 100644 index 0000000..a80866d --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/DeleteAccountArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AccountWhereUniqueInput } from "./AccountWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteAccountArgs { + @ApiProperty({ + required: true, + type: () => AccountWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AccountWhereUniqueInput) + @Field(() => AccountWhereUniqueInput, { nullable: false }) + where!: AccountWhereUniqueInput; +} + +export { DeleteAccountArgs as DeleteAccountArgs }; diff --git a/apps/roi-cacl-2/src/account/base/UpdateAccountArgs.ts b/apps/roi-cacl-2/src/account/base/UpdateAccountArgs.ts new file mode 100644 index 0000000..f13d30c --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/UpdateAccountArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AccountWhereUniqueInput } from "./AccountWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { AccountUpdateInput } from "./AccountUpdateInput"; + +@ArgsType() +class UpdateAccountArgs { + @ApiProperty({ + required: true, + type: () => AccountWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AccountWhereUniqueInput) + @Field(() => AccountWhereUniqueInput, { nullable: false }) + where!: AccountWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => AccountUpdateInput, + }) + @ValidateNested() + @Type(() => AccountUpdateInput) + @Field(() => AccountUpdateInput, { nullable: false }) + data!: AccountUpdateInput; +} + +export { UpdateAccountArgs as UpdateAccountArgs }; diff --git a/apps/roi-cacl-2/src/account/base/account.controller.base.spec.ts b/apps/roi-cacl-2/src/account/base/account.controller.base.spec.ts new file mode 100644 index 0000000..cb3efe6 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/account.controller.base.spec.ts @@ -0,0 +1,204 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { AccountController } from "../account.controller"; +import { AccountService } from "../account.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: "exampleId", + typeField: "exampleTypeField", + provider: "exampleProvider", + providerAccountId: "exampleProviderAccountId", + refreshToken: "exampleRefreshToken", + accessToken: "exampleAccessToken", + expiresAt: 42, + tokenType: "exampleTokenType", + scope: "exampleScope", + idToken: "exampleIdToken", + sessionState: "exampleSessionState", +}; +const CREATE_RESULT = { + id: "exampleId", + typeField: "exampleTypeField", + provider: "exampleProvider", + providerAccountId: "exampleProviderAccountId", + refreshToken: "exampleRefreshToken", + accessToken: "exampleAccessToken", + expiresAt: 42, + tokenType: "exampleTokenType", + scope: "exampleScope", + idToken: "exampleIdToken", + sessionState: "exampleSessionState", +}; +const FIND_MANY_RESULT = [ + { + id: "exampleId", + typeField: "exampleTypeField", + provider: "exampleProvider", + providerAccountId: "exampleProviderAccountId", + refreshToken: "exampleRefreshToken", + accessToken: "exampleAccessToken", + expiresAt: 42, + tokenType: "exampleTokenType", + scope: "exampleScope", + idToken: "exampleIdToken", + sessionState: "exampleSessionState", + }, +]; +const FIND_ONE_RESULT = { + id: "exampleId", + typeField: "exampleTypeField", + provider: "exampleProvider", + providerAccountId: "exampleProviderAccountId", + refreshToken: "exampleRefreshToken", + accessToken: "exampleAccessToken", + expiresAt: 42, + tokenType: "exampleTokenType", + scope: "exampleScope", + idToken: "exampleIdToken", + sessionState: "exampleSessionState", +}; + +const service = { + createAccount() { + return CREATE_RESULT; + }, + accounts: () => FIND_MANY_RESULT, + account: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Account", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: AccountService, + useValue: service, + }, + ], + controllers: [AccountController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /accounts", async () => { + await request(app.getHttpServer()) + .post("/accounts") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /accounts", async () => { + await request(app.getHttpServer()) + .get("/accounts") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /accounts/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/accounts"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /accounts/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/accounts"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /accounts existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/accounts") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/accounts") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/account/base/account.controller.base.ts b/apps/roi-cacl-2/src/account/base/account.controller.base.ts new file mode 100644 index 0000000..2f2bd05 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/account.controller.base.ts @@ -0,0 +1,217 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { AccountService } from "../account.service"; +import { AccountCreateInput } from "./AccountCreateInput"; +import { Account } from "./Account"; +import { AccountFindManyArgs } from "./AccountFindManyArgs"; +import { AccountWhereUniqueInput } from "./AccountWhereUniqueInput"; +import { AccountUpdateInput } from "./AccountUpdateInput"; + +export class AccountControllerBase { + constructor(protected readonly service: AccountService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Account }) + async createAccount( + @common.Body() data: AccountCreateInput + ): Promise<Account> { + return await this.service.createAccount({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + }, + select: { + id: true, + typeField: true, + provider: true, + providerAccountId: true, + refreshToken: true, + accessToken: true, + expiresAt: true, + tokenType: true, + scope: true, + idToken: true, + sessionState: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Account] }) + @ApiNestedQuery(AccountFindManyArgs) + async accounts(@common.Req() request: Request): Promise<Account[]> { + const args = plainToClass(AccountFindManyArgs, request.query); + return this.service.accounts({ + ...args, + select: { + id: true, + typeField: true, + provider: true, + providerAccountId: true, + refreshToken: true, + accessToken: true, + expiresAt: true, + tokenType: true, + scope: true, + idToken: true, + sessionState: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Account }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async account( + @common.Param() params: AccountWhereUniqueInput + ): Promise<Account | null> { + const result = await this.service.account({ + where: params, + select: { + id: true, + typeField: true, + provider: true, + providerAccountId: true, + refreshToken: true, + accessToken: true, + expiresAt: true, + tokenType: true, + scope: true, + idToken: true, + sessionState: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Account }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateAccount( + @common.Param() params: AccountWhereUniqueInput, + @common.Body() data: AccountUpdateInput + ): Promise<Account | null> { + try { + return await this.service.updateAccount({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + }, + select: { + id: true, + typeField: true, + provider: true, + providerAccountId: true, + refreshToken: true, + accessToken: true, + expiresAt: true, + tokenType: true, + scope: true, + idToken: true, + sessionState: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Account }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteAccount( + @common.Param() params: AccountWhereUniqueInput + ): Promise<Account | null> { + try { + return await this.service.deleteAccount({ + where: params, + select: { + id: true, + typeField: true, + provider: true, + providerAccountId: true, + refreshToken: true, + accessToken: true, + expiresAt: true, + tokenType: true, + scope: true, + idToken: true, + sessionState: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/account/base/account.module.base.ts b/apps/roi-cacl-2/src/account/base/account.module.base.ts new file mode 100644 index 0000000..39ee020 --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/account.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class AccountModuleBase {} diff --git a/apps/roi-cacl-2/src/account/base/account.resolver.base.ts b/apps/roi-cacl-2/src/account/base/account.resolver.base.ts new file mode 100644 index 0000000..67a52eb --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/account.resolver.base.ts @@ -0,0 +1,129 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Account } from "./Account"; +import { AccountCountArgs } from "./AccountCountArgs"; +import { AccountFindManyArgs } from "./AccountFindManyArgs"; +import { AccountFindUniqueArgs } from "./AccountFindUniqueArgs"; +import { CreateAccountArgs } from "./CreateAccountArgs"; +import { UpdateAccountArgs } from "./UpdateAccountArgs"; +import { DeleteAccountArgs } from "./DeleteAccountArgs"; +import { User } from "../../user/base/User"; +import { AccountService } from "../account.service"; +@graphql.Resolver(() => Account) +export class AccountResolverBase { + constructor(protected readonly service: AccountService) {} + + async _accountsMeta( + @graphql.Args() args: AccountCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Account]) + async accounts( + @graphql.Args() args: AccountFindManyArgs + ): Promise<Account[]> { + return this.service.accounts(args); + } + + @graphql.Query(() => Account, { nullable: true }) + async account( + @graphql.Args() args: AccountFindUniqueArgs + ): Promise<Account | null> { + const result = await this.service.account(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Account) + async createAccount( + @graphql.Args() args: CreateAccountArgs + ): Promise<Account> { + return await this.service.createAccount({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Account) + async updateAccount( + @graphql.Args() args: UpdateAccountArgs + ): Promise<Account | null> { + try { + return await this.service.updateAccount({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Account) + async deleteAccount( + @graphql.Args() args: DeleteAccountArgs + ): Promise<Account | null> { + try { + return await this.service.deleteAccount(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Account): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/account/base/account.service.base.ts b/apps/roi-cacl-2/src/account/base/account.service.base.ts new file mode 100644 index 0000000..38f90df --- /dev/null +++ b/apps/roi-cacl-2/src/account/base/account.service.base.ts @@ -0,0 +1,59 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + Account as PrismaAccount, + User as PrismaUser, +} from "@prisma/client"; + +export class AccountServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.AccountCountArgs, "select">): Promise<number> { + return this.prisma.account.count(args); + } + + async accounts<T extends Prisma.AccountFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.AccountFindManyArgs> + ): Promise<PrismaAccount[]> { + return this.prisma.account.findMany<Prisma.AccountFindManyArgs>(args); + } + async account<T extends Prisma.AccountFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.AccountFindUniqueArgs> + ): Promise<PrismaAccount | null> { + return this.prisma.account.findUnique(args); + } + async createAccount<T extends Prisma.AccountCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.AccountCreateArgs> + ): Promise<PrismaAccount> { + return this.prisma.account.create<T>(args); + } + async updateAccount<T extends Prisma.AccountUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.AccountUpdateArgs> + ): Promise<PrismaAccount> { + return this.prisma.account.update<T>(args); + } + async deleteAccount<T extends Prisma.AccountDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.AccountDeleteArgs> + ): Promise<PrismaAccount> { + return this.prisma.account.delete(args); + } + + async getUser(parentId: string): Promise<PrismaUser | null> { + return this.prisma.account + .findUnique({ + where: { id: parentId }, + }) + .user(); + } +} diff --git a/apps/roi-cacl-2/src/apiKey/apiKey.controller.ts b/apps/roi-cacl-2/src/apiKey/apiKey.controller.ts new file mode 100644 index 0000000..06122a6 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/apiKey.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { ApiKeyService } from "./apiKey.service"; +import { ApiKeyControllerBase } from "./base/apiKey.controller.base"; + +@swagger.ApiTags("apiKeys") +@common.Controller("apiKeys") +export class ApiKeyController extends ApiKeyControllerBase { + constructor(protected readonly service: ApiKeyService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/apiKey/apiKey.module.ts b/apps/roi-cacl-2/src/apiKey/apiKey.module.ts new file mode 100644 index 0000000..f536303 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/apiKey.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { ApiKeyModuleBase } from "./base/apiKey.module.base"; +import { ApiKeyService } from "./apiKey.service"; +import { ApiKeyController } from "./apiKey.controller"; +import { ApiKeyResolver } from "./apiKey.resolver"; + +@Module({ + imports: [ApiKeyModuleBase], + controllers: [ApiKeyController], + providers: [ApiKeyService, ApiKeyResolver], + exports: [ApiKeyService], +}) +export class ApiKeyModule {} diff --git a/apps/roi-cacl-2/src/apiKey/apiKey.resolver.ts b/apps/roi-cacl-2/src/apiKey/apiKey.resolver.ts new file mode 100644 index 0000000..555ce79 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/apiKey.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { ApiKeyResolverBase } from "./base/apiKey.resolver.base"; +import { ApiKey } from "./base/ApiKey"; +import { ApiKeyService } from "./apiKey.service"; + +@graphql.Resolver(() => ApiKey) +export class ApiKeyResolver extends ApiKeyResolverBase { + constructor(protected readonly service: ApiKeyService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/apiKey/apiKey.service.ts b/apps/roi-cacl-2/src/apiKey/apiKey.service.ts new file mode 100644 index 0000000..383c63c --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/apiKey.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { ApiKeyServiceBase } from "./base/apiKey.service.base"; + +@Injectable() +export class ApiKeyService extends ApiKeyServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKey.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKey.ts new file mode 100644 index 0000000..8b2ee74 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKey.ts @@ -0,0 +1,97 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsDate, ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { User } from "../../user/base/User"; +import { AppModel } from "../../appModel/base/AppModel"; + +@ObjectType() +class ApiKey { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + note!: string | null; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + expiresAt!: Date | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + lastUsedAt!: Date | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + hashedKey!: string; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; + + @ApiProperty({ + required: false, + type: () => AppModel, + }) + @ValidateNested() + @Type(() => AppModel) + @IsOptional() + appField?: AppModel | null; +} + +export { ApiKey as ApiKey }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyCountArgs.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyCountArgs.ts new file mode 100644 index 0000000..34fe246 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ApiKeyWhereInput } from "./ApiKeyWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class ApiKeyCountArgs { + @ApiProperty({ + required: false, + type: () => ApiKeyWhereInput, + }) + @Field(() => ApiKeyWhereInput, { nullable: true }) + @Type(() => ApiKeyWhereInput) + where?: ApiKeyWhereInput; +} + +export { ApiKeyCountArgs as ApiKeyCountArgs }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyCreateInput.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyCreateInput.ts new file mode 100644 index 0000000..be3e3fd --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyCreateInput.ts @@ -0,0 +1,87 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsDate, ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; + +@InputType() +class ApiKeyCreateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + note?: string | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + expiresAt?: Date | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + lastUsedAt?: Date | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + hashedKey!: string; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput | null; +} + +export { ApiKeyCreateInput as ApiKeyCreateInput }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyFindManyArgs.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyFindManyArgs.ts new file mode 100644 index 0000000..23e7508 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ApiKeyWhereInput } from "./ApiKeyWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { ApiKeyOrderByInput } from "./ApiKeyOrderByInput"; + +@ArgsType() +class ApiKeyFindManyArgs { + @ApiProperty({ + required: false, + type: () => ApiKeyWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => ApiKeyWhereInput, { nullable: true }) + @Type(() => ApiKeyWhereInput) + where?: ApiKeyWhereInput; + + @ApiProperty({ + required: false, + type: [ApiKeyOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [ApiKeyOrderByInput], { nullable: true }) + @Type(() => ApiKeyOrderByInput) + orderBy?: Array<ApiKeyOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { ApiKeyFindManyArgs as ApiKeyFindManyArgs }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyFindUniqueArgs.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyFindUniqueArgs.ts new file mode 100644 index 0000000..a880fea --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ApiKeyWhereUniqueInput } from "./ApiKeyWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class ApiKeyFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => ApiKeyWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ApiKeyWhereUniqueInput) + @Field(() => ApiKeyWhereUniqueInput, { nullable: false }) + where!: ApiKeyWhereUniqueInput; +} + +export { ApiKeyFindUniqueArgs as ApiKeyFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyListRelationFilter.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyListRelationFilter.ts new file mode 100644 index 0000000..723cf05 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ApiKeyWhereInput } from "./ApiKeyWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ApiKeyListRelationFilter { + @ApiProperty({ + required: false, + type: () => ApiKeyWhereInput, + }) + @ValidateNested() + @Type(() => ApiKeyWhereInput) + @IsOptional() + @Field(() => ApiKeyWhereInput, { + nullable: true, + }) + every?: ApiKeyWhereInput; + + @ApiProperty({ + required: false, + type: () => ApiKeyWhereInput, + }) + @ValidateNested() + @Type(() => ApiKeyWhereInput) + @IsOptional() + @Field(() => ApiKeyWhereInput, { + nullable: true, + }) + some?: ApiKeyWhereInput; + + @ApiProperty({ + required: false, + type: () => ApiKeyWhereInput, + }) + @ValidateNested() + @Type(() => ApiKeyWhereInput) + @IsOptional() + @Field(() => ApiKeyWhereInput, { + nullable: true, + }) + none?: ApiKeyWhereInput; +} +export { ApiKeyListRelationFilter as ApiKeyListRelationFilter }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyOrderByInput.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyOrderByInput.ts new file mode 100644 index 0000000..fb64ffb --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyOrderByInput.ts @@ -0,0 +1,111 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class ApiKeyOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + note?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + expiresAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + lastUsedAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + hashedKey?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + appId?: SortOrder; +} + +export { ApiKeyOrderByInput as ApiKeyOrderByInput }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyUpdateInput.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyUpdateInput.ts new file mode 100644 index 0000000..7c5192d --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyUpdateInput.ts @@ -0,0 +1,90 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsDate, ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; + +@InputType() +class ApiKeyUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + note?: string | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + expiresAt?: Date | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + lastUsedAt?: Date | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + hashedKey?: string; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput | null; +} + +export { ApiKeyUpdateInput as ApiKeyUpdateInput }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereInput.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereInput.ts new file mode 100644 index 0000000..45c6251 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereInput.ts @@ -0,0 +1,116 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { StringFilter } from "../../util/StringFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; + +@InputType() +class ApiKeyWhereInput { + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + id?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + note?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + expiresAt?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + lastUsedAt?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + hashedKey?: StringFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput; +} + +export { ApiKeyWhereInput as ApiKeyWhereInput }; diff --git a/apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereUniqueInput.ts b/apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereUniqueInput.ts new file mode 100644 index 0000000..da05e93 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/ApiKeyWhereUniqueInput.ts @@ -0,0 +1,27 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString } from "class-validator"; + +@InputType() +class ApiKeyWhereUniqueInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; +} + +export { ApiKeyWhereUniqueInput as ApiKeyWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/apiKey/base/CreateApiKeyArgs.ts b/apps/roi-cacl-2/src/apiKey/base/CreateApiKeyArgs.ts new file mode 100644 index 0000000..a01e88d --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/CreateApiKeyArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ApiKeyCreateInput } from "./ApiKeyCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateApiKeyArgs { + @ApiProperty({ + required: true, + type: () => ApiKeyCreateInput, + }) + @ValidateNested() + @Type(() => ApiKeyCreateInput) + @Field(() => ApiKeyCreateInput, { nullable: false }) + data!: ApiKeyCreateInput; +} + +export { CreateApiKeyArgs as CreateApiKeyArgs }; diff --git a/apps/roi-cacl-2/src/apiKey/base/DeleteApiKeyArgs.ts b/apps/roi-cacl-2/src/apiKey/base/DeleteApiKeyArgs.ts new file mode 100644 index 0000000..4f7d820 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/DeleteApiKeyArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ApiKeyWhereUniqueInput } from "./ApiKeyWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteApiKeyArgs { + @ApiProperty({ + required: true, + type: () => ApiKeyWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ApiKeyWhereUniqueInput) + @Field(() => ApiKeyWhereUniqueInput, { nullable: false }) + where!: ApiKeyWhereUniqueInput; +} + +export { DeleteApiKeyArgs as DeleteApiKeyArgs }; diff --git a/apps/roi-cacl-2/src/apiKey/base/UpdateApiKeyArgs.ts b/apps/roi-cacl-2/src/apiKey/base/UpdateApiKeyArgs.ts new file mode 100644 index 0000000..65df4bf --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/UpdateApiKeyArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ApiKeyWhereUniqueInput } from "./ApiKeyWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { ApiKeyUpdateInput } from "./ApiKeyUpdateInput"; + +@ArgsType() +class UpdateApiKeyArgs { + @ApiProperty({ + required: true, + type: () => ApiKeyWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ApiKeyWhereUniqueInput) + @Field(() => ApiKeyWhereUniqueInput, { nullable: false }) + where!: ApiKeyWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => ApiKeyUpdateInput, + }) + @ValidateNested() + @Type(() => ApiKeyUpdateInput) + @Field(() => ApiKeyUpdateInput, { nullable: false }) + data!: ApiKeyUpdateInput; +} + +export { UpdateApiKeyArgs as UpdateApiKeyArgs }; diff --git a/apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.spec.ts b/apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.spec.ts new file mode 100644 index 0000000..92e02aa --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.spec.ts @@ -0,0 +1,206 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { ApiKeyController } from "../apiKey.controller"; +import { ApiKeyService } from "../apiKey.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: "exampleId", + note: "exampleNote", + createdAt: new Date(), + expiresAt: new Date(), + lastUsedAt: new Date(), + hashedKey: "exampleHashedKey", +}; +const CREATE_RESULT = { + id: "exampleId", + note: "exampleNote", + createdAt: new Date(), + expiresAt: new Date(), + lastUsedAt: new Date(), + hashedKey: "exampleHashedKey", +}; +const FIND_MANY_RESULT = [ + { + id: "exampleId", + note: "exampleNote", + createdAt: new Date(), + expiresAt: new Date(), + lastUsedAt: new Date(), + hashedKey: "exampleHashedKey", + }, +]; +const FIND_ONE_RESULT = { + id: "exampleId", + note: "exampleNote", + createdAt: new Date(), + expiresAt: new Date(), + lastUsedAt: new Date(), + hashedKey: "exampleHashedKey", +}; + +const service = { + createApiKey() { + return CREATE_RESULT; + }, + apiKeys: () => FIND_MANY_RESULT, + apiKey: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("ApiKey", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: ApiKeyService, + useValue: service, + }, + ], + controllers: [ApiKeyController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /apiKeys", async () => { + await request(app.getHttpServer()) + .post("/apiKeys") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + expiresAt: CREATE_RESULT.expiresAt.toISOString(), + lastUsedAt: CREATE_RESULT.lastUsedAt.toISOString(), + }); + }); + + test("GET /apiKeys", async () => { + await request(app.getHttpServer()) + .get("/apiKeys") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + expiresAt: FIND_MANY_RESULT[0].expiresAt.toISOString(), + lastUsedAt: FIND_MANY_RESULT[0].lastUsedAt.toISOString(), + }, + ]); + }); + + test("GET /apiKeys/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/apiKeys"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /apiKeys/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/apiKeys"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + expiresAt: FIND_ONE_RESULT.expiresAt.toISOString(), + lastUsedAt: FIND_ONE_RESULT.lastUsedAt.toISOString(), + }); + }); + + test("POST /apiKeys existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/apiKeys") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + expiresAt: CREATE_RESULT.expiresAt.toISOString(), + lastUsedAt: CREATE_RESULT.lastUsedAt.toISOString(), + }) + .then(function () { + agent + .post("/apiKeys") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.ts b/apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.ts new file mode 100644 index 0000000..e9a3148 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/apiKey.controller.base.ts @@ -0,0 +1,232 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { ApiKeyService } from "../apiKey.service"; +import { ApiKeyCreateInput } from "./ApiKeyCreateInput"; +import { ApiKey } from "./ApiKey"; +import { ApiKeyFindManyArgs } from "./ApiKeyFindManyArgs"; +import { ApiKeyWhereUniqueInput } from "./ApiKeyWhereUniqueInput"; +import { ApiKeyUpdateInput } from "./ApiKeyUpdateInput"; + +export class ApiKeyControllerBase { + constructor(protected readonly service: ApiKeyService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: ApiKey }) + async createApiKey(@common.Body() data: ApiKeyCreateInput): Promise<ApiKey> { + return await this.service.createApiKey({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + appField: data.appField + ? { + connect: data.appField, + } + : undefined, + }, + select: { + id: true, + note: true, + createdAt: true, + expiresAt: true, + lastUsedAt: true, + hashedKey: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [ApiKey] }) + @ApiNestedQuery(ApiKeyFindManyArgs) + async apiKeys(@common.Req() request: Request): Promise<ApiKey[]> { + const args = plainToClass(ApiKeyFindManyArgs, request.query); + return this.service.apiKeys({ + ...args, + select: { + id: true, + note: true, + createdAt: true, + expiresAt: true, + lastUsedAt: true, + hashedKey: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: ApiKey }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async apiKey( + @common.Param() params: ApiKeyWhereUniqueInput + ): Promise<ApiKey | null> { + const result = await this.service.apiKey({ + where: params, + select: { + id: true, + note: true, + createdAt: true, + expiresAt: true, + lastUsedAt: true, + hashedKey: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: ApiKey }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateApiKey( + @common.Param() params: ApiKeyWhereUniqueInput, + @common.Body() data: ApiKeyUpdateInput + ): Promise<ApiKey | null> { + try { + return await this.service.updateApiKey({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + appField: data.appField + ? { + connect: data.appField, + } + : undefined, + }, + select: { + id: true, + note: true, + createdAt: true, + expiresAt: true, + lastUsedAt: true, + hashedKey: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: ApiKey }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteApiKey( + @common.Param() params: ApiKeyWhereUniqueInput + ): Promise<ApiKey | null> { + try { + return await this.service.deleteApiKey({ + where: params, + select: { + id: true, + note: true, + createdAt: true, + expiresAt: true, + lastUsedAt: true, + hashedKey: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/apiKey/base/apiKey.module.base.ts b/apps/roi-cacl-2/src/apiKey/base/apiKey.module.base.ts new file mode 100644 index 0000000..857051d --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/apiKey.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class ApiKeyModuleBase {} diff --git a/apps/roi-cacl-2/src/apiKey/base/apiKey.resolver.base.ts b/apps/roi-cacl-2/src/apiKey/base/apiKey.resolver.base.ts new file mode 100644 index 0000000..4520459 --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/apiKey.resolver.base.ts @@ -0,0 +1,153 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { ApiKey } from "./ApiKey"; +import { ApiKeyCountArgs } from "./ApiKeyCountArgs"; +import { ApiKeyFindManyArgs } from "./ApiKeyFindManyArgs"; +import { ApiKeyFindUniqueArgs } from "./ApiKeyFindUniqueArgs"; +import { CreateApiKeyArgs } from "./CreateApiKeyArgs"; +import { UpdateApiKeyArgs } from "./UpdateApiKeyArgs"; +import { DeleteApiKeyArgs } from "./DeleteApiKeyArgs"; +import { User } from "../../user/base/User"; +import { AppModel } from "../../appModel/base/AppModel"; +import { ApiKeyService } from "../apiKey.service"; +@graphql.Resolver(() => ApiKey) +export class ApiKeyResolverBase { + constructor(protected readonly service: ApiKeyService) {} + + async _apiKeysMeta( + @graphql.Args() args: ApiKeyCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [ApiKey]) + async apiKeys(@graphql.Args() args: ApiKeyFindManyArgs): Promise<ApiKey[]> { + return this.service.apiKeys(args); + } + + @graphql.Query(() => ApiKey, { nullable: true }) + async apiKey( + @graphql.Args() args: ApiKeyFindUniqueArgs + ): Promise<ApiKey | null> { + const result = await this.service.apiKey(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => ApiKey) + async createApiKey(@graphql.Args() args: CreateApiKeyArgs): Promise<ApiKey> { + return await this.service.createApiKey({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + appField: args.data.appField + ? { + connect: args.data.appField, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => ApiKey) + async updateApiKey( + @graphql.Args() args: UpdateApiKeyArgs + ): Promise<ApiKey | null> { + try { + return await this.service.updateApiKey({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + appField: args.data.appField + ? { + connect: args.data.appField, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => ApiKey) + async deleteApiKey( + @graphql.Args() args: DeleteApiKeyArgs + ): Promise<ApiKey | null> { + try { + return await this.service.deleteApiKey(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: ApiKey): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => AppModel, { + nullable: true, + name: "appField", + }) + async getAppField( + @graphql.Parent() parent: ApiKey + ): Promise<AppModel | null> { + const result = await this.service.getAppField(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/apiKey/base/apiKey.service.base.ts b/apps/roi-cacl-2/src/apiKey/base/apiKey.service.base.ts new file mode 100644 index 0000000..6db00bc --- /dev/null +++ b/apps/roi-cacl-2/src/apiKey/base/apiKey.service.base.ts @@ -0,0 +1,69 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + ApiKey as PrismaApiKey, + User as PrismaUser, + AppModel as PrismaAppModel, +} from "@prisma/client"; + +export class ApiKeyServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.ApiKeyCountArgs, "select">): Promise<number> { + return this.prisma.apiKey.count(args); + } + + async apiKeys<T extends Prisma.ApiKeyFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.ApiKeyFindManyArgs> + ): Promise<PrismaApiKey[]> { + return this.prisma.apiKey.findMany<Prisma.ApiKeyFindManyArgs>(args); + } + async apiKey<T extends Prisma.ApiKeyFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.ApiKeyFindUniqueArgs> + ): Promise<PrismaApiKey | null> { + return this.prisma.apiKey.findUnique(args); + } + async createApiKey<T extends Prisma.ApiKeyCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.ApiKeyCreateArgs> + ): Promise<PrismaApiKey> { + return this.prisma.apiKey.create<T>(args); + } + async updateApiKey<T extends Prisma.ApiKeyUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.ApiKeyUpdateArgs> + ): Promise<PrismaApiKey> { + return this.prisma.apiKey.update<T>(args); + } + async deleteApiKey<T extends Prisma.ApiKeyDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.ApiKeyDeleteArgs> + ): Promise<PrismaApiKey> { + return this.prisma.apiKey.delete(args); + } + + async getUser(parentId: string): Promise<PrismaUser | null> { + return this.prisma.apiKey + .findUnique({ + where: { id: parentId }, + }) + .user(); + } + + async getAppField(parentId: string): Promise<PrismaAppModel | null> { + return this.prisma.apiKey + .findUnique({ + where: { id: parentId }, + }) + .appField(); + } +} diff --git a/apps/roi-cacl-2/src/app.module.ts b/apps/roi-cacl-2/src/app.module.ts new file mode 100644 index 0000000..443a597 --- /dev/null +++ b/apps/roi-cacl-2/src/app.module.ts @@ -0,0 +1,99 @@ +import { Module } from "@nestjs/common"; +import { EventTypeModule } from "./eventType/eventType.module"; +import { CredentialModule } from "./credential/credential.module"; +import { DestinationCalendarModule } from "./destinationCalendar/destinationCalendar.module"; +import { UserModule } from "./user/user.module"; +import { TeamModule } from "./team/team.module"; +import { MembershipModule } from "./membership/membership.module"; +import { VerificationTokenModule } from "./verificationToken/verificationToken.module"; +import { BookingReferenceModule } from "./bookingReference/bookingReference.module"; +import { AttendeeModule } from "./attendee/attendee.module"; +import { DailyEventReferenceModule } from "./dailyEventReference/dailyEventReference.module"; +import { BookingModule } from "./booking/booking.module"; +import { ScheduleModule } from "./schedule/schedule.module"; +import { AvailabilityModule } from "./availability/availability.module"; +import { SelectedCalendarModule } from "./selectedCalendar/selectedCalendar.module"; +import { EventTypeCustomInputModule } from "./eventTypeCustomInput/eventTypeCustomInput.module"; +import { ResetPasswordRequestModule } from "./resetPasswordRequest/resetPasswordRequest.module"; +import { ReminderMailModule } from "./reminderMail/reminderMail.module"; +import { PaymentModule } from "./payment/payment.module"; +import { WebhookModule } from "./webhook/webhook.module"; +import { ImpersonationModule } from "./impersonation/impersonation.module"; +import { ApiKeyModule } from "./apiKey/apiKey.module"; +import { HashedLinkModule } from "./hashedLink/hashedLink.module"; +import { AccountModule } from "./account/account.module"; +import { SessionModule } from "./session/session.module"; +import { AppModelModule } from "./appModel/appModel.module"; +import { FeedbackModule } from "./feedback/feedback.module"; +import { WorkflowStepModule } from "./workflowStep/workflowStep.module"; +import { WorkflowModule } from "./workflow/workflow.module"; +import { WorkflowsOnEventTypeModule } from "./workflowsOnEventType/workflowsOnEventType.module"; +import { WorkflowReminderModule } from "./workflowReminder/workflowReminder.module"; +import { HealthModule } from "./health/health.module"; +import { PrismaModule } from "./prisma/prisma.module"; +import { SecretsManagerModule } from "./providers/secrets/secretsManager.module"; +import { ServeStaticModule } from "@nestjs/serve-static"; +import { ServeStaticOptionsService } from "./serveStaticOptions.service"; +import { ConfigModule, ConfigService } from "@nestjs/config"; +import { GraphQLModule } from "@nestjs/graphql"; +import { ApolloDriver, ApolloDriverConfig } from "@nestjs/apollo"; + +@Module({ + controllers: [], + imports: [ + EventTypeModule, + CredentialModule, + DestinationCalendarModule, + UserModule, + TeamModule, + MembershipModule, + VerificationTokenModule, + BookingReferenceModule, + AttendeeModule, + DailyEventReferenceModule, + BookingModule, + ScheduleModule, + AvailabilityModule, + SelectedCalendarModule, + EventTypeCustomInputModule, + ResetPasswordRequestModule, + ReminderMailModule, + PaymentModule, + WebhookModule, + ImpersonationModule, + ApiKeyModule, + HashedLinkModule, + AccountModule, + SessionModule, + AppModelModule, + FeedbackModule, + WorkflowStepModule, + WorkflowModule, + WorkflowsOnEventTypeModule, + WorkflowReminderModule, + HealthModule, + PrismaModule, + SecretsManagerModule, + ConfigModule.forRoot({ isGlobal: true }), + ServeStaticModule.forRootAsync({ + useClass: ServeStaticOptionsService, + }), + GraphQLModule.forRootAsync<ApolloDriverConfig>({ + driver: ApolloDriver, + useFactory: (configService: ConfigService) => { + const playground = configService.get("GRAPHQL_PLAYGROUND"); + const introspection = configService.get("GRAPHQL_INTROSPECTION"); + return { + autoSchemaFile: "schema.graphql", + sortSchema: true, + playground, + introspection: playground || introspection, + }; + }, + inject: [ConfigService], + imports: [ConfigModule], + }), + ], + providers: [], +}) +export class AppModule {} diff --git a/apps/roi-cacl-2/src/appModel/appModel.controller.ts b/apps/roi-cacl-2/src/appModel/appModel.controller.ts new file mode 100644 index 0000000..eaa447e --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/appModel.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { AppModelService } from "./appModel.service"; +import { AppModelControllerBase } from "./base/appModel.controller.base"; + +@swagger.ApiTags("appModels") +@common.Controller("appModels") +export class AppModelController extends AppModelControllerBase { + constructor(protected readonly service: AppModelService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/appModel/appModel.module.ts b/apps/roi-cacl-2/src/appModel/appModel.module.ts new file mode 100644 index 0000000..14c5f07 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/appModel.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { AppModelModuleBase } from "./base/appModel.module.base"; +import { AppModelService } from "./appModel.service"; +import { AppModelController } from "./appModel.controller"; +import { AppModelResolver } from "./appModel.resolver"; + +@Module({ + imports: [AppModelModuleBase], + controllers: [AppModelController], + providers: [AppModelService, AppModelResolver], + exports: [AppModelService], +}) +export class AppModelModule {} diff --git a/apps/roi-cacl-2/src/appModel/appModel.resolver.ts b/apps/roi-cacl-2/src/appModel/appModel.resolver.ts new file mode 100644 index 0000000..b7bd12f --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/appModel.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { AppModelResolverBase } from "./base/appModel.resolver.base"; +import { AppModel } from "./base/AppModel"; +import { AppModelService } from "./appModel.service"; + +@graphql.Resolver(() => AppModel) +export class AppModelResolver extends AppModelResolverBase { + constructor(protected readonly service: AppModelService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/appModel/appModel.service.ts b/apps/roi-cacl-2/src/appModel/appModel.service.ts new file mode 100644 index 0000000..96d6428 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/appModel.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { AppModelServiceBase } from "./base/appModel.service.base"; + +@Injectable() +export class AppModelService extends AppModelServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/appModel/base/ApiKeyCreateNestedManyWithoutAppModelsInput.ts b/apps/roi-cacl-2/src/appModel/base/ApiKeyCreateNestedManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..ef5d917 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/ApiKeyCreateNestedManyWithoutAppModelsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiKeyWhereUniqueInput } from "../../apiKey/base/ApiKeyWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ApiKeyCreateNestedManyWithoutAppModelsInput { + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + connect?: Array<ApiKeyWhereUniqueInput>; +} + +export { ApiKeyCreateNestedManyWithoutAppModelsInput as ApiKeyCreateNestedManyWithoutAppModelsInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/ApiKeyUpdateManyWithoutAppModelsInput.ts b/apps/roi-cacl-2/src/appModel/base/ApiKeyUpdateManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..9e931c5 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/ApiKeyUpdateManyWithoutAppModelsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiKeyWhereUniqueInput } from "../../apiKey/base/ApiKeyWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ApiKeyUpdateManyWithoutAppModelsInput { + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + connect?: Array<ApiKeyWhereUniqueInput>; + + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + disconnect?: Array<ApiKeyWhereUniqueInput>; + + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + set?: Array<ApiKeyWhereUniqueInput>; +} + +export { ApiKeyUpdateManyWithoutAppModelsInput as ApiKeyUpdateManyWithoutAppModelsInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModel.ts b/apps/roi-cacl-2/src/appModel/base/AppModel.ts new file mode 100644 index 0000000..c547e90 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModel.ts @@ -0,0 +1,118 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsEnum, + IsDate, + ValidateNested, +} from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { JsonValue } from "type-fest"; +import { EnumAppModelCategories } from "./EnumAppModelCategories"; +import { Type } from "class-transformer"; +import { Credential } from "../../credential/base/Credential"; +import { Webhook } from "../../webhook/base/Webhook"; +import { ApiKey } from "../../apiKey/base/ApiKey"; + +@ObjectType() +class AppModel { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + dirName!: string; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + keys!: JsonValue; + + @ApiProperty({ + required: true, + enum: EnumAppModelCategories, + isArray: true, + }) + @IsEnum(EnumAppModelCategories, { + each: true, + }) + @IsOptional() + @Field(() => [EnumAppModelCategories], { + nullable: true, + }) + categories?: Array< + "calendar" | "messaging" | "other" | "payment" | "video" | "web3" + >; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + updatedAt!: Date; + + @ApiProperty({ + required: false, + type: () => [Credential], + }) + @ValidateNested() + @Type(() => Credential) + @IsOptional() + credentials?: Array<Credential>; + + @ApiProperty({ + required: false, + type: () => [Webhook], + }) + @ValidateNested() + @Type(() => Webhook) + @IsOptional() + webhook?: Array<Webhook>; + + @ApiProperty({ + required: false, + type: () => [ApiKey], + }) + @ValidateNested() + @Type(() => ApiKey) + @IsOptional() + apiKey?: Array<ApiKey>; +} + +export { AppModel as AppModel }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelCountArgs.ts b/apps/roi-cacl-2/src/appModel/base/AppModelCountArgs.ts new file mode 100644 index 0000000..53af3f2 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AppModelWhereInput } from "./AppModelWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class AppModelCountArgs { + @ApiProperty({ + required: false, + type: () => AppModelWhereInput, + }) + @Field(() => AppModelWhereInput, { nullable: true }) + @Type(() => AppModelWhereInput) + where?: AppModelWhereInput; +} + +export { AppModelCountArgs as AppModelCountArgs }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelCreateInput.ts b/apps/roi-cacl-2/src/appModel/base/AppModelCreateInput.ts new file mode 100644 index 0000000..9fd94be --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelCreateInput.ts @@ -0,0 +1,97 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsEnum, ValidateNested } from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { EnumAppModelCategories } from "./EnumAppModelCategories"; +import { CredentialCreateNestedManyWithoutAppModelsInput } from "./CredentialCreateNestedManyWithoutAppModelsInput"; +import { Type } from "class-transformer"; +import { WebhookCreateNestedManyWithoutAppModelsInput } from "./WebhookCreateNestedManyWithoutAppModelsInput"; +import { ApiKeyCreateNestedManyWithoutAppModelsInput } from "./ApiKeyCreateNestedManyWithoutAppModelsInput"; + +@InputType() +class AppModelCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + dirName!: string; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + keys?: InputJsonValue; + + @ApiProperty({ + required: true, + enum: EnumAppModelCategories, + isArray: true, + }) + @IsEnum(EnumAppModelCategories, { + each: true, + }) + @IsOptional() + @Field(() => [EnumAppModelCategories], { + nullable: true, + }) + categories?: Array< + "calendar" | "messaging" | "other" | "payment" | "video" | "web3" + >; + + @ApiProperty({ + required: false, + type: () => CredentialCreateNestedManyWithoutAppModelsInput, + }) + @ValidateNested() + @Type(() => CredentialCreateNestedManyWithoutAppModelsInput) + @IsOptional() + @Field(() => CredentialCreateNestedManyWithoutAppModelsInput, { + nullable: true, + }) + credentials?: CredentialCreateNestedManyWithoutAppModelsInput; + + @ApiProperty({ + required: false, + type: () => WebhookCreateNestedManyWithoutAppModelsInput, + }) + @ValidateNested() + @Type(() => WebhookCreateNestedManyWithoutAppModelsInput) + @IsOptional() + @Field(() => WebhookCreateNestedManyWithoutAppModelsInput, { + nullable: true, + }) + webhook?: WebhookCreateNestedManyWithoutAppModelsInput; + + @ApiProperty({ + required: false, + type: () => ApiKeyCreateNestedManyWithoutAppModelsInput, + }) + @ValidateNested() + @Type(() => ApiKeyCreateNestedManyWithoutAppModelsInput) + @IsOptional() + @Field(() => ApiKeyCreateNestedManyWithoutAppModelsInput, { + nullable: true, + }) + apiKey?: ApiKeyCreateNestedManyWithoutAppModelsInput; +} + +export { AppModelCreateInput as AppModelCreateInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelFindManyArgs.ts b/apps/roi-cacl-2/src/appModel/base/AppModelFindManyArgs.ts new file mode 100644 index 0000000..7dd6f13 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AppModelWhereInput } from "./AppModelWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { AppModelOrderByInput } from "./AppModelOrderByInput"; + +@ArgsType() +class AppModelFindManyArgs { + @ApiProperty({ + required: false, + type: () => AppModelWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => AppModelWhereInput, { nullable: true }) + @Type(() => AppModelWhereInput) + where?: AppModelWhereInput; + + @ApiProperty({ + required: false, + type: [AppModelOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [AppModelOrderByInput], { nullable: true }) + @Type(() => AppModelOrderByInput) + orderBy?: Array<AppModelOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { AppModelFindManyArgs as AppModelFindManyArgs }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelFindUniqueArgs.ts b/apps/roi-cacl-2/src/appModel/base/AppModelFindUniqueArgs.ts new file mode 100644 index 0000000..e94f70d --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AppModelWhereUniqueInput } from "./AppModelWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class AppModelFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @Field(() => AppModelWhereUniqueInput, { nullable: false }) + where!: AppModelWhereUniqueInput; +} + +export { AppModelFindUniqueArgs as AppModelFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelListRelationFilter.ts b/apps/roi-cacl-2/src/appModel/base/AppModelListRelationFilter.ts new file mode 100644 index 0000000..73990b1 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AppModelWhereInput } from "./AppModelWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class AppModelListRelationFilter { + @ApiProperty({ + required: false, + type: () => AppModelWhereInput, + }) + @ValidateNested() + @Type(() => AppModelWhereInput) + @IsOptional() + @Field(() => AppModelWhereInput, { + nullable: true, + }) + every?: AppModelWhereInput; + + @ApiProperty({ + required: false, + type: () => AppModelWhereInput, + }) + @ValidateNested() + @Type(() => AppModelWhereInput) + @IsOptional() + @Field(() => AppModelWhereInput, { + nullable: true, + }) + some?: AppModelWhereInput; + + @ApiProperty({ + required: false, + type: () => AppModelWhereInput, + }) + @ValidateNested() + @Type(() => AppModelWhereInput) + @IsOptional() + @Field(() => AppModelWhereInput, { + nullable: true, + }) + none?: AppModelWhereInput; +} +export { AppModelListRelationFilter as AppModelListRelationFilter }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelOrderByInput.ts b/apps/roi-cacl-2/src/appModel/base/AppModelOrderByInput.ts new file mode 100644 index 0000000..3085662 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelOrderByInput.ts @@ -0,0 +1,89 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class AppModelOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + dirName?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + keys?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + categories?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + updatedAt?: SortOrder; +} + +export { AppModelOrderByInput as AppModelOrderByInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelUpdateInput.ts b/apps/roi-cacl-2/src/appModel/base/AppModelUpdateInput.ts new file mode 100644 index 0000000..b7b34a6 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelUpdateInput.ts @@ -0,0 +1,100 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsEnum, ValidateNested } from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { EnumAppModelCategories } from "./EnumAppModelCategories"; +import { CredentialUpdateManyWithoutAppModelsInput } from "./CredentialUpdateManyWithoutAppModelsInput"; +import { Type } from "class-transformer"; +import { WebhookUpdateManyWithoutAppModelsInput } from "./WebhookUpdateManyWithoutAppModelsInput"; +import { ApiKeyUpdateManyWithoutAppModelsInput } from "./ApiKeyUpdateManyWithoutAppModelsInput"; + +@InputType() +class AppModelUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dirName?: string; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + keys?: InputJsonValue; + + @ApiProperty({ + required: false, + enum: EnumAppModelCategories, + isArray: true, + }) + @IsEnum(EnumAppModelCategories, { + each: true, + }) + @IsOptional() + @Field(() => [EnumAppModelCategories], { + nullable: true, + }) + categories?: Array< + "calendar" | "messaging" | "other" | "payment" | "video" | "web3" + >; + + @ApiProperty({ + required: false, + type: () => CredentialUpdateManyWithoutAppModelsInput, + }) + @ValidateNested() + @Type(() => CredentialUpdateManyWithoutAppModelsInput) + @IsOptional() + @Field(() => CredentialUpdateManyWithoutAppModelsInput, { + nullable: true, + }) + credentials?: CredentialUpdateManyWithoutAppModelsInput; + + @ApiProperty({ + required: false, + type: () => WebhookUpdateManyWithoutAppModelsInput, + }) + @ValidateNested() + @Type(() => WebhookUpdateManyWithoutAppModelsInput) + @IsOptional() + @Field(() => WebhookUpdateManyWithoutAppModelsInput, { + nullable: true, + }) + webhook?: WebhookUpdateManyWithoutAppModelsInput; + + @ApiProperty({ + required: false, + type: () => ApiKeyUpdateManyWithoutAppModelsInput, + }) + @ValidateNested() + @Type(() => ApiKeyUpdateManyWithoutAppModelsInput) + @IsOptional() + @Field(() => ApiKeyUpdateManyWithoutAppModelsInput, { + nullable: true, + }) + apiKey?: ApiKeyUpdateManyWithoutAppModelsInput; +} + +export { AppModelUpdateInput as AppModelUpdateInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelWhereInput.ts b/apps/roi-cacl-2/src/appModel/base/AppModelWhereInput.ts new file mode 100644 index 0000000..1298395 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelWhereInput.ts @@ -0,0 +1,117 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { StringFilter } from "../../util/StringFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { JsonFilter } from "../../util/JsonFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { CredentialListRelationFilter } from "../../credential/base/CredentialListRelationFilter"; +import { WebhookListRelationFilter } from "../../webhook/base/WebhookListRelationFilter"; +import { ApiKeyListRelationFilter } from "../../apiKey/base/ApiKeyListRelationFilter"; + +@InputType() +class AppModelWhereInput { + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + id?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + dirName?: StringFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + keys?: JsonFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + updatedAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: () => CredentialListRelationFilter, + }) + @ValidateNested() + @Type(() => CredentialListRelationFilter) + @IsOptional() + @Field(() => CredentialListRelationFilter, { + nullable: true, + }) + credentials?: CredentialListRelationFilter; + + @ApiProperty({ + required: false, + type: () => WebhookListRelationFilter, + }) + @ValidateNested() + @Type(() => WebhookListRelationFilter) + @IsOptional() + @Field(() => WebhookListRelationFilter, { + nullable: true, + }) + webhook?: WebhookListRelationFilter; + + @ApiProperty({ + required: false, + type: () => ApiKeyListRelationFilter, + }) + @ValidateNested() + @Type(() => ApiKeyListRelationFilter) + @IsOptional() + @Field(() => ApiKeyListRelationFilter, { + nullable: true, + }) + apiKey?: ApiKeyListRelationFilter; +} + +export { AppModelWhereInput as AppModelWhereInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/AppModelWhereUniqueInput.ts b/apps/roi-cacl-2/src/appModel/base/AppModelWhereUniqueInput.ts new file mode 100644 index 0000000..d9dd496 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/AppModelWhereUniqueInput.ts @@ -0,0 +1,27 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString } from "class-validator"; + +@InputType() +class AppModelWhereUniqueInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; +} + +export { AppModelWhereUniqueInput as AppModelWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/CreateAppModelArgs.ts b/apps/roi-cacl-2/src/appModel/base/CreateAppModelArgs.ts new file mode 100644 index 0000000..22ff846 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/CreateAppModelArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AppModelCreateInput } from "./AppModelCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateAppModelArgs { + @ApiProperty({ + required: true, + type: () => AppModelCreateInput, + }) + @ValidateNested() + @Type(() => AppModelCreateInput) + @Field(() => AppModelCreateInput, { nullable: false }) + data!: AppModelCreateInput; +} + +export { CreateAppModelArgs as CreateAppModelArgs }; diff --git a/apps/roi-cacl-2/src/appModel/base/CredentialCreateNestedManyWithoutAppModelsInput.ts b/apps/roi-cacl-2/src/appModel/base/CredentialCreateNestedManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..49eb38f --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/CredentialCreateNestedManyWithoutAppModelsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class CredentialCreateNestedManyWithoutAppModelsInput { + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + connect?: Array<CredentialWhereUniqueInput>; +} + +export { CredentialCreateNestedManyWithoutAppModelsInput as CredentialCreateNestedManyWithoutAppModelsInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/CredentialUpdateManyWithoutAppModelsInput.ts b/apps/roi-cacl-2/src/appModel/base/CredentialUpdateManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..bacdc19 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/CredentialUpdateManyWithoutAppModelsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class CredentialUpdateManyWithoutAppModelsInput { + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + connect?: Array<CredentialWhereUniqueInput>; + + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + disconnect?: Array<CredentialWhereUniqueInput>; + + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + set?: Array<CredentialWhereUniqueInput>; +} + +export { CredentialUpdateManyWithoutAppModelsInput as CredentialUpdateManyWithoutAppModelsInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/DeleteAppModelArgs.ts b/apps/roi-cacl-2/src/appModel/base/DeleteAppModelArgs.ts new file mode 100644 index 0000000..b248776 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/DeleteAppModelArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AppModelWhereUniqueInput } from "./AppModelWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteAppModelArgs { + @ApiProperty({ + required: true, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @Field(() => AppModelWhereUniqueInput, { nullable: false }) + where!: AppModelWhereUniqueInput; +} + +export { DeleteAppModelArgs as DeleteAppModelArgs }; diff --git a/apps/roi-cacl-2/src/appModel/base/EnumAppModelCategories.ts b/apps/roi-cacl-2/src/appModel/base/EnumAppModelCategories.ts new file mode 100644 index 0000000..e58a146 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/EnumAppModelCategories.ts @@ -0,0 +1,26 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Payment } from "../../payment/base/Payment"; +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumAppModelCategories { + Calendar = "calendar", + Messaging = "messaging", + Other = "other", + Payment = "payment", + Video = "video", + Web3 = "web3", +} + +registerEnumType(EnumAppModelCategories, { + name: "EnumAppModelCategories", +}); diff --git a/apps/roi-cacl-2/src/appModel/base/UpdateAppModelArgs.ts b/apps/roi-cacl-2/src/appModel/base/UpdateAppModelArgs.ts new file mode 100644 index 0000000..4cc891e --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/UpdateAppModelArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AppModelWhereUniqueInput } from "./AppModelWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { AppModelUpdateInput } from "./AppModelUpdateInput"; + +@ArgsType() +class UpdateAppModelArgs { + @ApiProperty({ + required: true, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @Field(() => AppModelWhereUniqueInput, { nullable: false }) + where!: AppModelWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => AppModelUpdateInput, + }) + @ValidateNested() + @Type(() => AppModelUpdateInput) + @Field(() => AppModelUpdateInput, { nullable: false }) + data!: AppModelUpdateInput; +} + +export { UpdateAppModelArgs as UpdateAppModelArgs }; diff --git a/apps/roi-cacl-2/src/appModel/base/WebhookCreateNestedManyWithoutAppModelsInput.ts b/apps/roi-cacl-2/src/appModel/base/WebhookCreateNestedManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..c6a41b7 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/WebhookCreateNestedManyWithoutAppModelsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WebhookCreateNestedManyWithoutAppModelsInput { + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + connect?: Array<WebhookWhereUniqueInput>; +} + +export { WebhookCreateNestedManyWithoutAppModelsInput as WebhookCreateNestedManyWithoutAppModelsInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/WebhookUpdateManyWithoutAppModelsInput.ts b/apps/roi-cacl-2/src/appModel/base/WebhookUpdateManyWithoutAppModelsInput.ts new file mode 100644 index 0000000..1e6073c --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/WebhookUpdateManyWithoutAppModelsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WebhookUpdateManyWithoutAppModelsInput { + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + connect?: Array<WebhookWhereUniqueInput>; + + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + disconnect?: Array<WebhookWhereUniqueInput>; + + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + set?: Array<WebhookWhereUniqueInput>; +} + +export { WebhookUpdateManyWithoutAppModelsInput as WebhookUpdateManyWithoutAppModelsInput }; diff --git a/apps/roi-cacl-2/src/appModel/base/appModel.controller.base.spec.ts b/apps/roi-cacl-2/src/appModel/base/appModel.controller.base.spec.ts new file mode 100644 index 0000000..91b454c --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/appModel.controller.base.spec.ts @@ -0,0 +1,194 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { AppModelController } from "../appModel.controller"; +import { AppModelService } from "../appModel.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: "exampleId", + dirName: "exampleDirName", + createdAt: new Date(), + updatedAt: new Date(), +}; +const CREATE_RESULT = { + id: "exampleId", + dirName: "exampleDirName", + createdAt: new Date(), + updatedAt: new Date(), +}; +const FIND_MANY_RESULT = [ + { + id: "exampleId", + dirName: "exampleDirName", + createdAt: new Date(), + updatedAt: new Date(), + }, +]; +const FIND_ONE_RESULT = { + id: "exampleId", + dirName: "exampleDirName", + createdAt: new Date(), + updatedAt: new Date(), +}; + +const service = { + createAppModel() { + return CREATE_RESULT; + }, + appModels: () => FIND_MANY_RESULT, + appModel: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("AppModel", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: AppModelService, + useValue: service, + }, + ], + controllers: [AppModelController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /appModels", async () => { + await request(app.getHttpServer()) + .post("/appModels") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + }); + }); + + test("GET /appModels", async () => { + await request(app.getHttpServer()) + .get("/appModels") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(), + }, + ]); + }); + + test("GET /appModels/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/appModels"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /appModels/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/appModels"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(), + }); + }); + + test("POST /appModels existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/appModels") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + }) + .then(function () { + agent + .post("/appModels") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/appModel/base/appModel.controller.base.ts b/apps/roi-cacl-2/src/appModel/base/appModel.controller.base.ts new file mode 100644 index 0000000..5a5b1c4 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/appModel.controller.base.ts @@ -0,0 +1,427 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { AppModelService } from "../appModel.service"; +import { AppModelCreateInput } from "./AppModelCreateInput"; +import { AppModel } from "./AppModel"; +import { AppModelFindManyArgs } from "./AppModelFindManyArgs"; +import { AppModelWhereUniqueInput } from "./AppModelWhereUniqueInput"; +import { AppModelUpdateInput } from "./AppModelUpdateInput"; +import { CredentialFindManyArgs } from "../../credential/base/CredentialFindManyArgs"; +import { Credential } from "../../credential/base/Credential"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; +import { WebhookFindManyArgs } from "../../webhook/base/WebhookFindManyArgs"; +import { Webhook } from "../../webhook/base/Webhook"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ApiKeyFindManyArgs } from "../../apiKey/base/ApiKeyFindManyArgs"; +import { ApiKey } from "../../apiKey/base/ApiKey"; +import { ApiKeyWhereUniqueInput } from "../../apiKey/base/ApiKeyWhereUniqueInput"; + +export class AppModelControllerBase { + constructor(protected readonly service: AppModelService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: AppModel }) + async createAppModel( + @common.Body() data: AppModelCreateInput + ): Promise<AppModel> { + return await this.service.createAppModel({ + data: data, + select: { + id: true, + dirName: true, + keys: true, + categories: true, + createdAt: true, + updatedAt: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [AppModel] }) + @ApiNestedQuery(AppModelFindManyArgs) + async appModels(@common.Req() request: Request): Promise<AppModel[]> { + const args = plainToClass(AppModelFindManyArgs, request.query); + return this.service.appModels({ + ...args, + select: { + id: true, + dirName: true, + keys: true, + categories: true, + createdAt: true, + updatedAt: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: AppModel }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async appModel( + @common.Param() params: AppModelWhereUniqueInput + ): Promise<AppModel | null> { + const result = await this.service.appModel({ + where: params, + select: { + id: true, + dirName: true, + keys: true, + categories: true, + createdAt: true, + updatedAt: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: AppModel }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateAppModel( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() data: AppModelUpdateInput + ): Promise<AppModel | null> { + try { + return await this.service.updateAppModel({ + where: params, + data: data, + select: { + id: true, + dirName: true, + keys: true, + categories: true, + createdAt: true, + updatedAt: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: AppModel }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteAppModel( + @common.Param() params: AppModelWhereUniqueInput + ): Promise<AppModel | null> { + try { + return await this.service.deleteAppModel({ + where: params, + select: { + id: true, + dirName: true, + keys: true, + categories: true, + createdAt: true, + updatedAt: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/credentials") + @ApiNestedQuery(CredentialFindManyArgs) + async findCredentials( + @common.Req() request: Request, + @common.Param() params: AppModelWhereUniqueInput + ): Promise<Credential[]> { + const query = plainToClass(CredentialFindManyArgs, request.query); + const results = await this.service.findCredentials(params.id, { + ...query, + select: { + id: true, + typeField: true, + key: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/credentials") + async connectCredentials( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: CredentialWhereUniqueInput[] + ): Promise<void> { + const data = { + credentials: { + connect: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/credentials") + async updateCredentials( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: CredentialWhereUniqueInput[] + ): Promise<void> { + const data = { + credentials: { + set: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/credentials") + async disconnectCredentials( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: CredentialWhereUniqueInput[] + ): Promise<void> { + const data = { + credentials: { + disconnect: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/webhook") + @ApiNestedQuery(WebhookFindManyArgs) + async findWebhook( + @common.Req() request: Request, + @common.Param() params: AppModelWhereUniqueInput + ): Promise<Webhook[]> { + const query = plainToClass(WebhookFindManyArgs, request.query); + const results = await this.service.findWebhook(params.id, { + ...query, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/webhook") + async connectWebhook( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhook: { + connect: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/webhook") + async updateWebhook( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhook: { + set: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/webhook") + async disconnectWebhook( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhook: { + disconnect: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/apiKey") + @ApiNestedQuery(ApiKeyFindManyArgs) + async findApiKey( + @common.Req() request: Request, + @common.Param() params: AppModelWhereUniqueInput + ): Promise<ApiKey[]> { + const query = plainToClass(ApiKeyFindManyArgs, request.query); + const results = await this.service.findApiKey(params.id, { + ...query, + select: { + id: true, + note: true, + createdAt: true, + expiresAt: true, + lastUsedAt: true, + hashedKey: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/apiKey") + async connectApiKey( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: ApiKeyWhereUniqueInput[] + ): Promise<void> { + const data = { + apiKey: { + connect: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/apiKey") + async updateApiKey( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: ApiKeyWhereUniqueInput[] + ): Promise<void> { + const data = { + apiKey: { + set: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/apiKey") + async disconnectApiKey( + @common.Param() params: AppModelWhereUniqueInput, + @common.Body() body: ApiKeyWhereUniqueInput[] + ): Promise<void> { + const data = { + apiKey: { + disconnect: body, + }, + }; + await this.service.updateAppModel({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/appModel/base/appModel.module.base.ts b/apps/roi-cacl-2/src/appModel/base/appModel.module.base.ts new file mode 100644 index 0000000..ce11dc5 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/appModel.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class AppModelModuleBase {} diff --git a/apps/roi-cacl-2/src/appModel/base/appModel.resolver.base.ts b/apps/roi-cacl-2/src/appModel/base/appModel.resolver.base.ts new file mode 100644 index 0000000..e0dc290 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/appModel.resolver.base.ts @@ -0,0 +1,147 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { AppModel } from "./AppModel"; +import { AppModelCountArgs } from "./AppModelCountArgs"; +import { AppModelFindManyArgs } from "./AppModelFindManyArgs"; +import { AppModelFindUniqueArgs } from "./AppModelFindUniqueArgs"; +import { CreateAppModelArgs } from "./CreateAppModelArgs"; +import { UpdateAppModelArgs } from "./UpdateAppModelArgs"; +import { DeleteAppModelArgs } from "./DeleteAppModelArgs"; +import { CredentialFindManyArgs } from "../../credential/base/CredentialFindManyArgs"; +import { Credential } from "../../credential/base/Credential"; +import { WebhookFindManyArgs } from "../../webhook/base/WebhookFindManyArgs"; +import { Webhook } from "../../webhook/base/Webhook"; +import { ApiKeyFindManyArgs } from "../../apiKey/base/ApiKeyFindManyArgs"; +import { ApiKey } from "../../apiKey/base/ApiKey"; +import { AppModelService } from "../appModel.service"; +@graphql.Resolver(() => AppModel) +export class AppModelResolverBase { + constructor(protected readonly service: AppModelService) {} + + async _appModelsMeta( + @graphql.Args() args: AppModelCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [AppModel]) + async appModels( + @graphql.Args() args: AppModelFindManyArgs + ): Promise<AppModel[]> { + return this.service.appModels(args); + } + + @graphql.Query(() => AppModel, { nullable: true }) + async appModel( + @graphql.Args() args: AppModelFindUniqueArgs + ): Promise<AppModel | null> { + const result = await this.service.appModel(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => AppModel) + async createAppModel( + @graphql.Args() args: CreateAppModelArgs + ): Promise<AppModel> { + return await this.service.createAppModel({ + ...args, + data: args.data, + }); + } + + @graphql.Mutation(() => AppModel) + async updateAppModel( + @graphql.Args() args: UpdateAppModelArgs + ): Promise<AppModel | null> { + try { + return await this.service.updateAppModel({ + ...args, + data: args.data, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => AppModel) + async deleteAppModel( + @graphql.Args() args: DeleteAppModelArgs + ): Promise<AppModel | null> { + try { + return await this.service.deleteAppModel(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [Credential], { name: "credentials" }) + async findCredentials( + @graphql.Parent() parent: AppModel, + @graphql.Args() args: CredentialFindManyArgs + ): Promise<Credential[]> { + const results = await this.service.findCredentials(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Webhook], { name: "webhook" }) + async findWebhook( + @graphql.Parent() parent: AppModel, + @graphql.Args() args: WebhookFindManyArgs + ): Promise<Webhook[]> { + const results = await this.service.findWebhook(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [ApiKey], { name: "apiKey" }) + async findApiKey( + @graphql.Parent() parent: AppModel, + @graphql.Args() args: ApiKeyFindManyArgs + ): Promise<ApiKey[]> { + const results = await this.service.findApiKey(parent.id, args); + + if (!results) { + return []; + } + + return results; + } +} diff --git a/apps/roi-cacl-2/src/appModel/base/appModel.service.base.ts b/apps/roi-cacl-2/src/appModel/base/appModel.service.base.ts new file mode 100644 index 0000000..74b4813 --- /dev/null +++ b/apps/roi-cacl-2/src/appModel/base/appModel.service.base.ts @@ -0,0 +1,87 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + AppModel as PrismaAppModel, + Credential as PrismaCredential, + Webhook as PrismaWebhook, + ApiKey as PrismaApiKey, +} from "@prisma/client"; + +export class AppModelServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.AppModelCountArgs, "select">): Promise<number> { + return this.prisma.appModel.count(args); + } + + async appModels<T extends Prisma.AppModelFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.AppModelFindManyArgs> + ): Promise<PrismaAppModel[]> { + return this.prisma.appModel.findMany<Prisma.AppModelFindManyArgs>(args); + } + async appModel<T extends Prisma.AppModelFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.AppModelFindUniqueArgs> + ): Promise<PrismaAppModel | null> { + return this.prisma.appModel.findUnique(args); + } + async createAppModel<T extends Prisma.AppModelCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.AppModelCreateArgs> + ): Promise<PrismaAppModel> { + return this.prisma.appModel.create<T>(args); + } + async updateAppModel<T extends Prisma.AppModelUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.AppModelUpdateArgs> + ): Promise<PrismaAppModel> { + return this.prisma.appModel.update<T>(args); + } + async deleteAppModel<T extends Prisma.AppModelDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.AppModelDeleteArgs> + ): Promise<PrismaAppModel> { + return this.prisma.appModel.delete(args); + } + + async findCredentials( + parentId: string, + args: Prisma.CredentialFindManyArgs + ): Promise<PrismaCredential[]> { + return this.prisma.appModel + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .credentials(args); + } + + async findWebhook( + parentId: string, + args: Prisma.WebhookFindManyArgs + ): Promise<PrismaWebhook[]> { + return this.prisma.appModel + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .webhook(args); + } + + async findApiKey( + parentId: string, + args: Prisma.ApiKeyFindManyArgs + ): Promise<PrismaApiKey[]> { + return this.prisma.appModel + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .apiKey(args); + } +} diff --git a/apps/roi-cacl-2/src/attendee/attendee.controller.ts b/apps/roi-cacl-2/src/attendee/attendee.controller.ts new file mode 100644 index 0000000..3a99c1a --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/attendee.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { AttendeeService } from "./attendee.service"; +import { AttendeeControllerBase } from "./base/attendee.controller.base"; + +@swagger.ApiTags("attendees") +@common.Controller("attendees") +export class AttendeeController extends AttendeeControllerBase { + constructor(protected readonly service: AttendeeService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/attendee/attendee.module.ts b/apps/roi-cacl-2/src/attendee/attendee.module.ts new file mode 100644 index 0000000..e74a5c6 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/attendee.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { AttendeeModuleBase } from "./base/attendee.module.base"; +import { AttendeeService } from "./attendee.service"; +import { AttendeeController } from "./attendee.controller"; +import { AttendeeResolver } from "./attendee.resolver"; + +@Module({ + imports: [AttendeeModuleBase], + controllers: [AttendeeController], + providers: [AttendeeService, AttendeeResolver], + exports: [AttendeeService], +}) +export class AttendeeModule {} diff --git a/apps/roi-cacl-2/src/attendee/attendee.resolver.ts b/apps/roi-cacl-2/src/attendee/attendee.resolver.ts new file mode 100644 index 0000000..43ecdac --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/attendee.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { AttendeeResolverBase } from "./base/attendee.resolver.base"; +import { Attendee } from "./base/Attendee"; +import { AttendeeService } from "./attendee.service"; + +@graphql.Resolver(() => Attendee) +export class AttendeeResolver extends AttendeeResolverBase { + constructor(protected readonly service: AttendeeService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/attendee/attendee.service.ts b/apps/roi-cacl-2/src/attendee/attendee.service.ts new file mode 100644 index 0000000..7f32510 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/attendee.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { AttendeeServiceBase } from "./base/attendee.service.base"; + +@Injectable() +export class AttendeeService extends AttendeeServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/attendee/base/Attendee.ts b/apps/roi-cacl-2/src/attendee/base/Attendee.ts new file mode 100644 index 0000000..95c895c --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/Attendee.ts @@ -0,0 +1,73 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsString, IsOptional, ValidateNested } from "class-validator"; +import { Booking } from "../../booking/base/Booking"; +import { Type } from "class-transformer"; + +@ObjectType() +class Attendee { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + email!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + name!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + timeZone!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + locale!: string | null; + + @ApiProperty({ + required: false, + type: () => Booking, + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + booking?: Booking | null; +} + +export { Attendee as Attendee }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeCountArgs.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeCountArgs.ts new file mode 100644 index 0000000..4b94111 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AttendeeWhereInput } from "./AttendeeWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class AttendeeCountArgs { + @ApiProperty({ + required: false, + type: () => AttendeeWhereInput, + }) + @Field(() => AttendeeWhereInput, { nullable: true }) + @Type(() => AttendeeWhereInput) + where?: AttendeeWhereInput; +} + +export { AttendeeCountArgs as AttendeeCountArgs }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeCreateInput.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeCreateInput.ts new file mode 100644 index 0000000..2f33c73 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeCreateInput.ts @@ -0,0 +1,68 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, ValidateNested } from "class-validator"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class AttendeeCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + email!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + name!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + timeZone!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + locale?: string | null; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; +} + +export { AttendeeCreateInput as AttendeeCreateInput }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeFindManyArgs.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeFindManyArgs.ts new file mode 100644 index 0000000..07b18a8 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AttendeeWhereInput } from "./AttendeeWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { AttendeeOrderByInput } from "./AttendeeOrderByInput"; + +@ArgsType() +class AttendeeFindManyArgs { + @ApiProperty({ + required: false, + type: () => AttendeeWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => AttendeeWhereInput, { nullable: true }) + @Type(() => AttendeeWhereInput) + where?: AttendeeWhereInput; + + @ApiProperty({ + required: false, + type: [AttendeeOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [AttendeeOrderByInput], { nullable: true }) + @Type(() => AttendeeOrderByInput) + orderBy?: Array<AttendeeOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { AttendeeFindManyArgs as AttendeeFindManyArgs }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeFindUniqueArgs.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeFindUniqueArgs.ts new file mode 100644 index 0000000..476aabd --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AttendeeWhereUniqueInput } from "./AttendeeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class AttendeeFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => AttendeeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AttendeeWhereUniqueInput) + @Field(() => AttendeeWhereUniqueInput, { nullable: false }) + where!: AttendeeWhereUniqueInput; +} + +export { AttendeeFindUniqueArgs as AttendeeFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeListRelationFilter.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeListRelationFilter.ts new file mode 100644 index 0000000..e3ad7a0 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AttendeeWhereInput } from "./AttendeeWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class AttendeeListRelationFilter { + @ApiProperty({ + required: false, + type: () => AttendeeWhereInput, + }) + @ValidateNested() + @Type(() => AttendeeWhereInput) + @IsOptional() + @Field(() => AttendeeWhereInput, { + nullable: true, + }) + every?: AttendeeWhereInput; + + @ApiProperty({ + required: false, + type: () => AttendeeWhereInput, + }) + @ValidateNested() + @Type(() => AttendeeWhereInput) + @IsOptional() + @Field(() => AttendeeWhereInput, { + nullable: true, + }) + some?: AttendeeWhereInput; + + @ApiProperty({ + required: false, + type: () => AttendeeWhereInput, + }) + @ValidateNested() + @Type(() => AttendeeWhereInput) + @IsOptional() + @Field(() => AttendeeWhereInput, { + nullable: true, + }) + none?: AttendeeWhereInput; +} +export { AttendeeListRelationFilter as AttendeeListRelationFilter }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeOrderByInput.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeOrderByInput.ts new file mode 100644 index 0000000..14c6ba5 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeOrderByInput.ts @@ -0,0 +1,89 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class AttendeeOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + email?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + name?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + timeZone?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + locale?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bookingId?: SortOrder; +} + +export { AttendeeOrderByInput as AttendeeOrderByInput }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeUpdateInput.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeUpdateInput.ts new file mode 100644 index 0000000..74f4ee9 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeUpdateInput.ts @@ -0,0 +1,77 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, ValidateNested } from "class-validator"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class AttendeeUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + email?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + locale?: string | null; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; +} + +export { AttendeeUpdateInput as AttendeeUpdateInput }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeWhereInput.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeWhereInput.ts new file mode 100644 index 0000000..9075483 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeWhereInput.ts @@ -0,0 +1,91 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; + +@InputType() +class AttendeeWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + email?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + name?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + timeZone?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + locale?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput; +} + +export { AttendeeWhereInput as AttendeeWhereInput }; diff --git a/apps/roi-cacl-2/src/attendee/base/AttendeeWhereUniqueInput.ts b/apps/roi-cacl-2/src/attendee/base/AttendeeWhereUniqueInput.ts new file mode 100644 index 0000000..15f7bf4 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/AttendeeWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class AttendeeWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { AttendeeWhereUniqueInput as AttendeeWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/attendee/base/CreateAttendeeArgs.ts b/apps/roi-cacl-2/src/attendee/base/CreateAttendeeArgs.ts new file mode 100644 index 0000000..9faba5f --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/CreateAttendeeArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AttendeeCreateInput } from "./AttendeeCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateAttendeeArgs { + @ApiProperty({ + required: true, + type: () => AttendeeCreateInput, + }) + @ValidateNested() + @Type(() => AttendeeCreateInput) + @Field(() => AttendeeCreateInput, { nullable: false }) + data!: AttendeeCreateInput; +} + +export { CreateAttendeeArgs as CreateAttendeeArgs }; diff --git a/apps/roi-cacl-2/src/attendee/base/DeleteAttendeeArgs.ts b/apps/roi-cacl-2/src/attendee/base/DeleteAttendeeArgs.ts new file mode 100644 index 0000000..8081a21 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/DeleteAttendeeArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AttendeeWhereUniqueInput } from "./AttendeeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteAttendeeArgs { + @ApiProperty({ + required: true, + type: () => AttendeeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AttendeeWhereUniqueInput) + @Field(() => AttendeeWhereUniqueInput, { nullable: false }) + where!: AttendeeWhereUniqueInput; +} + +export { DeleteAttendeeArgs as DeleteAttendeeArgs }; diff --git a/apps/roi-cacl-2/src/attendee/base/UpdateAttendeeArgs.ts b/apps/roi-cacl-2/src/attendee/base/UpdateAttendeeArgs.ts new file mode 100644 index 0000000..ae7869b --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/UpdateAttendeeArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AttendeeWhereUniqueInput } from "./AttendeeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { AttendeeUpdateInput } from "./AttendeeUpdateInput"; + +@ArgsType() +class UpdateAttendeeArgs { + @ApiProperty({ + required: true, + type: () => AttendeeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AttendeeWhereUniqueInput) + @Field(() => AttendeeWhereUniqueInput, { nullable: false }) + where!: AttendeeWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => AttendeeUpdateInput, + }) + @ValidateNested() + @Type(() => AttendeeUpdateInput) + @Field(() => AttendeeUpdateInput, { nullable: false }) + data!: AttendeeUpdateInput; +} + +export { UpdateAttendeeArgs as UpdateAttendeeArgs }; diff --git a/apps/roi-cacl-2/src/attendee/base/attendee.controller.base.spec.ts b/apps/roi-cacl-2/src/attendee/base/attendee.controller.base.spec.ts new file mode 100644 index 0000000..be3d9db --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/attendee.controller.base.spec.ts @@ -0,0 +1,180 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { AttendeeController } from "../attendee.controller"; +import { AttendeeService } from "../attendee.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + email: "exampleEmail", + name: "exampleName", + timeZone: "exampleTimeZone", + locale: "exampleLocale", +}; +const CREATE_RESULT = { + id: 42, + email: "exampleEmail", + name: "exampleName", + timeZone: "exampleTimeZone", + locale: "exampleLocale", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + email: "exampleEmail", + name: "exampleName", + timeZone: "exampleTimeZone", + locale: "exampleLocale", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + email: "exampleEmail", + name: "exampleName", + timeZone: "exampleTimeZone", + locale: "exampleLocale", +}; + +const service = { + createAttendee() { + return CREATE_RESULT; + }, + attendees: () => FIND_MANY_RESULT, + attendee: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Attendee", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: AttendeeService, + useValue: service, + }, + ], + controllers: [AttendeeController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /attendees", async () => { + await request(app.getHttpServer()) + .post("/attendees") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /attendees", async () => { + await request(app.getHttpServer()) + .get("/attendees") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /attendees/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/attendees"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /attendees/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/attendees"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /attendees existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/attendees") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/attendees") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/attendee/base/attendee.controller.base.ts b/apps/roi-cacl-2/src/attendee/base/attendee.controller.base.ts new file mode 100644 index 0000000..aa6ad85 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/attendee.controller.base.ts @@ -0,0 +1,187 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { AttendeeService } from "../attendee.service"; +import { AttendeeCreateInput } from "./AttendeeCreateInput"; +import { Attendee } from "./Attendee"; +import { AttendeeFindManyArgs } from "./AttendeeFindManyArgs"; +import { AttendeeWhereUniqueInput } from "./AttendeeWhereUniqueInput"; +import { AttendeeUpdateInput } from "./AttendeeUpdateInput"; + +export class AttendeeControllerBase { + constructor(protected readonly service: AttendeeService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Attendee }) + async createAttendee( + @common.Body() data: AttendeeCreateInput + ): Promise<Attendee> { + return await this.service.createAttendee({ + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + email: true, + name: true, + timeZone: true, + locale: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Attendee] }) + @ApiNestedQuery(AttendeeFindManyArgs) + async attendees(@common.Req() request: Request): Promise<Attendee[]> { + const args = plainToClass(AttendeeFindManyArgs, request.query); + return this.service.attendees({ + ...args, + select: { + id: true, + email: true, + name: true, + timeZone: true, + locale: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Attendee }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async attendee( + @common.Param() params: AttendeeWhereUniqueInput + ): Promise<Attendee | null> { + const result = await this.service.attendee({ + where: params, + select: { + id: true, + email: true, + name: true, + timeZone: true, + locale: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Attendee }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateAttendee( + @common.Param() params: AttendeeWhereUniqueInput, + @common.Body() data: AttendeeUpdateInput + ): Promise<Attendee | null> { + try { + return await this.service.updateAttendee({ + where: params, + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + email: true, + name: true, + timeZone: true, + locale: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Attendee }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteAttendee( + @common.Param() params: AttendeeWhereUniqueInput + ): Promise<Attendee | null> { + try { + return await this.service.deleteAttendee({ + where: params, + select: { + id: true, + email: true, + name: true, + timeZone: true, + locale: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/attendee/base/attendee.module.base.ts b/apps/roi-cacl-2/src/attendee/base/attendee.module.base.ts new file mode 100644 index 0000000..3000fd5 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/attendee.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class AttendeeModuleBase {} diff --git a/apps/roi-cacl-2/src/attendee/base/attendee.resolver.base.ts b/apps/roi-cacl-2/src/attendee/base/attendee.resolver.base.ts new file mode 100644 index 0000000..9d6977d --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/attendee.resolver.base.ts @@ -0,0 +1,131 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Attendee } from "./Attendee"; +import { AttendeeCountArgs } from "./AttendeeCountArgs"; +import { AttendeeFindManyArgs } from "./AttendeeFindManyArgs"; +import { AttendeeFindUniqueArgs } from "./AttendeeFindUniqueArgs"; +import { CreateAttendeeArgs } from "./CreateAttendeeArgs"; +import { UpdateAttendeeArgs } from "./UpdateAttendeeArgs"; +import { DeleteAttendeeArgs } from "./DeleteAttendeeArgs"; +import { Booking } from "../../booking/base/Booking"; +import { AttendeeService } from "../attendee.service"; +@graphql.Resolver(() => Attendee) +export class AttendeeResolverBase { + constructor(protected readonly service: AttendeeService) {} + + async _attendeesMeta( + @graphql.Args() args: AttendeeCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Attendee]) + async attendees( + @graphql.Args() args: AttendeeFindManyArgs + ): Promise<Attendee[]> { + return this.service.attendees(args); + } + + @graphql.Query(() => Attendee, { nullable: true }) + async attendee( + @graphql.Args() args: AttendeeFindUniqueArgs + ): Promise<Attendee | null> { + const result = await this.service.attendee(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Attendee) + async createAttendee( + @graphql.Args() args: CreateAttendeeArgs + ): Promise<Attendee> { + return await this.service.createAttendee({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Attendee) + async updateAttendee( + @graphql.Args() args: UpdateAttendeeArgs + ): Promise<Attendee | null> { + try { + return await this.service.updateAttendee({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Attendee) + async deleteAttendee( + @graphql.Args() args: DeleteAttendeeArgs + ): Promise<Attendee | null> { + try { + return await this.service.deleteAttendee(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => Booking, { + nullable: true, + name: "booking", + }) + async getBooking( + @graphql.Parent() parent: Attendee + ): Promise<Booking | null> { + const result = await this.service.getBooking(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/attendee/base/attendee.service.base.ts b/apps/roi-cacl-2/src/attendee/base/attendee.service.base.ts new file mode 100644 index 0000000..9d7d144 --- /dev/null +++ b/apps/roi-cacl-2/src/attendee/base/attendee.service.base.ts @@ -0,0 +1,59 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + Attendee as PrismaAttendee, + Booking as PrismaBooking, +} from "@prisma/client"; + +export class AttendeeServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.AttendeeCountArgs, "select">): Promise<number> { + return this.prisma.attendee.count(args); + } + + async attendees<T extends Prisma.AttendeeFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.AttendeeFindManyArgs> + ): Promise<PrismaAttendee[]> { + return this.prisma.attendee.findMany<Prisma.AttendeeFindManyArgs>(args); + } + async attendee<T extends Prisma.AttendeeFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.AttendeeFindUniqueArgs> + ): Promise<PrismaAttendee | null> { + return this.prisma.attendee.findUnique(args); + } + async createAttendee<T extends Prisma.AttendeeCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.AttendeeCreateArgs> + ): Promise<PrismaAttendee> { + return this.prisma.attendee.create<T>(args); + } + async updateAttendee<T extends Prisma.AttendeeUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.AttendeeUpdateArgs> + ): Promise<PrismaAttendee> { + return this.prisma.attendee.update<T>(args); + } + async deleteAttendee<T extends Prisma.AttendeeDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.AttendeeDeleteArgs> + ): Promise<PrismaAttendee> { + return this.prisma.attendee.delete(args); + } + + async getBooking(parentId: number): Promise<PrismaBooking | null> { + return this.prisma.attendee + .findUnique({ + where: { id: parentId }, + }) + .booking(); + } +} diff --git a/apps/roi-cacl-2/src/availability/availability.controller.ts b/apps/roi-cacl-2/src/availability/availability.controller.ts new file mode 100644 index 0000000..a7efd5f --- /dev/null +++ b/apps/roi-cacl-2/src/availability/availability.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { AvailabilityService } from "./availability.service"; +import { AvailabilityControllerBase } from "./base/availability.controller.base"; + +@swagger.ApiTags("availabilities") +@common.Controller("availabilities") +export class AvailabilityController extends AvailabilityControllerBase { + constructor(protected readonly service: AvailabilityService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/availability/availability.module.ts b/apps/roi-cacl-2/src/availability/availability.module.ts new file mode 100644 index 0000000..c21340d --- /dev/null +++ b/apps/roi-cacl-2/src/availability/availability.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { AvailabilityModuleBase } from "./base/availability.module.base"; +import { AvailabilityService } from "./availability.service"; +import { AvailabilityController } from "./availability.controller"; +import { AvailabilityResolver } from "./availability.resolver"; + +@Module({ + imports: [AvailabilityModuleBase], + controllers: [AvailabilityController], + providers: [AvailabilityService, AvailabilityResolver], + exports: [AvailabilityService], +}) +export class AvailabilityModule {} diff --git a/apps/roi-cacl-2/src/availability/availability.resolver.ts b/apps/roi-cacl-2/src/availability/availability.resolver.ts new file mode 100644 index 0000000..3d4a089 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/availability.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { AvailabilityResolverBase } from "./base/availability.resolver.base"; +import { Availability } from "./base/Availability"; +import { AvailabilityService } from "./availability.service"; + +@graphql.Resolver(() => Availability) +export class AvailabilityResolver extends AvailabilityResolverBase { + constructor(protected readonly service: AvailabilityService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/availability/availability.service.ts b/apps/roi-cacl-2/src/availability/availability.service.ts new file mode 100644 index 0000000..a761900 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/availability.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { AvailabilityServiceBase } from "./base/availability.service.base"; + +@Injectable() +export class AvailabilityService extends AvailabilityServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/availability/base/Availability.ts b/apps/roi-cacl-2/src/availability/base/Availability.ts new file mode 100644 index 0000000..dc5b907 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/Availability.ts @@ -0,0 +1,93 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, ValidateNested, IsOptional, IsDate } from "class-validator"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; +import { EventType } from "../../eventType/base/EventType"; +import { Schedule } from "../../schedule/base/Schedule"; + +@ObjectType() +class Availability { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; + + @ApiProperty({ + required: false, + type: () => EventType, + }) + @ValidateNested() + @Type(() => EventType) + @IsOptional() + eventType?: EventType | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + days!: number; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + startTime!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + endTime!: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + date!: Date | null; + + @ApiProperty({ + required: false, + type: () => Schedule, + }) + @ValidateNested() + @Type(() => Schedule) + @IsOptional() + schedule?: Schedule | null; +} + +export { Availability as Availability }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityCountArgs.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityCountArgs.ts new file mode 100644 index 0000000..820fa52 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AvailabilityWhereInput } from "./AvailabilityWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class AvailabilityCountArgs { + @ApiProperty({ + required: false, + type: () => AvailabilityWhereInput, + }) + @Field(() => AvailabilityWhereInput, { nullable: true }) + @Type(() => AvailabilityWhereInput) + where?: AvailabilityWhereInput; +} + +export { AvailabilityCountArgs as AvailabilityCountArgs }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityCreateInput.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityCreateInput.ts new file mode 100644 index 0000000..95ed75a --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityCreateInput.ts @@ -0,0 +1,94 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested, IsOptional, IsInt, IsDate } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; + +@InputType() +class AvailabilityCreateInput { + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + days!: number; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + startTime!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + endTime!: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + date?: Date | null; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @IsOptional() + @Field(() => ScheduleWhereUniqueInput, { + nullable: true, + }) + schedule?: ScheduleWhereUniqueInput | null; +} + +export { AvailabilityCreateInput as AvailabilityCreateInput }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityFindManyArgs.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityFindManyArgs.ts new file mode 100644 index 0000000..7b15c56 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AvailabilityWhereInput } from "./AvailabilityWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { AvailabilityOrderByInput } from "./AvailabilityOrderByInput"; + +@ArgsType() +class AvailabilityFindManyArgs { + @ApiProperty({ + required: false, + type: () => AvailabilityWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => AvailabilityWhereInput, { nullable: true }) + @Type(() => AvailabilityWhereInput) + where?: AvailabilityWhereInput; + + @ApiProperty({ + required: false, + type: [AvailabilityOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [AvailabilityOrderByInput], { nullable: true }) + @Type(() => AvailabilityOrderByInput) + orderBy?: Array<AvailabilityOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { AvailabilityFindManyArgs as AvailabilityFindManyArgs }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityFindUniqueArgs.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityFindUniqueArgs.ts new file mode 100644 index 0000000..40dd0da --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AvailabilityWhereUniqueInput } from "./AvailabilityWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class AvailabilityFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => AvailabilityWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AvailabilityWhereUniqueInput) + @Field(() => AvailabilityWhereUniqueInput, { nullable: false }) + where!: AvailabilityWhereUniqueInput; +} + +export { AvailabilityFindUniqueArgs as AvailabilityFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityListRelationFilter.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityListRelationFilter.ts new file mode 100644 index 0000000..2611097 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AvailabilityWhereInput } from "./AvailabilityWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class AvailabilityListRelationFilter { + @ApiProperty({ + required: false, + type: () => AvailabilityWhereInput, + }) + @ValidateNested() + @Type(() => AvailabilityWhereInput) + @IsOptional() + @Field(() => AvailabilityWhereInput, { + nullable: true, + }) + every?: AvailabilityWhereInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityWhereInput, + }) + @ValidateNested() + @Type(() => AvailabilityWhereInput) + @IsOptional() + @Field(() => AvailabilityWhereInput, { + nullable: true, + }) + some?: AvailabilityWhereInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityWhereInput, + }) + @ValidateNested() + @Type(() => AvailabilityWhereInput) + @IsOptional() + @Field(() => AvailabilityWhereInput, { + nullable: true, + }) + none?: AvailabilityWhereInput; +} +export { AvailabilityListRelationFilter as AvailabilityListRelationFilter }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityOrderByInput.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityOrderByInput.ts new file mode 100644 index 0000000..2eacf96 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityOrderByInput.ts @@ -0,0 +1,111 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class AvailabilityOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTypeId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + days?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + startTime?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + endTime?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + date?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + scheduleId?: SortOrder; +} + +export { AvailabilityOrderByInput as AvailabilityOrderByInput }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityUpdateInput.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityUpdateInput.ts new file mode 100644 index 0000000..4f93440 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityUpdateInput.ts @@ -0,0 +1,103 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested, IsOptional, IsInt, IsDate } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; + +@InputType() +class AvailabilityUpdateInput { + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + days?: number; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + startTime?: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + endTime?: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + date?: Date | null; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @IsOptional() + @Field(() => ScheduleWhereUniqueInput, { + nullable: true, + }) + schedule?: ScheduleWhereUniqueInput | null; +} + +export { AvailabilityUpdateInput as AvailabilityUpdateInput }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityWhereInput.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityWhereInput.ts new file mode 100644 index 0000000..305cb21 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityWhereInput.ts @@ -0,0 +1,117 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; + +@InputType() +class AvailabilityWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + days?: IntFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + startTime?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + endTime?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + date?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @IsOptional() + @Field(() => ScheduleWhereUniqueInput, { + nullable: true, + }) + schedule?: ScheduleWhereUniqueInput; +} + +export { AvailabilityWhereInput as AvailabilityWhereInput }; diff --git a/apps/roi-cacl-2/src/availability/base/AvailabilityWhereUniqueInput.ts b/apps/roi-cacl-2/src/availability/base/AvailabilityWhereUniqueInput.ts new file mode 100644 index 0000000..9534750 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/AvailabilityWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class AvailabilityWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { AvailabilityWhereUniqueInput as AvailabilityWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/availability/base/CreateAvailabilityArgs.ts b/apps/roi-cacl-2/src/availability/base/CreateAvailabilityArgs.ts new file mode 100644 index 0000000..6cc1dbc --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/CreateAvailabilityArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AvailabilityCreateInput } from "./AvailabilityCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateAvailabilityArgs { + @ApiProperty({ + required: true, + type: () => AvailabilityCreateInput, + }) + @ValidateNested() + @Type(() => AvailabilityCreateInput) + @Field(() => AvailabilityCreateInput, { nullable: false }) + data!: AvailabilityCreateInput; +} + +export { CreateAvailabilityArgs as CreateAvailabilityArgs }; diff --git a/apps/roi-cacl-2/src/availability/base/DeleteAvailabilityArgs.ts b/apps/roi-cacl-2/src/availability/base/DeleteAvailabilityArgs.ts new file mode 100644 index 0000000..ff2dc20 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/DeleteAvailabilityArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AvailabilityWhereUniqueInput } from "./AvailabilityWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteAvailabilityArgs { + @ApiProperty({ + required: true, + type: () => AvailabilityWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AvailabilityWhereUniqueInput) + @Field(() => AvailabilityWhereUniqueInput, { nullable: false }) + where!: AvailabilityWhereUniqueInput; +} + +export { DeleteAvailabilityArgs as DeleteAvailabilityArgs }; diff --git a/apps/roi-cacl-2/src/availability/base/UpdateAvailabilityArgs.ts b/apps/roi-cacl-2/src/availability/base/UpdateAvailabilityArgs.ts new file mode 100644 index 0000000..a286dbb --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/UpdateAvailabilityArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { AvailabilityWhereUniqueInput } from "./AvailabilityWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { AvailabilityUpdateInput } from "./AvailabilityUpdateInput"; + +@ArgsType() +class UpdateAvailabilityArgs { + @ApiProperty({ + required: true, + type: () => AvailabilityWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AvailabilityWhereUniqueInput) + @Field(() => AvailabilityWhereUniqueInput, { nullable: false }) + where!: AvailabilityWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => AvailabilityUpdateInput, + }) + @ValidateNested() + @Type(() => AvailabilityUpdateInput) + @Field(() => AvailabilityUpdateInput, { nullable: false }) + data!: AvailabilityUpdateInput; +} + +export { UpdateAvailabilityArgs as UpdateAvailabilityArgs }; diff --git a/apps/roi-cacl-2/src/availability/base/availability.controller.base.spec.ts b/apps/roi-cacl-2/src/availability/base/availability.controller.base.spec.ts new file mode 100644 index 0000000..4a52727 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/availability.controller.base.spec.ts @@ -0,0 +1,202 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { AvailabilityController } from "../availability.controller"; +import { AvailabilityService } from "../availability.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + days: 42, + startTime: new Date(), + endTime: new Date(), + date: new Date(), +}; +const CREATE_RESULT = { + id: 42, + days: 42, + startTime: new Date(), + endTime: new Date(), + date: new Date(), +}; +const FIND_MANY_RESULT = [ + { + id: 42, + days: 42, + startTime: new Date(), + endTime: new Date(), + date: new Date(), + }, +]; +const FIND_ONE_RESULT = { + id: 42, + days: 42, + startTime: new Date(), + endTime: new Date(), + date: new Date(), +}; + +const service = { + createAvailability() { + return CREATE_RESULT; + }, + availabilities: () => FIND_MANY_RESULT, + availability: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Availability", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: AvailabilityService, + useValue: service, + }, + ], + controllers: [AvailabilityController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /availabilities", async () => { + await request(app.getHttpServer()) + .post("/availabilities") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + startTime: CREATE_RESULT.startTime.toISOString(), + endTime: CREATE_RESULT.endTime.toISOString(), + date: CREATE_RESULT.date.toISOString(), + }); + }); + + test("GET /availabilities", async () => { + await request(app.getHttpServer()) + .get("/availabilities") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + startTime: FIND_MANY_RESULT[0].startTime.toISOString(), + endTime: FIND_MANY_RESULT[0].endTime.toISOString(), + date: FIND_MANY_RESULT[0].date.toISOString(), + }, + ]); + }); + + test("GET /availabilities/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/availabilities"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /availabilities/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/availabilities"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + startTime: FIND_ONE_RESULT.startTime.toISOString(), + endTime: FIND_ONE_RESULT.endTime.toISOString(), + date: FIND_ONE_RESULT.date.toISOString(), + }); + }); + + test("POST /availabilities existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/availabilities") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + startTime: CREATE_RESULT.startTime.toISOString(), + endTime: CREATE_RESULT.endTime.toISOString(), + date: CREATE_RESULT.date.toISOString(), + }) + .then(function () { + agent + .post("/availabilities") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/availability/base/availability.controller.base.ts b/apps/roi-cacl-2/src/availability/base/availability.controller.base.ts new file mode 100644 index 0000000..7b572ce --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/availability.controller.base.ts @@ -0,0 +1,278 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { AvailabilityService } from "../availability.service"; +import { AvailabilityCreateInput } from "./AvailabilityCreateInput"; +import { Availability } from "./Availability"; +import { AvailabilityFindManyArgs } from "./AvailabilityFindManyArgs"; +import { AvailabilityWhereUniqueInput } from "./AvailabilityWhereUniqueInput"; +import { AvailabilityUpdateInput } from "./AvailabilityUpdateInput"; + +export class AvailabilityControllerBase { + constructor(protected readonly service: AvailabilityService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Availability }) + async createAvailability( + @common.Body() data: AvailabilityCreateInput + ): Promise<Availability> { + return await this.service.createAvailability({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + schedule: data.schedule + ? { + connect: data.schedule, + } + : undefined, + }, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Availability] }) + @ApiNestedQuery(AvailabilityFindManyArgs) + async availabilities( + @common.Req() request: Request + ): Promise<Availability[]> { + const args = plainToClass(AvailabilityFindManyArgs, request.query); + return this.service.availabilities({ + ...args, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Availability }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async availability( + @common.Param() params: AvailabilityWhereUniqueInput + ): Promise<Availability | null> { + const result = await this.service.availability({ + where: params, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Availability }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateAvailability( + @common.Param() params: AvailabilityWhereUniqueInput, + @common.Body() data: AvailabilityUpdateInput + ): Promise<Availability | null> { + try { + return await this.service.updateAvailability({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + schedule: data.schedule + ? { + connect: data.schedule, + } + : undefined, + }, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Availability }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteAvailability( + @common.Param() params: AvailabilityWhereUniqueInput + ): Promise<Availability | null> { + try { + return await this.service.deleteAvailability({ + where: params, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/availability/base/availability.module.base.ts b/apps/roi-cacl-2/src/availability/base/availability.module.base.ts new file mode 100644 index 0000000..31f1d1b --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/availability.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class AvailabilityModuleBase {} diff --git a/apps/roi-cacl-2/src/availability/base/availability.resolver.base.ts b/apps/roi-cacl-2/src/availability/base/availability.resolver.base.ts new file mode 100644 index 0000000..5c4ed4c --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/availability.resolver.base.ts @@ -0,0 +1,185 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Availability } from "./Availability"; +import { AvailabilityCountArgs } from "./AvailabilityCountArgs"; +import { AvailabilityFindManyArgs } from "./AvailabilityFindManyArgs"; +import { AvailabilityFindUniqueArgs } from "./AvailabilityFindUniqueArgs"; +import { CreateAvailabilityArgs } from "./CreateAvailabilityArgs"; +import { UpdateAvailabilityArgs } from "./UpdateAvailabilityArgs"; +import { DeleteAvailabilityArgs } from "./DeleteAvailabilityArgs"; +import { User } from "../../user/base/User"; +import { EventType } from "../../eventType/base/EventType"; +import { Schedule } from "../../schedule/base/Schedule"; +import { AvailabilityService } from "../availability.service"; +@graphql.Resolver(() => Availability) +export class AvailabilityResolverBase { + constructor(protected readonly service: AvailabilityService) {} + + async _availabilitiesMeta( + @graphql.Args() args: AvailabilityCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Availability]) + async availabilities( + @graphql.Args() args: AvailabilityFindManyArgs + ): Promise<Availability[]> { + return this.service.availabilities(args); + } + + @graphql.Query(() => Availability, { nullable: true }) + async availability( + @graphql.Args() args: AvailabilityFindUniqueArgs + ): Promise<Availability | null> { + const result = await this.service.availability(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Availability) + async createAvailability( + @graphql.Args() args: CreateAvailabilityArgs + ): Promise<Availability> { + return await this.service.createAvailability({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + schedule: args.data.schedule + ? { + connect: args.data.schedule, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Availability) + async updateAvailability( + @graphql.Args() args: UpdateAvailabilityArgs + ): Promise<Availability | null> { + try { + return await this.service.updateAvailability({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + schedule: args.data.schedule + ? { + connect: args.data.schedule, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Availability) + async deleteAvailability( + @graphql.Args() args: DeleteAvailabilityArgs + ): Promise<Availability | null> { + try { + return await this.service.deleteAvailability(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Availability): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => EventType, { + nullable: true, + name: "eventType", + }) + async getEventType( + @graphql.Parent() parent: Availability + ): Promise<EventType | null> { + const result = await this.service.getEventType(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => Schedule, { + nullable: true, + name: "schedule", + }) + async getSchedule( + @graphql.Parent() parent: Availability + ): Promise<Schedule | null> { + const result = await this.service.getSchedule(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/availability/base/availability.service.base.ts b/apps/roi-cacl-2/src/availability/base/availability.service.base.ts new file mode 100644 index 0000000..cefe874 --- /dev/null +++ b/apps/roi-cacl-2/src/availability/base/availability.service.base.ts @@ -0,0 +1,82 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Availability as PrismaAvailability, + User as PrismaUser, + EventType as PrismaEventType, + Schedule as PrismaSchedule, +} from "@prisma/client"; + +export class AvailabilityServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.AvailabilityCountArgs, "select"> + ): Promise<number> { + return this.prisma.availability.count(args); + } + + async availabilities<T extends Prisma.AvailabilityFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.AvailabilityFindManyArgs> + ): Promise<PrismaAvailability[]> { + return this.prisma.availability.findMany<Prisma.AvailabilityFindManyArgs>( + args + ); + } + async availability<T extends Prisma.AvailabilityFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.AvailabilityFindUniqueArgs> + ): Promise<PrismaAvailability | null> { + return this.prisma.availability.findUnique(args); + } + async createAvailability<T extends Prisma.AvailabilityCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.AvailabilityCreateArgs> + ): Promise<PrismaAvailability> { + return this.prisma.availability.create<T>(args); + } + async updateAvailability<T extends Prisma.AvailabilityUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.AvailabilityUpdateArgs> + ): Promise<PrismaAvailability> { + return this.prisma.availability.update<T>(args); + } + async deleteAvailability<T extends Prisma.AvailabilityDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.AvailabilityDeleteArgs> + ): Promise<PrismaAvailability> { + return this.prisma.availability.delete(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.availability + .findUnique({ + where: { id: parentId }, + }) + .user(); + } + + async getEventType(parentId: number): Promise<PrismaEventType | null> { + return this.prisma.availability + .findUnique({ + where: { id: parentId }, + }) + .eventType(); + } + + async getSchedule(parentId: number): Promise<PrismaSchedule | null> { + return this.prisma.availability + .findUnique({ + where: { id: parentId }, + }) + .schedule(); + } +} diff --git a/apps/roi-cacl-2/src/booking/base/AttendeeCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/AttendeeCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..ba3252b --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/AttendeeCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AttendeeWhereUniqueInput } from "../../attendee/base/AttendeeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AttendeeCreateNestedManyWithoutBookingsInput { + @Field(() => [AttendeeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AttendeeWhereUniqueInput], + }) + connect?: Array<AttendeeWhereUniqueInput>; +} + +export { AttendeeCreateNestedManyWithoutBookingsInput as AttendeeCreateNestedManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/AttendeeUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/AttendeeUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..6a8700f --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/AttendeeUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AttendeeWhereUniqueInput } from "../../attendee/base/AttendeeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AttendeeUpdateManyWithoutBookingsInput { + @Field(() => [AttendeeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AttendeeWhereUniqueInput], + }) + connect?: Array<AttendeeWhereUniqueInput>; + + @Field(() => [AttendeeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AttendeeWhereUniqueInput], + }) + disconnect?: Array<AttendeeWhereUniqueInput>; + + @Field(() => [AttendeeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AttendeeWhereUniqueInput], + }) + set?: Array<AttendeeWhereUniqueInput>; +} + +export { AttendeeUpdateManyWithoutBookingsInput as AttendeeUpdateManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/Booking.ts b/apps/roi-cacl-2/src/booking/base/Booking.ts new file mode 100644 index 0000000..856029a --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/Booking.ts @@ -0,0 +1,309 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsString, + ValidateNested, + IsOptional, + IsDate, + IsEnum, + IsBoolean, +} from "class-validator"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; +import { EventType } from "../../eventType/base/EventType"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { JsonValue } from "type-fest"; +import { EnumBookingStatus } from "./EnumBookingStatus"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { BookingReference } from "../../bookingReference/base/BookingReference"; +import { Attendee } from "../../attendee/base/Attendee"; +import { DailyEventReference } from "../../dailyEventReference/base/DailyEventReference"; +import { Payment } from "../../payment/base/Payment"; +import { WorkflowReminder } from "../../workflowReminder/base/WorkflowReminder"; + +@ObjectType() +class Booking { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + uid!: string; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; + + @ApiProperty({ + required: false, + type: () => EventType, + }) + @ValidateNested() + @Type(() => EventType) + @IsOptional() + eventType?: EventType | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + title!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + description!: string | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + customInputs!: JsonValue; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + startTime!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + endTime!: Date; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + location!: string | null; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + updatedAt!: Date | null; + + @ApiProperty({ + required: true, + enum: EnumBookingStatus, + }) + @IsEnum(EnumBookingStatus) + @Field(() => EnumBookingStatus, { + nullable: true, + }) + status?: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + paid!: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + cancellationReason!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + rejectionReason!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dynamicEventSlugRef!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dynamicGroupSlugRef!: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + rescheduled!: boolean | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + fromReschedule!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + recurringEventId!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + smsReminderNumber!: string | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendar, + }) + @ValidateNested() + @Type(() => DestinationCalendar) + @IsOptional() + destinationCalendar?: DestinationCalendar | null; + + @ApiProperty({ + required: false, + type: () => [BookingReference], + }) + @ValidateNested() + @Type(() => BookingReference) + @IsOptional() + references?: Array<BookingReference>; + + @ApiProperty({ + required: false, + type: () => [Attendee], + }) + @ValidateNested() + @Type(() => Attendee) + @IsOptional() + attendees?: Array<Attendee>; + + @ApiProperty({ + required: false, + type: () => DailyEventReference, + }) + @ValidateNested() + @Type(() => DailyEventReference) + @IsOptional() + dailyRef?: DailyEventReference | null; + + @ApiProperty({ + required: false, + type: () => [Payment], + }) + @ValidateNested() + @Type(() => Payment) + @IsOptional() + payment?: Array<Payment>; + + @ApiProperty({ + required: false, + type: () => [WorkflowReminder], + }) + @ValidateNested() + @Type(() => WorkflowReminder) + @IsOptional() + workflowReminders?: Array<WorkflowReminder>; +} + +export { Booking as Booking }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingCountArgs.ts b/apps/roi-cacl-2/src/booking/base/BookingCountArgs.ts new file mode 100644 index 0000000..088fa4f --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereInput } from "./BookingWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class BookingCountArgs { + @ApiProperty({ + required: false, + type: () => BookingWhereInput, + }) + @Field(() => BookingWhereInput, { nullable: true }) + @Type(() => BookingWhereInput) + where?: BookingWhereInput; +} + +export { BookingCountArgs as BookingCountArgs }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingCreateInput.ts b/apps/roi-cacl-2/src/booking/base/BookingCreateInput.ts new file mode 100644 index 0000000..315c4c9 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingCreateInput.ts @@ -0,0 +1,314 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + ValidateNested, + IsOptional, + IsDate, + IsEnum, + IsBoolean, +} from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { EnumBookingStatus } from "./EnumBookingStatus"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { BookingReferenceCreateNestedManyWithoutBookingsInput } from "./BookingReferenceCreateNestedManyWithoutBookingsInput"; +import { AttendeeCreateNestedManyWithoutBookingsInput } from "./AttendeeCreateNestedManyWithoutBookingsInput"; +import { DailyEventReferenceWhereUniqueInput } from "../../dailyEventReference/base/DailyEventReferenceWhereUniqueInput"; +import { PaymentCreateNestedManyWithoutBookingsInput } from "./PaymentCreateNestedManyWithoutBookingsInput"; +import { WorkflowReminderCreateNestedManyWithoutBookingsInput } from "./WorkflowReminderCreateNestedManyWithoutBookingsInput"; + +@InputType() +class BookingCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + uid!: string; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + title!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + description?: string | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + customInputs?: InputJsonValue; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + startTime!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + endTime!: Date; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + location?: string | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + updatedAt?: Date | null; + + @ApiProperty({ + required: true, + enum: EnumBookingStatus, + }) + @IsEnum(EnumBookingStatus) + @Field(() => EnumBookingStatus) + status!: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + paid!: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + cancellationReason?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + rejectionReason?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dynamicEventSlugRef?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dynamicGroupSlugRef?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + rescheduled?: boolean | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + fromReschedule?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + recurringEventId?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + smsReminderNumber?: string | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => BookingReferenceCreateNestedManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => BookingReferenceCreateNestedManyWithoutBookingsInput) + @IsOptional() + @Field(() => BookingReferenceCreateNestedManyWithoutBookingsInput, { + nullable: true, + }) + references?: BookingReferenceCreateNestedManyWithoutBookingsInput; + + @ApiProperty({ + required: false, + type: () => AttendeeCreateNestedManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => AttendeeCreateNestedManyWithoutBookingsInput) + @IsOptional() + @Field(() => AttendeeCreateNestedManyWithoutBookingsInput, { + nullable: true, + }) + attendees?: AttendeeCreateNestedManyWithoutBookingsInput; + + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereUniqueInput) + @IsOptional() + @Field(() => DailyEventReferenceWhereUniqueInput, { + nullable: true, + }) + dailyRef?: DailyEventReferenceWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => PaymentCreateNestedManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => PaymentCreateNestedManyWithoutBookingsInput) + @IsOptional() + @Field(() => PaymentCreateNestedManyWithoutBookingsInput, { + nullable: true, + }) + payment?: PaymentCreateNestedManyWithoutBookingsInput; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderCreateNestedManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderCreateNestedManyWithoutBookingsInput) + @IsOptional() + @Field(() => WorkflowReminderCreateNestedManyWithoutBookingsInput, { + nullable: true, + }) + workflowReminders?: WorkflowReminderCreateNestedManyWithoutBookingsInput; +} + +export { BookingCreateInput as BookingCreateInput }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingFindManyArgs.ts b/apps/roi-cacl-2/src/booking/base/BookingFindManyArgs.ts new file mode 100644 index 0000000..f98509a --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereInput } from "./BookingWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { BookingOrderByInput } from "./BookingOrderByInput"; + +@ArgsType() +class BookingFindManyArgs { + @ApiProperty({ + required: false, + type: () => BookingWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => BookingWhereInput, { nullable: true }) + @Type(() => BookingWhereInput) + where?: BookingWhereInput; + + @ApiProperty({ + required: false, + type: [BookingOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [BookingOrderByInput], { nullable: true }) + @Type(() => BookingOrderByInput) + orderBy?: Array<BookingOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { BookingFindManyArgs as BookingFindManyArgs }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingFindUniqueArgs.ts b/apps/roi-cacl-2/src/booking/base/BookingFindUniqueArgs.ts new file mode 100644 index 0000000..5319cca --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereUniqueInput } from "./BookingWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class BookingFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @Field(() => BookingWhereUniqueInput, { nullable: false }) + where!: BookingWhereUniqueInput; +} + +export { BookingFindUniqueArgs as BookingFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingListRelationFilter.ts b/apps/roi-cacl-2/src/booking/base/BookingListRelationFilter.ts new file mode 100644 index 0000000..0352a01 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereInput } from "./BookingWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class BookingListRelationFilter { + @ApiProperty({ + required: false, + type: () => BookingWhereInput, + }) + @ValidateNested() + @Type(() => BookingWhereInput) + @IsOptional() + @Field(() => BookingWhereInput, { + nullable: true, + }) + every?: BookingWhereInput; + + @ApiProperty({ + required: false, + type: () => BookingWhereInput, + }) + @ValidateNested() + @Type(() => BookingWhereInput) + @IsOptional() + @Field(() => BookingWhereInput, { + nullable: true, + }) + some?: BookingWhereInput; + + @ApiProperty({ + required: false, + type: () => BookingWhereInput, + }) + @ValidateNested() + @Type(() => BookingWhereInput) + @IsOptional() + @Field(() => BookingWhereInput, { + nullable: true, + }) + none?: BookingWhereInput; +} +export { BookingListRelationFilter as BookingListRelationFilter }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingOrderByInput.ts b/apps/roi-cacl-2/src/booking/base/BookingOrderByInput.ts new file mode 100644 index 0000000..e16106b --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingOrderByInput.ts @@ -0,0 +1,287 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class BookingOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + uid?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTypeId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + title?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + description?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + customInputs?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + startTime?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + endTime?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + location?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + updatedAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + status?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + paid?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + cancellationReason?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + rejectionReason?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + dynamicEventSlugRef?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + dynamicGroupSlugRef?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + rescheduled?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + fromReschedule?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + recurringEventId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + smsReminderNumber?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + destinationCalendarId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + dailyRefId?: SortOrder; +} + +export { BookingOrderByInput as BookingOrderByInput }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingReferenceCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/BookingReferenceCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..e1673b1 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingReferenceCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { BookingReferenceWhereUniqueInput } from "../../bookingReference/base/BookingReferenceWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class BookingReferenceCreateNestedManyWithoutBookingsInput { + @Field(() => [BookingReferenceWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingReferenceWhereUniqueInput], + }) + connect?: Array<BookingReferenceWhereUniqueInput>; +} + +export { BookingReferenceCreateNestedManyWithoutBookingsInput as BookingReferenceCreateNestedManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingReferenceUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/BookingReferenceUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..00dc151 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingReferenceUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { BookingReferenceWhereUniqueInput } from "../../bookingReference/base/BookingReferenceWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class BookingReferenceUpdateManyWithoutBookingsInput { + @Field(() => [BookingReferenceWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingReferenceWhereUniqueInput], + }) + connect?: Array<BookingReferenceWhereUniqueInput>; + + @Field(() => [BookingReferenceWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingReferenceWhereUniqueInput], + }) + disconnect?: Array<BookingReferenceWhereUniqueInput>; + + @Field(() => [BookingReferenceWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingReferenceWhereUniqueInput], + }) + set?: Array<BookingReferenceWhereUniqueInput>; +} + +export { BookingReferenceUpdateManyWithoutBookingsInput as BookingReferenceUpdateManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingUpdateInput.ts b/apps/roi-cacl-2/src/booking/base/BookingUpdateInput.ts new file mode 100644 index 0000000..f1ceb60 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingUpdateInput.ts @@ -0,0 +1,332 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + ValidateNested, + IsDate, + IsEnum, + IsBoolean, +} from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { EnumBookingStatus } from "./EnumBookingStatus"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { BookingReferenceUpdateManyWithoutBookingsInput } from "./BookingReferenceUpdateManyWithoutBookingsInput"; +import { AttendeeUpdateManyWithoutBookingsInput } from "./AttendeeUpdateManyWithoutBookingsInput"; +import { DailyEventReferenceWhereUniqueInput } from "../../dailyEventReference/base/DailyEventReferenceWhereUniqueInput"; +import { PaymentUpdateManyWithoutBookingsInput } from "./PaymentUpdateManyWithoutBookingsInput"; +import { WorkflowReminderUpdateManyWithoutBookingsInput } from "./WorkflowReminderUpdateManyWithoutBookingsInput"; + +@InputType() +class BookingUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + uid?: string; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + title?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + description?: string | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + customInputs?: InputJsonValue; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + startTime?: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + endTime?: Date; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + location?: string | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + updatedAt?: Date | null; + + @ApiProperty({ + required: false, + enum: EnumBookingStatus, + }) + @IsEnum(EnumBookingStatus) + @IsOptional() + @Field(() => EnumBookingStatus, { + nullable: true, + }) + status?: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + paid?: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + cancellationReason?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + rejectionReason?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dynamicEventSlugRef?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dynamicGroupSlugRef?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + rescheduled?: boolean | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + fromReschedule?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + recurringEventId?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + smsReminderNumber?: string | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => BookingReferenceUpdateManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => BookingReferenceUpdateManyWithoutBookingsInput) + @IsOptional() + @Field(() => BookingReferenceUpdateManyWithoutBookingsInput, { + nullable: true, + }) + references?: BookingReferenceUpdateManyWithoutBookingsInput; + + @ApiProperty({ + required: false, + type: () => AttendeeUpdateManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => AttendeeUpdateManyWithoutBookingsInput) + @IsOptional() + @Field(() => AttendeeUpdateManyWithoutBookingsInput, { + nullable: true, + }) + attendees?: AttendeeUpdateManyWithoutBookingsInput; + + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereUniqueInput) + @IsOptional() + @Field(() => DailyEventReferenceWhereUniqueInput, { + nullable: true, + }) + dailyRef?: DailyEventReferenceWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => PaymentUpdateManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => PaymentUpdateManyWithoutBookingsInput) + @IsOptional() + @Field(() => PaymentUpdateManyWithoutBookingsInput, { + nullable: true, + }) + payment?: PaymentUpdateManyWithoutBookingsInput; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderUpdateManyWithoutBookingsInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderUpdateManyWithoutBookingsInput) + @IsOptional() + @Field(() => WorkflowReminderUpdateManyWithoutBookingsInput, { + nullable: true, + }) + workflowReminders?: WorkflowReminderUpdateManyWithoutBookingsInput; +} + +export { BookingUpdateInput as BookingUpdateInput }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingWhereInput.ts b/apps/roi-cacl-2/src/booking/base/BookingWhereInput.ts new file mode 100644 index 0000000..e70495f --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingWhereInput.ts @@ -0,0 +1,353 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested, IsEnum } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { EnumBookingStatus } from "./EnumBookingStatus"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { BookingReferenceListRelationFilter } from "../../bookingReference/base/BookingReferenceListRelationFilter"; +import { AttendeeListRelationFilter } from "../../attendee/base/AttendeeListRelationFilter"; +import { DailyEventReferenceWhereUniqueInput } from "../../dailyEventReference/base/DailyEventReferenceWhereUniqueInput"; +import { PaymentListRelationFilter } from "../../payment/base/PaymentListRelationFilter"; +import { WorkflowReminderListRelationFilter } from "../../workflowReminder/base/WorkflowReminderListRelationFilter"; + +@InputType() +class BookingWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + uid?: StringFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + title?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + description?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + customInputs?: JsonFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + startTime?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + endTime?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + location?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + updatedAt?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + enum: EnumBookingStatus, + }) + @IsEnum(EnumBookingStatus) + @IsOptional() + @Field(() => EnumBookingStatus, { + nullable: true, + }) + status?: "CANCELLED" | "ACCEPTED" | "REJECTED" | "PENDING"; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + paid?: BooleanFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + cancellationReason?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + rejectionReason?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + dynamicEventSlugRef?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + dynamicGroupSlugRef?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanNullableFilter, + }) + @Type(() => BooleanNullableFilter) + @IsOptional() + @Field(() => BooleanNullableFilter, { + nullable: true, + }) + rescheduled?: BooleanNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + fromReschedule?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + recurringEventId?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + smsReminderNumber?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => BookingReferenceListRelationFilter, + }) + @ValidateNested() + @Type(() => BookingReferenceListRelationFilter) + @IsOptional() + @Field(() => BookingReferenceListRelationFilter, { + nullable: true, + }) + references?: BookingReferenceListRelationFilter; + + @ApiProperty({ + required: false, + type: () => AttendeeListRelationFilter, + }) + @ValidateNested() + @Type(() => AttendeeListRelationFilter) + @IsOptional() + @Field(() => AttendeeListRelationFilter, { + nullable: true, + }) + attendees?: AttendeeListRelationFilter; + + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereUniqueInput) + @IsOptional() + @Field(() => DailyEventReferenceWhereUniqueInput, { + nullable: true, + }) + dailyRef?: DailyEventReferenceWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => PaymentListRelationFilter, + }) + @ValidateNested() + @Type(() => PaymentListRelationFilter) + @IsOptional() + @Field(() => PaymentListRelationFilter, { + nullable: true, + }) + payment?: PaymentListRelationFilter; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderListRelationFilter, + }) + @ValidateNested() + @Type(() => WorkflowReminderListRelationFilter) + @IsOptional() + @Field(() => WorkflowReminderListRelationFilter, { + nullable: true, + }) + workflowReminders?: WorkflowReminderListRelationFilter; +} + +export { BookingWhereInput as BookingWhereInput }; diff --git a/apps/roi-cacl-2/src/booking/base/BookingWhereUniqueInput.ts b/apps/roi-cacl-2/src/booking/base/BookingWhereUniqueInput.ts new file mode 100644 index 0000000..1390853 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/BookingWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class BookingWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { BookingWhereUniqueInput as BookingWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/booking/base/CreateBookingArgs.ts b/apps/roi-cacl-2/src/booking/base/CreateBookingArgs.ts new file mode 100644 index 0000000..7ccbdea --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/CreateBookingArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingCreateInput } from "./BookingCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateBookingArgs { + @ApiProperty({ + required: true, + type: () => BookingCreateInput, + }) + @ValidateNested() + @Type(() => BookingCreateInput) + @Field(() => BookingCreateInput, { nullable: false }) + data!: BookingCreateInput; +} + +export { CreateBookingArgs as CreateBookingArgs }; diff --git a/apps/roi-cacl-2/src/booking/base/DeleteBookingArgs.ts b/apps/roi-cacl-2/src/booking/base/DeleteBookingArgs.ts new file mode 100644 index 0000000..3bb4e6a --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/DeleteBookingArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereUniqueInput } from "./BookingWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteBookingArgs { + @ApiProperty({ + required: true, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @Field(() => BookingWhereUniqueInput, { nullable: false }) + where!: BookingWhereUniqueInput; +} + +export { DeleteBookingArgs as DeleteBookingArgs }; diff --git a/apps/roi-cacl-2/src/booking/base/EnumBookingStatus.ts b/apps/roi-cacl-2/src/booking/base/EnumBookingStatus.ts new file mode 100644 index 0000000..511e18b --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/EnumBookingStatus.ts @@ -0,0 +1,23 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumBookingStatus { + Cancelled = "CANCELLED", + Accepted = "ACCEPTED", + Rejected = "REJECTED", + Pending = "PENDING", +} + +registerEnumType(EnumBookingStatus, { + name: "EnumBookingStatus", +}); diff --git a/apps/roi-cacl-2/src/booking/base/PaymentCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/PaymentCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..77ef5d2 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/PaymentCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { PaymentWhereUniqueInput } from "../../payment/base/PaymentWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class PaymentCreateNestedManyWithoutBookingsInput { + @Field(() => [PaymentWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [PaymentWhereUniqueInput], + }) + connect?: Array<PaymentWhereUniqueInput>; +} + +export { PaymentCreateNestedManyWithoutBookingsInput as PaymentCreateNestedManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/PaymentUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/PaymentUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..7424cc2 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/PaymentUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { PaymentWhereUniqueInput } from "../../payment/base/PaymentWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class PaymentUpdateManyWithoutBookingsInput { + @Field(() => [PaymentWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [PaymentWhereUniqueInput], + }) + connect?: Array<PaymentWhereUniqueInput>; + + @Field(() => [PaymentWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [PaymentWhereUniqueInput], + }) + disconnect?: Array<PaymentWhereUniqueInput>; + + @Field(() => [PaymentWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [PaymentWhereUniqueInput], + }) + set?: Array<PaymentWhereUniqueInput>; +} + +export { PaymentUpdateManyWithoutBookingsInput as PaymentUpdateManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/UpdateBookingArgs.ts b/apps/roi-cacl-2/src/booking/base/UpdateBookingArgs.ts new file mode 100644 index 0000000..61051ea --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/UpdateBookingArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereUniqueInput } from "./BookingWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { BookingUpdateInput } from "./BookingUpdateInput"; + +@ArgsType() +class UpdateBookingArgs { + @ApiProperty({ + required: true, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @Field(() => BookingWhereUniqueInput, { nullable: false }) + where!: BookingWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => BookingUpdateInput, + }) + @ValidateNested() + @Type(() => BookingUpdateInput) + @Field(() => BookingUpdateInput, { nullable: false }) + data!: BookingUpdateInput; +} + +export { UpdateBookingArgs as UpdateBookingArgs }; diff --git a/apps/roi-cacl-2/src/booking/base/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts new file mode 100644 index 0000000..05b486b --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/WorkflowReminderCreateNestedManyWithoutBookingsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowReminderWhereUniqueInput } from "../../workflowReminder/base/WorkflowReminderWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowReminderCreateNestedManyWithoutBookingsInput { + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + connect?: Array<WorkflowReminderWhereUniqueInput>; +} + +export { WorkflowReminderCreateNestedManyWithoutBookingsInput as WorkflowReminderCreateNestedManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/WorkflowReminderUpdateManyWithoutBookingsInput.ts b/apps/roi-cacl-2/src/booking/base/WorkflowReminderUpdateManyWithoutBookingsInput.ts new file mode 100644 index 0000000..842572c --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/WorkflowReminderUpdateManyWithoutBookingsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowReminderWhereUniqueInput } from "../../workflowReminder/base/WorkflowReminderWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowReminderUpdateManyWithoutBookingsInput { + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + connect?: Array<WorkflowReminderWhereUniqueInput>; + + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + disconnect?: Array<WorkflowReminderWhereUniqueInput>; + + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + set?: Array<WorkflowReminderWhereUniqueInput>; +} + +export { WorkflowReminderUpdateManyWithoutBookingsInput as WorkflowReminderUpdateManyWithoutBookingsInput }; diff --git a/apps/roi-cacl-2/src/booking/base/booking.controller.base.spec.ts b/apps/roi-cacl-2/src/booking/base/booking.controller.base.spec.ts new file mode 100644 index 0000000..8dfa781 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/booking.controller.base.spec.ts @@ -0,0 +1,258 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { BookingController } from "../booking.controller"; +import { BookingService } from "../booking.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + uid: "exampleUid", + title: "exampleTitle", + description: "exampleDescription", + startTime: new Date(), + endTime: new Date(), + location: "exampleLocation", + createdAt: new Date(), + updatedAt: new Date(), + paid: "true", + cancellationReason: "exampleCancellationReason", + rejectionReason: "exampleRejectionReason", + dynamicEventSlugRef: "exampleDynamicEventSlugRef", + dynamicGroupSlugRef: "exampleDynamicGroupSlugRef", + rescheduled: "true", + fromReschedule: "exampleFromReschedule", + recurringEventId: "exampleRecurringEventId", + smsReminderNumber: "exampleSmsReminderNumber", +}; +const CREATE_RESULT = { + id: 42, + uid: "exampleUid", + title: "exampleTitle", + description: "exampleDescription", + startTime: new Date(), + endTime: new Date(), + location: "exampleLocation", + createdAt: new Date(), + updatedAt: new Date(), + paid: "true", + cancellationReason: "exampleCancellationReason", + rejectionReason: "exampleRejectionReason", + dynamicEventSlugRef: "exampleDynamicEventSlugRef", + dynamicGroupSlugRef: "exampleDynamicGroupSlugRef", + rescheduled: "true", + fromReschedule: "exampleFromReschedule", + recurringEventId: "exampleRecurringEventId", + smsReminderNumber: "exampleSmsReminderNumber", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + uid: "exampleUid", + title: "exampleTitle", + description: "exampleDescription", + startTime: new Date(), + endTime: new Date(), + location: "exampleLocation", + createdAt: new Date(), + updatedAt: new Date(), + paid: "true", + cancellationReason: "exampleCancellationReason", + rejectionReason: "exampleRejectionReason", + dynamicEventSlugRef: "exampleDynamicEventSlugRef", + dynamicGroupSlugRef: "exampleDynamicGroupSlugRef", + rescheduled: "true", + fromReschedule: "exampleFromReschedule", + recurringEventId: "exampleRecurringEventId", + smsReminderNumber: "exampleSmsReminderNumber", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + uid: "exampleUid", + title: "exampleTitle", + description: "exampleDescription", + startTime: new Date(), + endTime: new Date(), + location: "exampleLocation", + createdAt: new Date(), + updatedAt: new Date(), + paid: "true", + cancellationReason: "exampleCancellationReason", + rejectionReason: "exampleRejectionReason", + dynamicEventSlugRef: "exampleDynamicEventSlugRef", + dynamicGroupSlugRef: "exampleDynamicGroupSlugRef", + rescheduled: "true", + fromReschedule: "exampleFromReschedule", + recurringEventId: "exampleRecurringEventId", + smsReminderNumber: "exampleSmsReminderNumber", +}; + +const service = { + createBooking() { + return CREATE_RESULT; + }, + bookings: () => FIND_MANY_RESULT, + booking: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Booking", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: BookingService, + useValue: service, + }, + ], + controllers: [BookingController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /bookings", async () => { + await request(app.getHttpServer()) + .post("/bookings") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + startTime: CREATE_RESULT.startTime.toISOString(), + endTime: CREATE_RESULT.endTime.toISOString(), + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + }); + }); + + test("GET /bookings", async () => { + await request(app.getHttpServer()) + .get("/bookings") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + startTime: FIND_MANY_RESULT[0].startTime.toISOString(), + endTime: FIND_MANY_RESULT[0].endTime.toISOString(), + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(), + }, + ]); + }); + + test("GET /bookings/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/bookings"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /bookings/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/bookings"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + startTime: FIND_ONE_RESULT.startTime.toISOString(), + endTime: FIND_ONE_RESULT.endTime.toISOString(), + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(), + }); + }); + + test("POST /bookings existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/bookings") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + startTime: CREATE_RESULT.startTime.toISOString(), + endTime: CREATE_RESULT.endTime.toISOString(), + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + }) + .then(function () { + agent + .post("/bookings") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/booking/base/booking.controller.base.ts b/apps/roi-cacl-2/src/booking/base/booking.controller.base.ts new file mode 100644 index 0000000..45e3b9a --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/booking.controller.base.ts @@ -0,0 +1,750 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { BookingService } from "../booking.service"; +import { BookingCreateInput } from "./BookingCreateInput"; +import { Booking } from "./Booking"; +import { BookingFindManyArgs } from "./BookingFindManyArgs"; +import { BookingWhereUniqueInput } from "./BookingWhereUniqueInput"; +import { BookingUpdateInput } from "./BookingUpdateInput"; +import { BookingReferenceFindManyArgs } from "../../bookingReference/base/BookingReferenceFindManyArgs"; +import { BookingReference } from "../../bookingReference/base/BookingReference"; +import { BookingReferenceWhereUniqueInput } from "../../bookingReference/base/BookingReferenceWhereUniqueInput"; +import { AttendeeFindManyArgs } from "../../attendee/base/AttendeeFindManyArgs"; +import { Attendee } from "../../attendee/base/Attendee"; +import { AttendeeWhereUniqueInput } from "../../attendee/base/AttendeeWhereUniqueInput"; +import { PaymentFindManyArgs } from "../../payment/base/PaymentFindManyArgs"; +import { Payment } from "../../payment/base/Payment"; +import { PaymentWhereUniqueInput } from "../../payment/base/PaymentWhereUniqueInput"; +import { WorkflowReminderFindManyArgs } from "../../workflowReminder/base/WorkflowReminderFindManyArgs"; +import { WorkflowReminder } from "../../workflowReminder/base/WorkflowReminder"; +import { WorkflowReminderWhereUniqueInput } from "../../workflowReminder/base/WorkflowReminderWhereUniqueInput"; + +export class BookingControllerBase { + constructor(protected readonly service: BookingService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Booking }) + async createBooking( + @common.Body() data: BookingCreateInput + ): Promise<Booking> { + return await this.service.createBooking({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + destinationCalendar: data.destinationCalendar + ? { + connect: data.destinationCalendar, + } + : undefined, + + dailyRef: data.dailyRef + ? { + connect: data.dailyRef, + } + : undefined, + }, + select: { + id: true, + uid: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + title: true, + description: true, + customInputs: true, + startTime: true, + endTime: true, + location: true, + createdAt: true, + updatedAt: true, + status: true, + paid: true, + cancellationReason: true, + rejectionReason: true, + dynamicEventSlugRef: true, + dynamicGroupSlugRef: true, + rescheduled: true, + fromReschedule: true, + recurringEventId: true, + smsReminderNumber: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + dailyRef: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Booking] }) + @ApiNestedQuery(BookingFindManyArgs) + async bookings(@common.Req() request: Request): Promise<Booking[]> { + const args = plainToClass(BookingFindManyArgs, request.query); + return this.service.bookings({ + ...args, + select: { + id: true, + uid: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + title: true, + description: true, + customInputs: true, + startTime: true, + endTime: true, + location: true, + createdAt: true, + updatedAt: true, + status: true, + paid: true, + cancellationReason: true, + rejectionReason: true, + dynamicEventSlugRef: true, + dynamicGroupSlugRef: true, + rescheduled: true, + fromReschedule: true, + recurringEventId: true, + smsReminderNumber: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + dailyRef: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Booking }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async booking( + @common.Param() params: BookingWhereUniqueInput + ): Promise<Booking | null> { + const result = await this.service.booking({ + where: params, + select: { + id: true, + uid: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + title: true, + description: true, + customInputs: true, + startTime: true, + endTime: true, + location: true, + createdAt: true, + updatedAt: true, + status: true, + paid: true, + cancellationReason: true, + rejectionReason: true, + dynamicEventSlugRef: true, + dynamicGroupSlugRef: true, + rescheduled: true, + fromReschedule: true, + recurringEventId: true, + smsReminderNumber: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + dailyRef: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Booking }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateBooking( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() data: BookingUpdateInput + ): Promise<Booking | null> { + try { + return await this.service.updateBooking({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + destinationCalendar: data.destinationCalendar + ? { + connect: data.destinationCalendar, + } + : undefined, + + dailyRef: data.dailyRef + ? { + connect: data.dailyRef, + } + : undefined, + }, + select: { + id: true, + uid: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + title: true, + description: true, + customInputs: true, + startTime: true, + endTime: true, + location: true, + createdAt: true, + updatedAt: true, + status: true, + paid: true, + cancellationReason: true, + rejectionReason: true, + dynamicEventSlugRef: true, + dynamicGroupSlugRef: true, + rescheduled: true, + fromReschedule: true, + recurringEventId: true, + smsReminderNumber: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + dailyRef: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Booking }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteBooking( + @common.Param() params: BookingWhereUniqueInput + ): Promise<Booking | null> { + try { + return await this.service.deleteBooking({ + where: params, + select: { + id: true, + uid: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + title: true, + description: true, + customInputs: true, + startTime: true, + endTime: true, + location: true, + createdAt: true, + updatedAt: true, + status: true, + paid: true, + cancellationReason: true, + rejectionReason: true, + dynamicEventSlugRef: true, + dynamicGroupSlugRef: true, + rescheduled: true, + fromReschedule: true, + recurringEventId: true, + smsReminderNumber: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + dailyRef: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/references") + @ApiNestedQuery(BookingReferenceFindManyArgs) + async findReferences( + @common.Req() request: Request, + @common.Param() params: BookingWhereUniqueInput + ): Promise<BookingReference[]> { + const query = plainToClass(BookingReferenceFindManyArgs, request.query); + const results = await this.service.findReferences(params.id, { + ...query, + select: { + id: true, + typeField: true, + uid: true, + meetingId: true, + meetingPassword: true, + meetingUrl: true, + + booking: { + select: { + id: true, + }, + }, + + externalCalendarId: true, + deleted: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/references") + async connectReferences( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: BookingReferenceWhereUniqueInput[] + ): Promise<void> { + const data = { + references: { + connect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/references") + async updateReferences( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: BookingReferenceWhereUniqueInput[] + ): Promise<void> { + const data = { + references: { + set: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/references") + async disconnectReferences( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: BookingReferenceWhereUniqueInput[] + ): Promise<void> { + const data = { + references: { + disconnect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/attendees") + @ApiNestedQuery(AttendeeFindManyArgs) + async findAttendees( + @common.Req() request: Request, + @common.Param() params: BookingWhereUniqueInput + ): Promise<Attendee[]> { + const query = plainToClass(AttendeeFindManyArgs, request.query); + const results = await this.service.findAttendees(params.id, { + ...query, + select: { + id: true, + email: true, + name: true, + timeZone: true, + locale: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/attendees") + async connectAttendees( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: AttendeeWhereUniqueInput[] + ): Promise<void> { + const data = { + attendees: { + connect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/attendees") + async updateAttendees( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: AttendeeWhereUniqueInput[] + ): Promise<void> { + const data = { + attendees: { + set: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/attendees") + async disconnectAttendees( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: AttendeeWhereUniqueInput[] + ): Promise<void> { + const data = { + attendees: { + disconnect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/payment") + @ApiNestedQuery(PaymentFindManyArgs) + async findPayment( + @common.Req() request: Request, + @common.Param() params: BookingWhereUniqueInput + ): Promise<Payment[]> { + const query = plainToClass(PaymentFindManyArgs, request.query); + const results = await this.service.findPayment(params.id, { + ...query, + select: { + id: true, + uid: true, + type: true, + + booking: { + select: { + id: true, + }, + }, + + amount: true, + fee: true, + currency: true, + success: true, + refunded: true, + data: true, + externalId: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/payment") + async connectPayment( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: PaymentWhereUniqueInput[] + ): Promise<void> { + const data = { + payment: { + connect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/payment") + async updatePayment( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: PaymentWhereUniqueInput[] + ): Promise<void> { + const data = { + payment: { + set: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/payment") + async disconnectPayment( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: PaymentWhereUniqueInput[] + ): Promise<void> { + const data = { + payment: { + disconnect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/workflowReminders") + @ApiNestedQuery(WorkflowReminderFindManyArgs) + async findWorkflowReminders( + @common.Req() request: Request, + @common.Param() params: BookingWhereUniqueInput + ): Promise<WorkflowReminder[]> { + const query = plainToClass(WorkflowReminderFindManyArgs, request.query); + const results = await this.service.findWorkflowReminders(params.id, { + ...query, + select: { + id: true, + + booking: { + select: { + id: true, + }, + }, + + method: true, + scheduledDate: true, + referenceId: true, + scheduled: true, + + workflowStep: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/workflowReminders") + async connectWorkflowReminders( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: WorkflowReminderWhereUniqueInput[] + ): Promise<void> { + const data = { + workflowReminders: { + connect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/workflowReminders") + async updateWorkflowReminders( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: WorkflowReminderWhereUniqueInput[] + ): Promise<void> { + const data = { + workflowReminders: { + set: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/workflowReminders") + async disconnectWorkflowReminders( + @common.Param() params: BookingWhereUniqueInput, + @common.Body() body: WorkflowReminderWhereUniqueInput[] + ): Promise<void> { + const data = { + workflowReminders: { + disconnect: body, + }, + }; + await this.service.updateBooking({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/booking/base/booking.module.base.ts b/apps/roi-cacl-2/src/booking/base/booking.module.base.ts new file mode 100644 index 0000000..fba8710 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/booking.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class BookingModuleBase {} diff --git a/apps/roi-cacl-2/src/booking/base/booking.resolver.base.ts b/apps/roi-cacl-2/src/booking/base/booking.resolver.base.ts new file mode 100644 index 0000000..a977cad --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/booking.resolver.base.ts @@ -0,0 +1,277 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Booking } from "./Booking"; +import { BookingCountArgs } from "./BookingCountArgs"; +import { BookingFindManyArgs } from "./BookingFindManyArgs"; +import { BookingFindUniqueArgs } from "./BookingFindUniqueArgs"; +import { CreateBookingArgs } from "./CreateBookingArgs"; +import { UpdateBookingArgs } from "./UpdateBookingArgs"; +import { DeleteBookingArgs } from "./DeleteBookingArgs"; +import { BookingReferenceFindManyArgs } from "../../bookingReference/base/BookingReferenceFindManyArgs"; +import { BookingReference } from "../../bookingReference/base/BookingReference"; +import { AttendeeFindManyArgs } from "../../attendee/base/AttendeeFindManyArgs"; +import { Attendee } from "../../attendee/base/Attendee"; +import { PaymentFindManyArgs } from "../../payment/base/PaymentFindManyArgs"; +import { Payment } from "../../payment/base/Payment"; +import { WorkflowReminderFindManyArgs } from "../../workflowReminder/base/WorkflowReminderFindManyArgs"; +import { WorkflowReminder } from "../../workflowReminder/base/WorkflowReminder"; +import { User } from "../../user/base/User"; +import { EventType } from "../../eventType/base/EventType"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { DailyEventReference } from "../../dailyEventReference/base/DailyEventReference"; +import { BookingService } from "../booking.service"; +@graphql.Resolver(() => Booking) +export class BookingResolverBase { + constructor(protected readonly service: BookingService) {} + + async _bookingsMeta( + @graphql.Args() args: BookingCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Booking]) + async bookings( + @graphql.Args() args: BookingFindManyArgs + ): Promise<Booking[]> { + return this.service.bookings(args); + } + + @graphql.Query(() => Booking, { nullable: true }) + async booking( + @graphql.Args() args: BookingFindUniqueArgs + ): Promise<Booking | null> { + const result = await this.service.booking(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Booking) + async createBooking( + @graphql.Args() args: CreateBookingArgs + ): Promise<Booking> { + return await this.service.createBooking({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + destinationCalendar: args.data.destinationCalendar + ? { + connect: args.data.destinationCalendar, + } + : undefined, + + dailyRef: args.data.dailyRef + ? { + connect: args.data.dailyRef, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Booking) + async updateBooking( + @graphql.Args() args: UpdateBookingArgs + ): Promise<Booking | null> { + try { + return await this.service.updateBooking({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + destinationCalendar: args.data.destinationCalendar + ? { + connect: args.data.destinationCalendar, + } + : undefined, + + dailyRef: args.data.dailyRef + ? { + connect: args.data.dailyRef, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Booking) + async deleteBooking( + @graphql.Args() args: DeleteBookingArgs + ): Promise<Booking | null> { + try { + return await this.service.deleteBooking(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [BookingReference], { name: "references" }) + async findReferences( + @graphql.Parent() parent: Booking, + @graphql.Args() args: BookingReferenceFindManyArgs + ): Promise<BookingReference[]> { + const results = await this.service.findReferences(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Attendee], { name: "attendees" }) + async findAttendees( + @graphql.Parent() parent: Booking, + @graphql.Args() args: AttendeeFindManyArgs + ): Promise<Attendee[]> { + const results = await this.service.findAttendees(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Payment], { name: "payment" }) + async findPayment( + @graphql.Parent() parent: Booking, + @graphql.Args() args: PaymentFindManyArgs + ): Promise<Payment[]> { + const results = await this.service.findPayment(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [WorkflowReminder], { name: "workflowReminders" }) + async findWorkflowReminders( + @graphql.Parent() parent: Booking, + @graphql.Args() args: WorkflowReminderFindManyArgs + ): Promise<WorkflowReminder[]> { + const results = await this.service.findWorkflowReminders(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Booking): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => EventType, { + nullable: true, + name: "eventType", + }) + async getEventType( + @graphql.Parent() parent: Booking + ): Promise<EventType | null> { + const result = await this.service.getEventType(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => DestinationCalendar, { + nullable: true, + name: "destinationCalendar", + }) + async getDestinationCalendar( + @graphql.Parent() parent: Booking + ): Promise<DestinationCalendar | null> { + const result = await this.service.getDestinationCalendar(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => DailyEventReference, { + nullable: true, + name: "dailyRef", + }) + async getDailyRef( + @graphql.Parent() parent: Booking + ): Promise<DailyEventReference | null> { + const result = await this.service.getDailyRef(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/booking/base/booking.service.base.ts b/apps/roi-cacl-2/src/booking/base/booking.service.base.ts new file mode 100644 index 0000000..eec4c09 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/base/booking.service.base.ts @@ -0,0 +1,139 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Booking as PrismaBooking, + BookingReference as PrismaBookingReference, + Attendee as PrismaAttendee, + Payment as PrismaPayment, + WorkflowReminder as PrismaWorkflowReminder, + User as PrismaUser, + EventType as PrismaEventType, + DestinationCalendar as PrismaDestinationCalendar, + DailyEventReference as PrismaDailyEventReference, +} from "@prisma/client"; + +export class BookingServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.BookingCountArgs, "select">): Promise<number> { + return this.prisma.booking.count(args); + } + + async bookings<T extends Prisma.BookingFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingFindManyArgs> + ): Promise<PrismaBooking[]> { + return this.prisma.booking.findMany<Prisma.BookingFindManyArgs>(args); + } + async booking<T extends Prisma.BookingFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingFindUniqueArgs> + ): Promise<PrismaBooking | null> { + return this.prisma.booking.findUnique(args); + } + async createBooking<T extends Prisma.BookingCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingCreateArgs> + ): Promise<PrismaBooking> { + return this.prisma.booking.create<T>(args); + } + async updateBooking<T extends Prisma.BookingUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingUpdateArgs> + ): Promise<PrismaBooking> { + return this.prisma.booking.update<T>(args); + } + async deleteBooking<T extends Prisma.BookingDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingDeleteArgs> + ): Promise<PrismaBooking> { + return this.prisma.booking.delete(args); + } + + async findReferences( + parentId: number, + args: Prisma.BookingReferenceFindManyArgs + ): Promise<PrismaBookingReference[]> { + return this.prisma.booking + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .references(args); + } + + async findAttendees( + parentId: number, + args: Prisma.AttendeeFindManyArgs + ): Promise<PrismaAttendee[]> { + return this.prisma.booking + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .attendees(args); + } + + async findPayment( + parentId: number, + args: Prisma.PaymentFindManyArgs + ): Promise<PrismaPayment[]> { + return this.prisma.booking + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .payment(args); + } + + async findWorkflowReminders( + parentId: number, + args: Prisma.WorkflowReminderFindManyArgs + ): Promise<PrismaWorkflowReminder[]> { + return this.prisma.booking + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .workflowReminders(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.booking + .findUnique({ + where: { id: parentId }, + }) + .user(); + } + + async getEventType(parentId: number): Promise<PrismaEventType | null> { + return this.prisma.booking + .findUnique({ + where: { id: parentId }, + }) + .eventType(); + } + + async getDestinationCalendar( + parentId: number + ): Promise<PrismaDestinationCalendar | null> { + return this.prisma.booking + .findUnique({ + where: { id: parentId }, + }) + .destinationCalendar(); + } + + async getDailyRef( + parentId: number + ): Promise<PrismaDailyEventReference | null> { + return this.prisma.booking + .findUnique({ + where: { id: parentId }, + }) + .dailyRef(); + } +} diff --git a/apps/roi-cacl-2/src/booking/booking.controller.ts b/apps/roi-cacl-2/src/booking/booking.controller.ts new file mode 100644 index 0000000..32c7da8 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/booking.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { BookingService } from "./booking.service"; +import { BookingControllerBase } from "./base/booking.controller.base"; + +@swagger.ApiTags("bookings") +@common.Controller("bookings") +export class BookingController extends BookingControllerBase { + constructor(protected readonly service: BookingService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/booking/booking.module.ts b/apps/roi-cacl-2/src/booking/booking.module.ts new file mode 100644 index 0000000..9ba2abf --- /dev/null +++ b/apps/roi-cacl-2/src/booking/booking.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { BookingModuleBase } from "./base/booking.module.base"; +import { BookingService } from "./booking.service"; +import { BookingController } from "./booking.controller"; +import { BookingResolver } from "./booking.resolver"; + +@Module({ + imports: [BookingModuleBase], + controllers: [BookingController], + providers: [BookingService, BookingResolver], + exports: [BookingService], +}) +export class BookingModule {} diff --git a/apps/roi-cacl-2/src/booking/booking.resolver.ts b/apps/roi-cacl-2/src/booking/booking.resolver.ts new file mode 100644 index 0000000..c77f4c3 --- /dev/null +++ b/apps/roi-cacl-2/src/booking/booking.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { BookingResolverBase } from "./base/booking.resolver.base"; +import { Booking } from "./base/Booking"; +import { BookingService } from "./booking.service"; + +@graphql.Resolver(() => Booking) +export class BookingResolver extends BookingResolverBase { + constructor(protected readonly service: BookingService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/booking/booking.service.ts b/apps/roi-cacl-2/src/booking/booking.service.ts new file mode 100644 index 0000000..e1b736c --- /dev/null +++ b/apps/roi-cacl-2/src/booking/booking.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { BookingServiceBase } from "./base/booking.service.base"; + +@Injectable() +export class BookingService extends BookingServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReference.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReference.ts new file mode 100644 index 0000000..d082e69 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReference.ts @@ -0,0 +1,115 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsString, + IsOptional, + ValidateNested, + IsBoolean, +} from "class-validator"; +import { Booking } from "../../booking/base/Booking"; +import { Type } from "class-transformer"; + +@ObjectType() +class BookingReference { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + typeField!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + uid!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingId!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingPassword!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingUrl!: string | null; + + @ApiProperty({ + required: false, + type: () => Booking, + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + booking?: Booking | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + externalCalendarId!: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + deleted!: boolean | null; +} + +export { BookingReference as BookingReference }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCountArgs.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCountArgs.ts new file mode 100644 index 0000000..a6a867c --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingReferenceWhereInput } from "./BookingReferenceWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class BookingReferenceCountArgs { + @ApiProperty({ + required: false, + type: () => BookingReferenceWhereInput, + }) + @Field(() => BookingReferenceWhereInput, { nullable: true }) + @Type(() => BookingReferenceWhereInput) + where?: BookingReferenceWhereInput; +} + +export { BookingReferenceCountArgs as BookingReferenceCountArgs }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCreateInput.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCreateInput.ts new file mode 100644 index 0000000..57cfdde --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceCreateInput.ts @@ -0,0 +1,109 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + ValidateNested, + IsBoolean, +} from "class-validator"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class BookingReferenceCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + typeField!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + uid!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingId?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingPassword?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingUrl?: string | null; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + externalCalendarId?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + deleted?: boolean | null; +} + +export { BookingReferenceCreateInput as BookingReferenceCreateInput }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindManyArgs.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindManyArgs.ts new file mode 100644 index 0000000..d43e365 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingReferenceWhereInput } from "./BookingReferenceWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { BookingReferenceOrderByInput } from "./BookingReferenceOrderByInput"; + +@ArgsType() +class BookingReferenceFindManyArgs { + @ApiProperty({ + required: false, + type: () => BookingReferenceWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => BookingReferenceWhereInput, { nullable: true }) + @Type(() => BookingReferenceWhereInput) + where?: BookingReferenceWhereInput; + + @ApiProperty({ + required: false, + type: [BookingReferenceOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [BookingReferenceOrderByInput], { nullable: true }) + @Type(() => BookingReferenceOrderByInput) + orderBy?: Array<BookingReferenceOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { BookingReferenceFindManyArgs as BookingReferenceFindManyArgs }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindUniqueArgs.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindUniqueArgs.ts new file mode 100644 index 0000000..6951ee9 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingReferenceWhereUniqueInput } from "./BookingReferenceWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class BookingReferenceFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => BookingReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingReferenceWhereUniqueInput) + @Field(() => BookingReferenceWhereUniqueInput, { nullable: false }) + where!: BookingReferenceWhereUniqueInput; +} + +export { BookingReferenceFindUniqueArgs as BookingReferenceFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceListRelationFilter.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceListRelationFilter.ts new file mode 100644 index 0000000..6bc9a2c --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingReferenceWhereInput } from "./BookingReferenceWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class BookingReferenceListRelationFilter { + @ApiProperty({ + required: false, + type: () => BookingReferenceWhereInput, + }) + @ValidateNested() + @Type(() => BookingReferenceWhereInput) + @IsOptional() + @Field(() => BookingReferenceWhereInput, { + nullable: true, + }) + every?: BookingReferenceWhereInput; + + @ApiProperty({ + required: false, + type: () => BookingReferenceWhereInput, + }) + @ValidateNested() + @Type(() => BookingReferenceWhereInput) + @IsOptional() + @Field(() => BookingReferenceWhereInput, { + nullable: true, + }) + some?: BookingReferenceWhereInput; + + @ApiProperty({ + required: false, + type: () => BookingReferenceWhereInput, + }) + @ValidateNested() + @Type(() => BookingReferenceWhereInput) + @IsOptional() + @Field(() => BookingReferenceWhereInput, { + nullable: true, + }) + none?: BookingReferenceWhereInput; +} +export { BookingReferenceListRelationFilter as BookingReferenceListRelationFilter }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceOrderByInput.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceOrderByInput.ts new file mode 100644 index 0000000..aa113eb --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceOrderByInput.ts @@ -0,0 +1,122 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class BookingReferenceOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + typeField?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + uid?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + meetingId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + meetingPassword?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + meetingUrl?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bookingId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + externalCalendarId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + deleted?: SortOrder; +} + +export { BookingReferenceOrderByInput as BookingReferenceOrderByInput }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceUpdateInput.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceUpdateInput.ts new file mode 100644 index 0000000..24e8868 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceUpdateInput.ts @@ -0,0 +1,115 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + ValidateNested, + IsBoolean, +} from "class-validator"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class BookingReferenceUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + typeField?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + uid?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingId?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingPassword?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + meetingUrl?: string | null; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + externalCalendarId?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + deleted?: boolean | null; +} + +export { BookingReferenceUpdateInput as BookingReferenceUpdateInput }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereInput.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereInput.ts new file mode 100644 index 0000000..b08adf8 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereInput.ts @@ -0,0 +1,125 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; + +@InputType() +class BookingReferenceWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + typeField?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + uid?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + meetingId?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + meetingPassword?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + meetingUrl?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + externalCalendarId?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanNullableFilter, + }) + @Type(() => BooleanNullableFilter) + @IsOptional() + @Field(() => BooleanNullableFilter, { + nullable: true, + }) + deleted?: BooleanNullableFilter; +} + +export { BookingReferenceWhereInput as BookingReferenceWhereInput }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereUniqueInput.ts b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereUniqueInput.ts new file mode 100644 index 0000000..6ec6664 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/BookingReferenceWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class BookingReferenceWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { BookingReferenceWhereUniqueInput as BookingReferenceWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/CreateBookingReferenceArgs.ts b/apps/roi-cacl-2/src/bookingReference/base/CreateBookingReferenceArgs.ts new file mode 100644 index 0000000..8382215 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/CreateBookingReferenceArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingReferenceCreateInput } from "./BookingReferenceCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateBookingReferenceArgs { + @ApiProperty({ + required: true, + type: () => BookingReferenceCreateInput, + }) + @ValidateNested() + @Type(() => BookingReferenceCreateInput) + @Field(() => BookingReferenceCreateInput, { nullable: false }) + data!: BookingReferenceCreateInput; +} + +export { CreateBookingReferenceArgs as CreateBookingReferenceArgs }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/DeleteBookingReferenceArgs.ts b/apps/roi-cacl-2/src/bookingReference/base/DeleteBookingReferenceArgs.ts new file mode 100644 index 0000000..9c2150c --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/DeleteBookingReferenceArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingReferenceWhereUniqueInput } from "./BookingReferenceWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteBookingReferenceArgs { + @ApiProperty({ + required: true, + type: () => BookingReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingReferenceWhereUniqueInput) + @Field(() => BookingReferenceWhereUniqueInput, { nullable: false }) + where!: BookingReferenceWhereUniqueInput; +} + +export { DeleteBookingReferenceArgs as DeleteBookingReferenceArgs }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/UpdateBookingReferenceArgs.ts b/apps/roi-cacl-2/src/bookingReference/base/UpdateBookingReferenceArgs.ts new file mode 100644 index 0000000..b8484ea --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/UpdateBookingReferenceArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingReferenceWhereUniqueInput } from "./BookingReferenceWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { BookingReferenceUpdateInput } from "./BookingReferenceUpdateInput"; + +@ArgsType() +class UpdateBookingReferenceArgs { + @ApiProperty({ + required: true, + type: () => BookingReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingReferenceWhereUniqueInput) + @Field(() => BookingReferenceWhereUniqueInput, { nullable: false }) + where!: BookingReferenceWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => BookingReferenceUpdateInput, + }) + @ValidateNested() + @Type(() => BookingReferenceUpdateInput) + @Field(() => BookingReferenceUpdateInput, { nullable: false }) + data!: BookingReferenceUpdateInput; +} + +export { UpdateBookingReferenceArgs as UpdateBookingReferenceArgs }; diff --git a/apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.spec.ts b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.spec.ts new file mode 100644 index 0000000..1a250a1 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.spec.ts @@ -0,0 +1,192 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { BookingReferenceController } from "../bookingReference.controller"; +import { BookingReferenceService } from "../bookingReference.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + typeField: "exampleTypeField", + uid: "exampleUid", + meetingId: "exampleMeetingId", + meetingPassword: "exampleMeetingPassword", + meetingUrl: "exampleMeetingUrl", + externalCalendarId: "exampleExternalCalendarId", + deleted: "true", +}; +const CREATE_RESULT = { + id: 42, + typeField: "exampleTypeField", + uid: "exampleUid", + meetingId: "exampleMeetingId", + meetingPassword: "exampleMeetingPassword", + meetingUrl: "exampleMeetingUrl", + externalCalendarId: "exampleExternalCalendarId", + deleted: "true", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + typeField: "exampleTypeField", + uid: "exampleUid", + meetingId: "exampleMeetingId", + meetingPassword: "exampleMeetingPassword", + meetingUrl: "exampleMeetingUrl", + externalCalendarId: "exampleExternalCalendarId", + deleted: "true", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + typeField: "exampleTypeField", + uid: "exampleUid", + meetingId: "exampleMeetingId", + meetingPassword: "exampleMeetingPassword", + meetingUrl: "exampleMeetingUrl", + externalCalendarId: "exampleExternalCalendarId", + deleted: "true", +}; + +const service = { + createBookingReference() { + return CREATE_RESULT; + }, + bookingReferences: () => FIND_MANY_RESULT, + bookingReference: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("BookingReference", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: BookingReferenceService, + useValue: service, + }, + ], + controllers: [BookingReferenceController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /bookingReferences", async () => { + await request(app.getHttpServer()) + .post("/bookingReferences") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /bookingReferences", async () => { + await request(app.getHttpServer()) + .get("/bookingReferences") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /bookingReferences/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/bookingReferences"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /bookingReferences/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/bookingReferences"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /bookingReferences existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/bookingReferences") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/bookingReferences") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.ts b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.ts new file mode 100644 index 0000000..2141520 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.controller.base.ts @@ -0,0 +1,209 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { BookingReferenceService } from "../bookingReference.service"; +import { BookingReferenceCreateInput } from "./BookingReferenceCreateInput"; +import { BookingReference } from "./BookingReference"; +import { BookingReferenceFindManyArgs } from "./BookingReferenceFindManyArgs"; +import { BookingReferenceWhereUniqueInput } from "./BookingReferenceWhereUniqueInput"; +import { BookingReferenceUpdateInput } from "./BookingReferenceUpdateInput"; + +export class BookingReferenceControllerBase { + constructor(protected readonly service: BookingReferenceService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: BookingReference }) + async createBookingReference( + @common.Body() data: BookingReferenceCreateInput + ): Promise<BookingReference> { + return await this.service.createBookingReference({ + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + typeField: true, + uid: true, + meetingId: true, + meetingPassword: true, + meetingUrl: true, + + booking: { + select: { + id: true, + }, + }, + + externalCalendarId: true, + deleted: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [BookingReference] }) + @ApiNestedQuery(BookingReferenceFindManyArgs) + async bookingReferences( + @common.Req() request: Request + ): Promise<BookingReference[]> { + const args = plainToClass(BookingReferenceFindManyArgs, request.query); + return this.service.bookingReferences({ + ...args, + select: { + id: true, + typeField: true, + uid: true, + meetingId: true, + meetingPassword: true, + meetingUrl: true, + + booking: { + select: { + id: true, + }, + }, + + externalCalendarId: true, + deleted: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: BookingReference }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async bookingReference( + @common.Param() params: BookingReferenceWhereUniqueInput + ): Promise<BookingReference | null> { + const result = await this.service.bookingReference({ + where: params, + select: { + id: true, + typeField: true, + uid: true, + meetingId: true, + meetingPassword: true, + meetingUrl: true, + + booking: { + select: { + id: true, + }, + }, + + externalCalendarId: true, + deleted: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: BookingReference }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateBookingReference( + @common.Param() params: BookingReferenceWhereUniqueInput, + @common.Body() data: BookingReferenceUpdateInput + ): Promise<BookingReference | null> { + try { + return await this.service.updateBookingReference({ + where: params, + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + typeField: true, + uid: true, + meetingId: true, + meetingPassword: true, + meetingUrl: true, + + booking: { + select: { + id: true, + }, + }, + + externalCalendarId: true, + deleted: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: BookingReference }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteBookingReference( + @common.Param() params: BookingReferenceWhereUniqueInput + ): Promise<BookingReference | null> { + try { + return await this.service.deleteBookingReference({ + where: params, + select: { + id: true, + typeField: true, + uid: true, + meetingId: true, + meetingPassword: true, + meetingUrl: true, + + booking: { + select: { + id: true, + }, + }, + + externalCalendarId: true, + deleted: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/bookingReference/base/bookingReference.module.base.ts b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.module.base.ts new file mode 100644 index 0000000..c48226d --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class BookingReferenceModuleBase {} diff --git a/apps/roi-cacl-2/src/bookingReference/base/bookingReference.resolver.base.ts b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.resolver.base.ts new file mode 100644 index 0000000..96b16ad --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.resolver.base.ts @@ -0,0 +1,131 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { BookingReference } from "./BookingReference"; +import { BookingReferenceCountArgs } from "./BookingReferenceCountArgs"; +import { BookingReferenceFindManyArgs } from "./BookingReferenceFindManyArgs"; +import { BookingReferenceFindUniqueArgs } from "./BookingReferenceFindUniqueArgs"; +import { CreateBookingReferenceArgs } from "./CreateBookingReferenceArgs"; +import { UpdateBookingReferenceArgs } from "./UpdateBookingReferenceArgs"; +import { DeleteBookingReferenceArgs } from "./DeleteBookingReferenceArgs"; +import { Booking } from "../../booking/base/Booking"; +import { BookingReferenceService } from "../bookingReference.service"; +@graphql.Resolver(() => BookingReference) +export class BookingReferenceResolverBase { + constructor(protected readonly service: BookingReferenceService) {} + + async _bookingReferencesMeta( + @graphql.Args() args: BookingReferenceCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [BookingReference]) + async bookingReferences( + @graphql.Args() args: BookingReferenceFindManyArgs + ): Promise<BookingReference[]> { + return this.service.bookingReferences(args); + } + + @graphql.Query(() => BookingReference, { nullable: true }) + async bookingReference( + @graphql.Args() args: BookingReferenceFindUniqueArgs + ): Promise<BookingReference | null> { + const result = await this.service.bookingReference(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => BookingReference) + async createBookingReference( + @graphql.Args() args: CreateBookingReferenceArgs + ): Promise<BookingReference> { + return await this.service.createBookingReference({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => BookingReference) + async updateBookingReference( + @graphql.Args() args: UpdateBookingReferenceArgs + ): Promise<BookingReference | null> { + try { + return await this.service.updateBookingReference({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => BookingReference) + async deleteBookingReference( + @graphql.Args() args: DeleteBookingReferenceArgs + ): Promise<BookingReference | null> { + try { + return await this.service.deleteBookingReference(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => Booking, { + nullable: true, + name: "booking", + }) + async getBooking( + @graphql.Parent() parent: BookingReference + ): Promise<Booking | null> { + const result = await this.service.getBooking(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/bookingReference/base/bookingReference.service.base.ts b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.service.base.ts new file mode 100644 index 0000000..9f03e3a --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/base/bookingReference.service.base.ts @@ -0,0 +1,64 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + BookingReference as PrismaBookingReference, + Booking as PrismaBooking, +} from "@prisma/client"; + +export class BookingReferenceServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.BookingReferenceCountArgs, "select"> + ): Promise<number> { + return this.prisma.bookingReference.count(args); + } + + async bookingReferences<T extends Prisma.BookingReferenceFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingReferenceFindManyArgs> + ): Promise<PrismaBookingReference[]> { + return this.prisma.bookingReference.findMany<Prisma.BookingReferenceFindManyArgs>( + args + ); + } + async bookingReference<T extends Prisma.BookingReferenceFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingReferenceFindUniqueArgs> + ): Promise<PrismaBookingReference | null> { + return this.prisma.bookingReference.findUnique(args); + } + async createBookingReference<T extends Prisma.BookingReferenceCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingReferenceCreateArgs> + ): Promise<PrismaBookingReference> { + return this.prisma.bookingReference.create<T>(args); + } + async updateBookingReference<T extends Prisma.BookingReferenceUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingReferenceUpdateArgs> + ): Promise<PrismaBookingReference> { + return this.prisma.bookingReference.update<T>(args); + } + async deleteBookingReference<T extends Prisma.BookingReferenceDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.BookingReferenceDeleteArgs> + ): Promise<PrismaBookingReference> { + return this.prisma.bookingReference.delete(args); + } + + async getBooking(parentId: number): Promise<PrismaBooking | null> { + return this.prisma.bookingReference + .findUnique({ + where: { id: parentId }, + }) + .booking(); + } +} diff --git a/apps/roi-cacl-2/src/bookingReference/bookingReference.controller.ts b/apps/roi-cacl-2/src/bookingReference/bookingReference.controller.ts new file mode 100644 index 0000000..4763970 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/bookingReference.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { BookingReferenceService } from "./bookingReference.service"; +import { BookingReferenceControllerBase } from "./base/bookingReference.controller.base"; + +@swagger.ApiTags("bookingReferences") +@common.Controller("bookingReferences") +export class BookingReferenceController extends BookingReferenceControllerBase { + constructor(protected readonly service: BookingReferenceService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/bookingReference/bookingReference.module.ts b/apps/roi-cacl-2/src/bookingReference/bookingReference.module.ts new file mode 100644 index 0000000..85f0bbf --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/bookingReference.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { BookingReferenceModuleBase } from "./base/bookingReference.module.base"; +import { BookingReferenceService } from "./bookingReference.service"; +import { BookingReferenceController } from "./bookingReference.controller"; +import { BookingReferenceResolver } from "./bookingReference.resolver"; + +@Module({ + imports: [BookingReferenceModuleBase], + controllers: [BookingReferenceController], + providers: [BookingReferenceService, BookingReferenceResolver], + exports: [BookingReferenceService], +}) +export class BookingReferenceModule {} diff --git a/apps/roi-cacl-2/src/bookingReference/bookingReference.resolver.ts b/apps/roi-cacl-2/src/bookingReference/bookingReference.resolver.ts new file mode 100644 index 0000000..8d64178 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/bookingReference.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { BookingReferenceResolverBase } from "./base/bookingReference.resolver.base"; +import { BookingReference } from "./base/BookingReference"; +import { BookingReferenceService } from "./bookingReference.service"; + +@graphql.Resolver(() => BookingReference) +export class BookingReferenceResolver extends BookingReferenceResolverBase { + constructor(protected readonly service: BookingReferenceService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/bookingReference/bookingReference.service.ts b/apps/roi-cacl-2/src/bookingReference/bookingReference.service.ts new file mode 100644 index 0000000..0f38c54 --- /dev/null +++ b/apps/roi-cacl-2/src/bookingReference/bookingReference.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { BookingReferenceServiceBase } from "./base/bookingReference.service.base"; + +@Injectable() +export class BookingReferenceService extends BookingReferenceServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/connectMicroservices.ts b/apps/roi-cacl-2/src/connectMicroservices.ts new file mode 100644 index 0000000..068fa5f --- /dev/null +++ b/apps/roi-cacl-2/src/connectMicroservices.ts @@ -0,0 +1,6 @@ +import { INestApplication } from "@nestjs/common"; +import { ConfigService } from "@nestjs/config"; + +export async function connectMicroservices(app: INestApplication) { + const configService = app.get(ConfigService); +} diff --git a/apps/roi-cacl-2/src/credential/base/CreateCredentialArgs.ts b/apps/roi-cacl-2/src/credential/base/CreateCredentialArgs.ts new file mode 100644 index 0000000..831e3b0 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CreateCredentialArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { CredentialCreateInput } from "./CredentialCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateCredentialArgs { + @ApiProperty({ + required: true, + type: () => CredentialCreateInput, + }) + @ValidateNested() + @Type(() => CredentialCreateInput) + @Field(() => CredentialCreateInput, { nullable: false }) + data!: CredentialCreateInput; +} + +export { CreateCredentialArgs as CreateCredentialArgs }; diff --git a/apps/roi-cacl-2/src/credential/base/Credential.ts b/apps/roi-cacl-2/src/credential/base/Credential.ts new file mode 100644 index 0000000..bbd8dc1 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/Credential.ts @@ -0,0 +1,76 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsString, ValidateNested, IsOptional } from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { JsonValue } from "type-fest"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; +import { AppModel } from "../../appModel/base/AppModel"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; + +@ObjectType() +class Credential { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + typeField!: string; + + @ApiProperty({ + required: true, + }) + @IsJSONValue() + @Field(() => GraphQLJSON) + key!: JsonValue; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; + + @ApiProperty({ + required: false, + type: () => AppModel, + }) + @ValidateNested() + @Type(() => AppModel) + @IsOptional() + appField?: AppModel | null; + + @ApiProperty({ + required: false, + type: () => [DestinationCalendar], + }) + @ValidateNested() + @Type(() => DestinationCalendar) + @IsOptional() + destinationCalendars?: Array<DestinationCalendar>; +} + +export { Credential as Credential }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialCountArgs.ts b/apps/roi-cacl-2/src/credential/base/CredentialCountArgs.ts new file mode 100644 index 0000000..b3ff7c3 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { CredentialWhereInput } from "./CredentialWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class CredentialCountArgs { + @ApiProperty({ + required: false, + type: () => CredentialWhereInput, + }) + @Field(() => CredentialWhereInput, { nullable: true }) + @Type(() => CredentialWhereInput) + where?: CredentialWhereInput; +} + +export { CredentialCountArgs as CredentialCountArgs }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialCreateInput.ts b/apps/roi-cacl-2/src/credential/base/CredentialCreateInput.ts new file mode 100644 index 0000000..c7e18eb --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialCreateInput.ts @@ -0,0 +1,77 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, ValidateNested, IsOptional } from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; +import { DestinationCalendarCreateNestedManyWithoutCredentialsInput } from "./DestinationCalendarCreateNestedManyWithoutCredentialsInput"; + +@InputType() +class CredentialCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + typeField!: string; + + @ApiProperty({ + required: true, + }) + @IsJSONValue() + @Field(() => GraphQLJSON) + key!: InputJsonValue; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarCreateNestedManyWithoutCredentialsInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarCreateNestedManyWithoutCredentialsInput) + @IsOptional() + @Field(() => DestinationCalendarCreateNestedManyWithoutCredentialsInput, { + nullable: true, + }) + destinationCalendars?: DestinationCalendarCreateNestedManyWithoutCredentialsInput; +} + +export { CredentialCreateInput as CredentialCreateInput }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialFindManyArgs.ts b/apps/roi-cacl-2/src/credential/base/CredentialFindManyArgs.ts new file mode 100644 index 0000000..8e2ea12 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { CredentialWhereInput } from "./CredentialWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { CredentialOrderByInput } from "./CredentialOrderByInput"; + +@ArgsType() +class CredentialFindManyArgs { + @ApiProperty({ + required: false, + type: () => CredentialWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => CredentialWhereInput, { nullable: true }) + @Type(() => CredentialWhereInput) + where?: CredentialWhereInput; + + @ApiProperty({ + required: false, + type: [CredentialOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [CredentialOrderByInput], { nullable: true }) + @Type(() => CredentialOrderByInput) + orderBy?: Array<CredentialOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { CredentialFindManyArgs as CredentialFindManyArgs }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialFindUniqueArgs.ts b/apps/roi-cacl-2/src/credential/base/CredentialFindUniqueArgs.ts new file mode 100644 index 0000000..d13aa41 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { CredentialWhereUniqueInput } from "./CredentialWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CredentialFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => CredentialWhereUniqueInput, + }) + @ValidateNested() + @Type(() => CredentialWhereUniqueInput) + @Field(() => CredentialWhereUniqueInput, { nullable: false }) + where!: CredentialWhereUniqueInput; +} + +export { CredentialFindUniqueArgs as CredentialFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialListRelationFilter.ts b/apps/roi-cacl-2/src/credential/base/CredentialListRelationFilter.ts new file mode 100644 index 0000000..aea74bb --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { CredentialWhereInput } from "./CredentialWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class CredentialListRelationFilter { + @ApiProperty({ + required: false, + type: () => CredentialWhereInput, + }) + @ValidateNested() + @Type(() => CredentialWhereInput) + @IsOptional() + @Field(() => CredentialWhereInput, { + nullable: true, + }) + every?: CredentialWhereInput; + + @ApiProperty({ + required: false, + type: () => CredentialWhereInput, + }) + @ValidateNested() + @Type(() => CredentialWhereInput) + @IsOptional() + @Field(() => CredentialWhereInput, { + nullable: true, + }) + some?: CredentialWhereInput; + + @ApiProperty({ + required: false, + type: () => CredentialWhereInput, + }) + @ValidateNested() + @Type(() => CredentialWhereInput) + @IsOptional() + @Field(() => CredentialWhereInput, { + nullable: true, + }) + none?: CredentialWhereInput; +} +export { CredentialListRelationFilter as CredentialListRelationFilter }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialOrderByInput.ts b/apps/roi-cacl-2/src/credential/base/CredentialOrderByInput.ts new file mode 100644 index 0000000..79323b8 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialOrderByInput.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class CredentialOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + typeField?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + key?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + appId?: SortOrder; +} + +export { CredentialOrderByInput as CredentialOrderByInput }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialUpdateInput.ts b/apps/roi-cacl-2/src/credential/base/CredentialUpdateInput.ts new file mode 100644 index 0000000..8c324b2 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialUpdateInput.ts @@ -0,0 +1,83 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, ValidateNested } from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; +import { DestinationCalendarUpdateManyWithoutCredentialsInput } from "./DestinationCalendarUpdateManyWithoutCredentialsInput"; + +@InputType() +class CredentialUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + typeField?: string; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + key?: InputJsonValue; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarUpdateManyWithoutCredentialsInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarUpdateManyWithoutCredentialsInput) + @IsOptional() + @Field(() => DestinationCalendarUpdateManyWithoutCredentialsInput, { + nullable: true, + }) + destinationCalendars?: DestinationCalendarUpdateManyWithoutCredentialsInput; +} + +export { CredentialUpdateInput as CredentialUpdateInput }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialWhereInput.ts b/apps/roi-cacl-2/src/credential/base/CredentialWhereInput.ts new file mode 100644 index 0000000..44b279d --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialWhereInput.ts @@ -0,0 +1,95 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; +import { DestinationCalendarListRelationFilter } from "../../destinationCalendar/base/DestinationCalendarListRelationFilter"; + +@InputType() +class CredentialWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + typeField?: StringFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + key?: JsonFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarListRelationFilter, + }) + @ValidateNested() + @Type(() => DestinationCalendarListRelationFilter) + @IsOptional() + @Field(() => DestinationCalendarListRelationFilter, { + nullable: true, + }) + destinationCalendars?: DestinationCalendarListRelationFilter; +} + +export { CredentialWhereInput as CredentialWhereInput }; diff --git a/apps/roi-cacl-2/src/credential/base/CredentialWhereUniqueInput.ts b/apps/roi-cacl-2/src/credential/base/CredentialWhereUniqueInput.ts new file mode 100644 index 0000000..2380347 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/CredentialWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class CredentialWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { CredentialWhereUniqueInput as CredentialWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/credential/base/DeleteCredentialArgs.ts b/apps/roi-cacl-2/src/credential/base/DeleteCredentialArgs.ts new file mode 100644 index 0000000..55407a7 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/DeleteCredentialArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { CredentialWhereUniqueInput } from "./CredentialWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteCredentialArgs { + @ApiProperty({ + required: true, + type: () => CredentialWhereUniqueInput, + }) + @ValidateNested() + @Type(() => CredentialWhereUniqueInput) + @Field(() => CredentialWhereUniqueInput, { nullable: false }) + where!: CredentialWhereUniqueInput; +} + +export { DeleteCredentialArgs as DeleteCredentialArgs }; diff --git a/apps/roi-cacl-2/src/credential/base/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts b/apps/roi-cacl-2/src/credential/base/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts new file mode 100644 index 0000000..948f529 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/DestinationCalendarCreateNestedManyWithoutCredentialsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class DestinationCalendarCreateNestedManyWithoutCredentialsInput { + @Field(() => [DestinationCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [DestinationCalendarWhereUniqueInput], + }) + connect?: Array<DestinationCalendarWhereUniqueInput>; +} + +export { DestinationCalendarCreateNestedManyWithoutCredentialsInput as DestinationCalendarCreateNestedManyWithoutCredentialsInput }; diff --git a/apps/roi-cacl-2/src/credential/base/DestinationCalendarUpdateManyWithoutCredentialsInput.ts b/apps/roi-cacl-2/src/credential/base/DestinationCalendarUpdateManyWithoutCredentialsInput.ts new file mode 100644 index 0000000..49e24a7 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/DestinationCalendarUpdateManyWithoutCredentialsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class DestinationCalendarUpdateManyWithoutCredentialsInput { + @Field(() => [DestinationCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [DestinationCalendarWhereUniqueInput], + }) + connect?: Array<DestinationCalendarWhereUniqueInput>; + + @Field(() => [DestinationCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [DestinationCalendarWhereUniqueInput], + }) + disconnect?: Array<DestinationCalendarWhereUniqueInput>; + + @Field(() => [DestinationCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [DestinationCalendarWhereUniqueInput], + }) + set?: Array<DestinationCalendarWhereUniqueInput>; +} + +export { DestinationCalendarUpdateManyWithoutCredentialsInput as DestinationCalendarUpdateManyWithoutCredentialsInput }; diff --git a/apps/roi-cacl-2/src/credential/base/UpdateCredentialArgs.ts b/apps/roi-cacl-2/src/credential/base/UpdateCredentialArgs.ts new file mode 100644 index 0000000..81ec3ad --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/UpdateCredentialArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { CredentialWhereUniqueInput } from "./CredentialWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { CredentialUpdateInput } from "./CredentialUpdateInput"; + +@ArgsType() +class UpdateCredentialArgs { + @ApiProperty({ + required: true, + type: () => CredentialWhereUniqueInput, + }) + @ValidateNested() + @Type(() => CredentialWhereUniqueInput) + @Field(() => CredentialWhereUniqueInput, { nullable: false }) + where!: CredentialWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => CredentialUpdateInput, + }) + @ValidateNested() + @Type(() => CredentialUpdateInput) + @Field(() => CredentialUpdateInput, { nullable: false }) + data!: CredentialUpdateInput; +} + +export { UpdateCredentialArgs as UpdateCredentialArgs }; diff --git a/apps/roi-cacl-2/src/credential/base/credential.controller.base.spec.ts b/apps/roi-cacl-2/src/credential/base/credential.controller.base.spec.ts new file mode 100644 index 0000000..f2b4bba --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/credential.controller.base.spec.ts @@ -0,0 +1,168 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { CredentialController } from "../credential.controller"; +import { CredentialService } from "../credential.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + typeField: "exampleTypeField", +}; +const CREATE_RESULT = { + id: 42, + typeField: "exampleTypeField", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + typeField: "exampleTypeField", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + typeField: "exampleTypeField", +}; + +const service = { + createCredential() { + return CREATE_RESULT; + }, + credentials: () => FIND_MANY_RESULT, + credential: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Credential", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: CredentialService, + useValue: service, + }, + ], + controllers: [CredentialController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /credentials", async () => { + await request(app.getHttpServer()) + .post("/credentials") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /credentials", async () => { + await request(app.getHttpServer()) + .get("/credentials") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /credentials/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/credentials"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /credentials/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/credentials"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /credentials existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/credentials") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/credentials") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/credential/base/credential.controller.base.ts b/apps/roi-cacl-2/src/credential/base/credential.controller.base.ts new file mode 100644 index 0000000..5b5c93c --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/credential.controller.base.ts @@ -0,0 +1,320 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { CredentialService } from "../credential.service"; +import { CredentialCreateInput } from "./CredentialCreateInput"; +import { Credential } from "./Credential"; +import { CredentialFindManyArgs } from "./CredentialFindManyArgs"; +import { CredentialWhereUniqueInput } from "./CredentialWhereUniqueInput"; +import { CredentialUpdateInput } from "./CredentialUpdateInput"; +import { DestinationCalendarFindManyArgs } from "../../destinationCalendar/base/DestinationCalendarFindManyArgs"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; + +export class CredentialControllerBase { + constructor(protected readonly service: CredentialService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Credential }) + async createCredential( + @common.Body() data: CredentialCreateInput + ): Promise<Credential> { + return await this.service.createCredential({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + appField: data.appField + ? { + connect: data.appField, + } + : undefined, + }, + select: { + id: true, + typeField: true, + key: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Credential] }) + @ApiNestedQuery(CredentialFindManyArgs) + async credentials(@common.Req() request: Request): Promise<Credential[]> { + const args = plainToClass(CredentialFindManyArgs, request.query); + return this.service.credentials({ + ...args, + select: { + id: true, + typeField: true, + key: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Credential }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async credential( + @common.Param() params: CredentialWhereUniqueInput + ): Promise<Credential | null> { + const result = await this.service.credential({ + where: params, + select: { + id: true, + typeField: true, + key: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Credential }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateCredential( + @common.Param() params: CredentialWhereUniqueInput, + @common.Body() data: CredentialUpdateInput + ): Promise<Credential | null> { + try { + return await this.service.updateCredential({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + appField: data.appField + ? { + connect: data.appField, + } + : undefined, + }, + select: { + id: true, + typeField: true, + key: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Credential }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteCredential( + @common.Param() params: CredentialWhereUniqueInput + ): Promise<Credential | null> { + try { + return await this.service.deleteCredential({ + where: params, + select: { + id: true, + typeField: true, + key: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/destinationCalendars") + @ApiNestedQuery(DestinationCalendarFindManyArgs) + async findDestinationCalendars( + @common.Req() request: Request, + @common.Param() params: CredentialWhereUniqueInput + ): Promise<DestinationCalendar[]> { + const query = plainToClass(DestinationCalendarFindManyArgs, request.query); + const results = await this.service.findDestinationCalendars(params.id, { + ...query, + select: { + id: true, + integration: true, + externalId: true, + + user: { + select: { + id: true, + }, + }, + + booking: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + credential: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/destinationCalendars") + async connectDestinationCalendars( + @common.Param() params: CredentialWhereUniqueInput, + @common.Body() body: DestinationCalendarWhereUniqueInput[] + ): Promise<void> { + const data = { + destinationCalendars: { + connect: body, + }, + }; + await this.service.updateCredential({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/destinationCalendars") + async updateDestinationCalendars( + @common.Param() params: CredentialWhereUniqueInput, + @common.Body() body: DestinationCalendarWhereUniqueInput[] + ): Promise<void> { + const data = { + destinationCalendars: { + set: body, + }, + }; + await this.service.updateCredential({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/destinationCalendars") + async disconnectDestinationCalendars( + @common.Param() params: CredentialWhereUniqueInput, + @common.Body() body: DestinationCalendarWhereUniqueInput[] + ): Promise<void> { + const data = { + destinationCalendars: { + disconnect: body, + }, + }; + await this.service.updateCredential({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/credential/base/credential.module.base.ts b/apps/roi-cacl-2/src/credential/base/credential.module.base.ts new file mode 100644 index 0000000..5676762 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/credential.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class CredentialModuleBase {} diff --git a/apps/roi-cacl-2/src/credential/base/credential.resolver.base.ts b/apps/roi-cacl-2/src/credential/base/credential.resolver.base.ts new file mode 100644 index 0000000..6733da0 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/credential.resolver.base.ts @@ -0,0 +1,178 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Credential } from "./Credential"; +import { CredentialCountArgs } from "./CredentialCountArgs"; +import { CredentialFindManyArgs } from "./CredentialFindManyArgs"; +import { CredentialFindUniqueArgs } from "./CredentialFindUniqueArgs"; +import { CreateCredentialArgs } from "./CreateCredentialArgs"; +import { UpdateCredentialArgs } from "./UpdateCredentialArgs"; +import { DeleteCredentialArgs } from "./DeleteCredentialArgs"; +import { DestinationCalendarFindManyArgs } from "../../destinationCalendar/base/DestinationCalendarFindManyArgs"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { User } from "../../user/base/User"; +import { AppModel } from "../../appModel/base/AppModel"; +import { CredentialService } from "../credential.service"; +@graphql.Resolver(() => Credential) +export class CredentialResolverBase { + constructor(protected readonly service: CredentialService) {} + + async _credentialsMeta( + @graphql.Args() args: CredentialCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Credential]) + async credentials( + @graphql.Args() args: CredentialFindManyArgs + ): Promise<Credential[]> { + return this.service.credentials(args); + } + + @graphql.Query(() => Credential, { nullable: true }) + async credential( + @graphql.Args() args: CredentialFindUniqueArgs + ): Promise<Credential | null> { + const result = await this.service.credential(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Credential) + async createCredential( + @graphql.Args() args: CreateCredentialArgs + ): Promise<Credential> { + return await this.service.createCredential({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + appField: args.data.appField + ? { + connect: args.data.appField, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Credential) + async updateCredential( + @graphql.Args() args: UpdateCredentialArgs + ): Promise<Credential | null> { + try { + return await this.service.updateCredential({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + appField: args.data.appField + ? { + connect: args.data.appField, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Credential) + async deleteCredential( + @graphql.Args() args: DeleteCredentialArgs + ): Promise<Credential | null> { + try { + return await this.service.deleteCredential(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [DestinationCalendar], { + name: "destinationCalendars", + }) + async findDestinationCalendars( + @graphql.Parent() parent: Credential, + @graphql.Args() args: DestinationCalendarFindManyArgs + ): Promise<DestinationCalendar[]> { + const results = await this.service.findDestinationCalendars( + parent.id, + args + ); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Credential): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => AppModel, { + nullable: true, + name: "appField", + }) + async getAppField( + @graphql.Parent() parent: Credential + ): Promise<AppModel | null> { + const result = await this.service.getAppField(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/credential/base/credential.service.base.ts b/apps/roi-cacl-2/src/credential/base/credential.service.base.ts new file mode 100644 index 0000000..1aad077 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/base/credential.service.base.ts @@ -0,0 +1,83 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Credential as PrismaCredential, + DestinationCalendar as PrismaDestinationCalendar, + User as PrismaUser, + AppModel as PrismaAppModel, +} from "@prisma/client"; + +export class CredentialServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.CredentialCountArgs, "select"> + ): Promise<number> { + return this.prisma.credential.count(args); + } + + async credentials<T extends Prisma.CredentialFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.CredentialFindManyArgs> + ): Promise<PrismaCredential[]> { + return this.prisma.credential.findMany<Prisma.CredentialFindManyArgs>(args); + } + async credential<T extends Prisma.CredentialFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.CredentialFindUniqueArgs> + ): Promise<PrismaCredential | null> { + return this.prisma.credential.findUnique(args); + } + async createCredential<T extends Prisma.CredentialCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.CredentialCreateArgs> + ): Promise<PrismaCredential> { + return this.prisma.credential.create<T>(args); + } + async updateCredential<T extends Prisma.CredentialUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.CredentialUpdateArgs> + ): Promise<PrismaCredential> { + return this.prisma.credential.update<T>(args); + } + async deleteCredential<T extends Prisma.CredentialDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.CredentialDeleteArgs> + ): Promise<PrismaCredential> { + return this.prisma.credential.delete(args); + } + + async findDestinationCalendars( + parentId: number, + args: Prisma.DestinationCalendarFindManyArgs + ): Promise<PrismaDestinationCalendar[]> { + return this.prisma.credential + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .destinationCalendars(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.credential + .findUnique({ + where: { id: parentId }, + }) + .user(); + } + + async getAppField(parentId: number): Promise<PrismaAppModel | null> { + return this.prisma.credential + .findUnique({ + where: { id: parentId }, + }) + .appField(); + } +} diff --git a/apps/roi-cacl-2/src/credential/credential.controller.ts b/apps/roi-cacl-2/src/credential/credential.controller.ts new file mode 100644 index 0000000..5a108e1 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/credential.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { CredentialService } from "./credential.service"; +import { CredentialControllerBase } from "./base/credential.controller.base"; + +@swagger.ApiTags("credentials") +@common.Controller("credentials") +export class CredentialController extends CredentialControllerBase { + constructor(protected readonly service: CredentialService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/credential/credential.module.ts b/apps/roi-cacl-2/src/credential/credential.module.ts new file mode 100644 index 0000000..01e2a08 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/credential.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { CredentialModuleBase } from "./base/credential.module.base"; +import { CredentialService } from "./credential.service"; +import { CredentialController } from "./credential.controller"; +import { CredentialResolver } from "./credential.resolver"; + +@Module({ + imports: [CredentialModuleBase], + controllers: [CredentialController], + providers: [CredentialService, CredentialResolver], + exports: [CredentialService], +}) +export class CredentialModule {} diff --git a/apps/roi-cacl-2/src/credential/credential.resolver.ts b/apps/roi-cacl-2/src/credential/credential.resolver.ts new file mode 100644 index 0000000..a812954 --- /dev/null +++ b/apps/roi-cacl-2/src/credential/credential.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { CredentialResolverBase } from "./base/credential.resolver.base"; +import { Credential } from "./base/Credential"; +import { CredentialService } from "./credential.service"; + +@graphql.Resolver(() => Credential) +export class CredentialResolver extends CredentialResolverBase { + constructor(protected readonly service: CredentialService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/credential/credential.service.ts b/apps/roi-cacl-2/src/credential/credential.service.ts new file mode 100644 index 0000000..f11d66e --- /dev/null +++ b/apps/roi-cacl-2/src/credential/credential.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { CredentialServiceBase } from "./base/credential.service.base"; + +@Injectable() +export class CredentialService extends CredentialServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/CreateDailyEventReferenceArgs.ts b/apps/roi-cacl-2/src/dailyEventReference/base/CreateDailyEventReferenceArgs.ts new file mode 100644 index 0000000..e168a3a --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/CreateDailyEventReferenceArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DailyEventReferenceCreateInput } from "./DailyEventReferenceCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateDailyEventReferenceArgs { + @ApiProperty({ + required: true, + type: () => DailyEventReferenceCreateInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceCreateInput) + @Field(() => DailyEventReferenceCreateInput, { nullable: false }) + data!: DailyEventReferenceCreateInput; +} + +export { CreateDailyEventReferenceArgs as CreateDailyEventReferenceArgs }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReference.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReference.ts new file mode 100644 index 0000000..ad8a367 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReference.ts @@ -0,0 +1,54 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsString, ValidateNested, IsOptional } from "class-validator"; +import { Booking } from "../../booking/base/Booking"; +import { Type } from "class-transformer"; + +@ObjectType() +class DailyEventReference { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + dailyurl!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + dailytoken!: string; + + @ApiProperty({ + required: false, + type: () => Booking, + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + booking?: Booking | null; +} + +export { DailyEventReference as DailyEventReference }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCountArgs.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCountArgs.ts new file mode 100644 index 0000000..6579af1 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DailyEventReferenceWhereInput } from "./DailyEventReferenceWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class DailyEventReferenceCountArgs { + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereInput, + }) + @Field(() => DailyEventReferenceWhereInput, { nullable: true }) + @Type(() => DailyEventReferenceWhereInput) + where?: DailyEventReferenceWhereInput; +} + +export { DailyEventReferenceCountArgs as DailyEventReferenceCountArgs }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCreateInput.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCreateInput.ts new file mode 100644 index 0000000..80a1c37 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceCreateInput.ts @@ -0,0 +1,49 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, ValidateNested, IsOptional } from "class-validator"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class DailyEventReferenceCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + dailyurl!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + dailytoken!: string; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; +} + +export { DailyEventReferenceCreateInput as DailyEventReferenceCreateInput }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindManyArgs.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindManyArgs.ts new file mode 100644 index 0000000..2c49e40 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DailyEventReferenceWhereInput } from "./DailyEventReferenceWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { DailyEventReferenceOrderByInput } from "./DailyEventReferenceOrderByInput"; + +@ArgsType() +class DailyEventReferenceFindManyArgs { + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => DailyEventReferenceWhereInput, { nullable: true }) + @Type(() => DailyEventReferenceWhereInput) + where?: DailyEventReferenceWhereInput; + + @ApiProperty({ + required: false, + type: [DailyEventReferenceOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [DailyEventReferenceOrderByInput], { nullable: true }) + @Type(() => DailyEventReferenceOrderByInput) + orderBy?: Array<DailyEventReferenceOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { DailyEventReferenceFindManyArgs as DailyEventReferenceFindManyArgs }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindUniqueArgs.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindUniqueArgs.ts new file mode 100644 index 0000000..30b2b28 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DailyEventReferenceWhereUniqueInput } from "./DailyEventReferenceWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DailyEventReferenceFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => DailyEventReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereUniqueInput) + @Field(() => DailyEventReferenceWhereUniqueInput, { nullable: false }) + where!: DailyEventReferenceWhereUniqueInput; +} + +export { DailyEventReferenceFindUniqueArgs as DailyEventReferenceFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceListRelationFilter.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceListRelationFilter.ts new file mode 100644 index 0000000..33fa411 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DailyEventReferenceWhereInput } from "./DailyEventReferenceWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class DailyEventReferenceListRelationFilter { + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereInput) + @IsOptional() + @Field(() => DailyEventReferenceWhereInput, { + nullable: true, + }) + every?: DailyEventReferenceWhereInput; + + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereInput) + @IsOptional() + @Field(() => DailyEventReferenceWhereInput, { + nullable: true, + }) + some?: DailyEventReferenceWhereInput; + + @ApiProperty({ + required: false, + type: () => DailyEventReferenceWhereInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereInput) + @IsOptional() + @Field(() => DailyEventReferenceWhereInput, { + nullable: true, + }) + none?: DailyEventReferenceWhereInput; +} +export { DailyEventReferenceListRelationFilter as DailyEventReferenceListRelationFilter }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceOrderByInput.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceOrderByInput.ts new file mode 100644 index 0000000..f3a1bcd --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceOrderByInput.ts @@ -0,0 +1,67 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class DailyEventReferenceOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + dailyurl?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + dailytoken?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bookingId?: SortOrder; +} + +export { DailyEventReferenceOrderByInput as DailyEventReferenceOrderByInput }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceUpdateInput.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceUpdateInput.ts new file mode 100644 index 0000000..34794d9 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceUpdateInput.ts @@ -0,0 +1,55 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, ValidateNested } from "class-validator"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class DailyEventReferenceUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dailyurl?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + dailytoken?: string; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; +} + +export { DailyEventReferenceUpdateInput as DailyEventReferenceUpdateInput }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereInput.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereInput.ts new file mode 100644 index 0000000..0807230 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereInput.ts @@ -0,0 +1,68 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; + +@InputType() +class DailyEventReferenceWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + dailyurl?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + dailytoken?: StringFilter; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput; +} + +export { DailyEventReferenceWhereInput as DailyEventReferenceWhereInput }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereUniqueInput.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereUniqueInput.ts new file mode 100644 index 0000000..cc96d74 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DailyEventReferenceWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class DailyEventReferenceWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { DailyEventReferenceWhereUniqueInput as DailyEventReferenceWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/DeleteDailyEventReferenceArgs.ts b/apps/roi-cacl-2/src/dailyEventReference/base/DeleteDailyEventReferenceArgs.ts new file mode 100644 index 0000000..ffc9641 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/DeleteDailyEventReferenceArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DailyEventReferenceWhereUniqueInput } from "./DailyEventReferenceWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteDailyEventReferenceArgs { + @ApiProperty({ + required: true, + type: () => DailyEventReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereUniqueInput) + @Field(() => DailyEventReferenceWhereUniqueInput, { nullable: false }) + where!: DailyEventReferenceWhereUniqueInput; +} + +export { DeleteDailyEventReferenceArgs as DeleteDailyEventReferenceArgs }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/UpdateDailyEventReferenceArgs.ts b/apps/roi-cacl-2/src/dailyEventReference/base/UpdateDailyEventReferenceArgs.ts new file mode 100644 index 0000000..2f50b7e --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/UpdateDailyEventReferenceArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DailyEventReferenceWhereUniqueInput } from "./DailyEventReferenceWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { DailyEventReferenceUpdateInput } from "./DailyEventReferenceUpdateInput"; + +@ArgsType() +class UpdateDailyEventReferenceArgs { + @ApiProperty({ + required: true, + type: () => DailyEventReferenceWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceWhereUniqueInput) + @Field(() => DailyEventReferenceWhereUniqueInput, { nullable: false }) + where!: DailyEventReferenceWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => DailyEventReferenceUpdateInput, + }) + @ValidateNested() + @Type(() => DailyEventReferenceUpdateInput) + @Field(() => DailyEventReferenceUpdateInput, { nullable: false }) + data!: DailyEventReferenceUpdateInput; +} + +export { UpdateDailyEventReferenceArgs as UpdateDailyEventReferenceArgs }; diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.spec.ts b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.spec.ts new file mode 100644 index 0000000..6f97833 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.spec.ts @@ -0,0 +1,172 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { DailyEventReferenceController } from "../dailyEventReference.controller"; +import { DailyEventReferenceService } from "../dailyEventReference.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + dailyurl: "exampleDailyurl", + dailytoken: "exampleDailytoken", +}; +const CREATE_RESULT = { + id: 42, + dailyurl: "exampleDailyurl", + dailytoken: "exampleDailytoken", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + dailyurl: "exampleDailyurl", + dailytoken: "exampleDailytoken", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + dailyurl: "exampleDailyurl", + dailytoken: "exampleDailytoken", +}; + +const service = { + createDailyEventReference() { + return CREATE_RESULT; + }, + dailyEventReferences: () => FIND_MANY_RESULT, + dailyEventReference: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("DailyEventReference", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: DailyEventReferenceService, + useValue: service, + }, + ], + controllers: [DailyEventReferenceController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /dailyEventReferences", async () => { + await request(app.getHttpServer()) + .post("/dailyEventReferences") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /dailyEventReferences", async () => { + await request(app.getHttpServer()) + .get("/dailyEventReferences") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /dailyEventReferences/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/dailyEventReferences"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /dailyEventReferences/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/dailyEventReferences"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /dailyEventReferences existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/dailyEventReferences") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/dailyEventReferences") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.ts b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.ts new file mode 100644 index 0000000..68359d3 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.controller.base.ts @@ -0,0 +1,179 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { DailyEventReferenceService } from "../dailyEventReference.service"; +import { DailyEventReferenceCreateInput } from "./DailyEventReferenceCreateInput"; +import { DailyEventReference } from "./DailyEventReference"; +import { DailyEventReferenceFindManyArgs } from "./DailyEventReferenceFindManyArgs"; +import { DailyEventReferenceWhereUniqueInput } from "./DailyEventReferenceWhereUniqueInput"; +import { DailyEventReferenceUpdateInput } from "./DailyEventReferenceUpdateInput"; + +export class DailyEventReferenceControllerBase { + constructor(protected readonly service: DailyEventReferenceService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: DailyEventReference }) + async createDailyEventReference( + @common.Body() data: DailyEventReferenceCreateInput + ): Promise<DailyEventReference> { + return await this.service.createDailyEventReference({ + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + dailyurl: true, + dailytoken: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [DailyEventReference] }) + @ApiNestedQuery(DailyEventReferenceFindManyArgs) + async dailyEventReferences( + @common.Req() request: Request + ): Promise<DailyEventReference[]> { + const args = plainToClass(DailyEventReferenceFindManyArgs, request.query); + return this.service.dailyEventReferences({ + ...args, + select: { + id: true, + dailyurl: true, + dailytoken: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: DailyEventReference }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async dailyEventReference( + @common.Param() params: DailyEventReferenceWhereUniqueInput + ): Promise<DailyEventReference | null> { + const result = await this.service.dailyEventReference({ + where: params, + select: { + id: true, + dailyurl: true, + dailytoken: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: DailyEventReference }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateDailyEventReference( + @common.Param() params: DailyEventReferenceWhereUniqueInput, + @common.Body() data: DailyEventReferenceUpdateInput + ): Promise<DailyEventReference | null> { + try { + return await this.service.updateDailyEventReference({ + where: params, + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + dailyurl: true, + dailytoken: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: DailyEventReference }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteDailyEventReference( + @common.Param() params: DailyEventReferenceWhereUniqueInput + ): Promise<DailyEventReference | null> { + try { + return await this.service.deleteDailyEventReference({ + where: params, + select: { + id: true, + dailyurl: true, + dailytoken: true, + + booking: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.module.base.ts b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.module.base.ts new file mode 100644 index 0000000..b28a1aa --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class DailyEventReferenceModuleBase {} diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.resolver.base.ts b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.resolver.base.ts new file mode 100644 index 0000000..04d25fe --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.resolver.base.ts @@ -0,0 +1,131 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { DailyEventReference } from "./DailyEventReference"; +import { DailyEventReferenceCountArgs } from "./DailyEventReferenceCountArgs"; +import { DailyEventReferenceFindManyArgs } from "./DailyEventReferenceFindManyArgs"; +import { DailyEventReferenceFindUniqueArgs } from "./DailyEventReferenceFindUniqueArgs"; +import { CreateDailyEventReferenceArgs } from "./CreateDailyEventReferenceArgs"; +import { UpdateDailyEventReferenceArgs } from "./UpdateDailyEventReferenceArgs"; +import { DeleteDailyEventReferenceArgs } from "./DeleteDailyEventReferenceArgs"; +import { Booking } from "../../booking/base/Booking"; +import { DailyEventReferenceService } from "../dailyEventReference.service"; +@graphql.Resolver(() => DailyEventReference) +export class DailyEventReferenceResolverBase { + constructor(protected readonly service: DailyEventReferenceService) {} + + async _dailyEventReferencesMeta( + @graphql.Args() args: DailyEventReferenceCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [DailyEventReference]) + async dailyEventReferences( + @graphql.Args() args: DailyEventReferenceFindManyArgs + ): Promise<DailyEventReference[]> { + return this.service.dailyEventReferences(args); + } + + @graphql.Query(() => DailyEventReference, { nullable: true }) + async dailyEventReference( + @graphql.Args() args: DailyEventReferenceFindUniqueArgs + ): Promise<DailyEventReference | null> { + const result = await this.service.dailyEventReference(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => DailyEventReference) + async createDailyEventReference( + @graphql.Args() args: CreateDailyEventReferenceArgs + ): Promise<DailyEventReference> { + return await this.service.createDailyEventReference({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => DailyEventReference) + async updateDailyEventReference( + @graphql.Args() args: UpdateDailyEventReferenceArgs + ): Promise<DailyEventReference | null> { + try { + return await this.service.updateDailyEventReference({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => DailyEventReference) + async deleteDailyEventReference( + @graphql.Args() args: DeleteDailyEventReferenceArgs + ): Promise<DailyEventReference | null> { + try { + return await this.service.deleteDailyEventReference(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => Booking, { + nullable: true, + name: "booking", + }) + async getBooking( + @graphql.Parent() parent: DailyEventReference + ): Promise<Booking | null> { + const result = await this.service.getBooking(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.service.base.ts b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.service.base.ts new file mode 100644 index 0000000..da2d882 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/base/dailyEventReference.service.base.ts @@ -0,0 +1,70 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + DailyEventReference as PrismaDailyEventReference, + Booking as PrismaBooking, +} from "@prisma/client"; + +export class DailyEventReferenceServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.DailyEventReferenceCountArgs, "select"> + ): Promise<number> { + return this.prisma.dailyEventReference.count(args); + } + + async dailyEventReferences<T extends Prisma.DailyEventReferenceFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.DailyEventReferenceFindManyArgs> + ): Promise<PrismaDailyEventReference[]> { + return this.prisma.dailyEventReference.findMany<Prisma.DailyEventReferenceFindManyArgs>( + args + ); + } + async dailyEventReference<T extends Prisma.DailyEventReferenceFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.DailyEventReferenceFindUniqueArgs> + ): Promise<PrismaDailyEventReference | null> { + return this.prisma.dailyEventReference.findUnique(args); + } + async createDailyEventReference< + T extends Prisma.DailyEventReferenceCreateArgs + >( + args: Prisma.SelectSubset<T, Prisma.DailyEventReferenceCreateArgs> + ): Promise<PrismaDailyEventReference> { + return this.prisma.dailyEventReference.create<T>(args); + } + async updateDailyEventReference< + T extends Prisma.DailyEventReferenceUpdateArgs + >( + args: Prisma.SelectSubset<T, Prisma.DailyEventReferenceUpdateArgs> + ): Promise<PrismaDailyEventReference> { + return this.prisma.dailyEventReference.update<T>(args); + } + async deleteDailyEventReference< + T extends Prisma.DailyEventReferenceDeleteArgs + >( + args: Prisma.SelectSubset<T, Prisma.DailyEventReferenceDeleteArgs> + ): Promise<PrismaDailyEventReference> { + return this.prisma.dailyEventReference.delete(args); + } + + async getBooking(parentId: number): Promise<PrismaBooking | null> { + return this.prisma.dailyEventReference + .findUnique({ + where: { id: parentId }, + }) + .booking(); + } +} diff --git a/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.controller.ts b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.controller.ts new file mode 100644 index 0000000..70a3e8b --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { DailyEventReferenceService } from "./dailyEventReference.service"; +import { DailyEventReferenceControllerBase } from "./base/dailyEventReference.controller.base"; + +@swagger.ApiTags("dailyEventReferences") +@common.Controller("dailyEventReferences") +export class DailyEventReferenceController extends DailyEventReferenceControllerBase { + constructor(protected readonly service: DailyEventReferenceService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.module.ts b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.module.ts new file mode 100644 index 0000000..4ca3135 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { DailyEventReferenceModuleBase } from "./base/dailyEventReference.module.base"; +import { DailyEventReferenceService } from "./dailyEventReference.service"; +import { DailyEventReferenceController } from "./dailyEventReference.controller"; +import { DailyEventReferenceResolver } from "./dailyEventReference.resolver"; + +@Module({ + imports: [DailyEventReferenceModuleBase], + controllers: [DailyEventReferenceController], + providers: [DailyEventReferenceService, DailyEventReferenceResolver], + exports: [DailyEventReferenceService], +}) +export class DailyEventReferenceModule {} diff --git a/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.resolver.ts b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.resolver.ts new file mode 100644 index 0000000..d75e8e3 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { DailyEventReferenceResolverBase } from "./base/dailyEventReference.resolver.base"; +import { DailyEventReference } from "./base/DailyEventReference"; +import { DailyEventReferenceService } from "./dailyEventReference.service"; + +@graphql.Resolver(() => DailyEventReference) +export class DailyEventReferenceResolver extends DailyEventReferenceResolverBase { + constructor(protected readonly service: DailyEventReferenceService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.service.ts b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.service.ts new file mode 100644 index 0000000..b455dd2 --- /dev/null +++ b/apps/roi-cacl-2/src/dailyEventReference/dailyEventReference.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { DailyEventReferenceServiceBase } from "./base/dailyEventReference.service.base"; + +@Injectable() +export class DailyEventReferenceService extends DailyEventReferenceServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/decorators/api-nested-query.decorator.ts b/apps/roi-cacl-2/src/decorators/api-nested-query.decorator.ts new file mode 100644 index 0000000..9fd5ba3 --- /dev/null +++ b/apps/roi-cacl-2/src/decorators/api-nested-query.decorator.ts @@ -0,0 +1,80 @@ +import { applyDecorators } from "@nestjs/common"; +import { + ApiExtraModels, + ApiQuery, + ApiQueryOptions, + getSchemaPath, +} from "@nestjs/swagger"; +import "reflect-metadata"; + +const generateApiQueryObject = ( + prop: any, + propType: any, + required: boolean, + isArray: boolean +): ApiQueryOptions => { + if (propType === Number) { + return { + required, + name: prop, + style: "deepObject", + explode: true, + type: "number", + isArray, + }; + } else if (propType === String) { + return { + required, + name: prop, + style: "deepObject", + explode: true, + type: "string", + isArray, + }; + } else { + return { + required, + name: prop, + style: "deepObject", + explode: true, + type: "object", + isArray, + schema: { + $ref: getSchemaPath(propType), + }, + }; + } +}; + +// eslint-disable-next-line @typescript-eslint/ban-types,@typescript-eslint/explicit-module-boundary-types,@typescript-eslint/naming-convention +export function ApiNestedQuery(query: Function) { + const constructor = query.prototype; + const properties = Reflect.getMetadata( + "swagger/apiModelPropertiesArray", + constructor + ).map((prop: any) => prop.slice(1)); + + const decorators = properties + .map((property: any) => { + const { required, isArray } = Reflect.getMetadata( + "swagger/apiModelProperties", + constructor, + property + ); + const propertyType = Reflect.getMetadata( + "design:type", + constructor, + property + ); + const typedQuery = generateApiQueryObject( + property, + propertyType, + required, + isArray + ); + return [ApiExtraModels(propertyType), ApiQuery(typedQuery)]; + }) + .flat(); + + return applyDecorators(...decorators); +} diff --git a/apps/roi-cacl-2/src/decorators/public.decorator.ts b/apps/roi-cacl-2/src/decorators/public.decorator.ts new file mode 100644 index 0000000..9eab4e0 --- /dev/null +++ b/apps/roi-cacl-2/src/decorators/public.decorator.ts @@ -0,0 +1,10 @@ +import { applyDecorators, SetMetadata } from "@nestjs/common"; + +export const IS_PUBLIC_KEY = "isPublic"; + +const PublicAuthMiddleware = SetMetadata(IS_PUBLIC_KEY, true); +const PublicAuthSwagger = SetMetadata("swagger/apiSecurity", ["isPublic"]); + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +export const Public = () => + applyDecorators(PublicAuthMiddleware, PublicAuthSwagger); diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/CreateDestinationCalendarArgs.ts b/apps/roi-cacl-2/src/destinationCalendar/base/CreateDestinationCalendarArgs.ts new file mode 100644 index 0000000..a8ba3a2 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/CreateDestinationCalendarArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DestinationCalendarCreateInput } from "./DestinationCalendarCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateDestinationCalendarArgs { + @ApiProperty({ + required: true, + type: () => DestinationCalendarCreateInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarCreateInput) + @Field(() => DestinationCalendarCreateInput, { nullable: false }) + data!: DestinationCalendarCreateInput; +} + +export { CreateDestinationCalendarArgs as CreateDestinationCalendarArgs }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DeleteDestinationCalendarArgs.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DeleteDestinationCalendarArgs.ts new file mode 100644 index 0000000..3eac494 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DeleteDestinationCalendarArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DestinationCalendarWhereUniqueInput } from "./DestinationCalendarWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteDestinationCalendarArgs { + @ApiProperty({ + required: true, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @Field(() => DestinationCalendarWhereUniqueInput, { nullable: false }) + where!: DestinationCalendarWhereUniqueInput; +} + +export { DeleteDestinationCalendarArgs as DeleteDestinationCalendarArgs }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendar.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendar.ts new file mode 100644 index 0000000..09c5959 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendar.ts @@ -0,0 +1,84 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsString, ValidateNested, IsOptional } from "class-validator"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; +import { Booking } from "../../booking/base/Booking"; +import { EventType } from "../../eventType/base/EventType"; +import { Credential } from "../../credential/base/Credential"; + +@ObjectType() +class DestinationCalendar { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + integration!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + externalId!: string; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; + + @ApiProperty({ + required: false, + type: () => Booking, + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + booking?: Booking | null; + + @ApiProperty({ + required: false, + type: () => EventType, + }) + @ValidateNested() + @Type(() => EventType) + @IsOptional() + eventType?: EventType | null; + + @ApiProperty({ + required: false, + type: () => Credential, + }) + @ValidateNested() + @Type(() => Credential) + @IsOptional() + credential?: Credential | null; +} + +export { DestinationCalendar as DestinationCalendar }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCountArgs.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCountArgs.ts new file mode 100644 index 0000000..f5729ab --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DestinationCalendarWhereInput } from "./DestinationCalendarWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class DestinationCalendarCountArgs { + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereInput, + }) + @Field(() => DestinationCalendarWhereInput, { nullable: true }) + @Type(() => DestinationCalendarWhereInput) + where?: DestinationCalendarWhereInput; +} + +export { DestinationCalendarCountArgs as DestinationCalendarCountArgs }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCreateInput.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCreateInput.ts new file mode 100644 index 0000000..4afb999 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarCreateInput.ts @@ -0,0 +1,88 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, ValidateNested, IsOptional } from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; + +@InputType() +class DestinationCalendarCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + integration!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + externalId!: string; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => CredentialWhereUniqueInput, + }) + @ValidateNested() + @Type(() => CredentialWhereUniqueInput) + @IsOptional() + @Field(() => CredentialWhereUniqueInput, { + nullable: true, + }) + credential?: CredentialWhereUniqueInput | null; +} + +export { DestinationCalendarCreateInput as DestinationCalendarCreateInput }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindManyArgs.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindManyArgs.ts new file mode 100644 index 0000000..541e1c6 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DestinationCalendarWhereInput } from "./DestinationCalendarWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { DestinationCalendarOrderByInput } from "./DestinationCalendarOrderByInput"; + +@ArgsType() +class DestinationCalendarFindManyArgs { + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => DestinationCalendarWhereInput, { nullable: true }) + @Type(() => DestinationCalendarWhereInput) + where?: DestinationCalendarWhereInput; + + @ApiProperty({ + required: false, + type: [DestinationCalendarOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [DestinationCalendarOrderByInput], { nullable: true }) + @Type(() => DestinationCalendarOrderByInput) + orderBy?: Array<DestinationCalendarOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { DestinationCalendarFindManyArgs as DestinationCalendarFindManyArgs }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindUniqueArgs.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindUniqueArgs.ts new file mode 100644 index 0000000..07602ba --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DestinationCalendarWhereUniqueInput } from "./DestinationCalendarWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DestinationCalendarFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @Field(() => DestinationCalendarWhereUniqueInput, { nullable: false }) + where!: DestinationCalendarWhereUniqueInput; +} + +export { DestinationCalendarFindUniqueArgs as DestinationCalendarFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarListRelationFilter.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarListRelationFilter.ts new file mode 100644 index 0000000..5885016 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DestinationCalendarWhereInput } from "./DestinationCalendarWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class DestinationCalendarListRelationFilter { + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereInput) + @IsOptional() + @Field(() => DestinationCalendarWhereInput, { + nullable: true, + }) + every?: DestinationCalendarWhereInput; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereInput) + @IsOptional() + @Field(() => DestinationCalendarWhereInput, { + nullable: true, + }) + some?: DestinationCalendarWhereInput; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereInput) + @IsOptional() + @Field(() => DestinationCalendarWhereInput, { + nullable: true, + }) + none?: DestinationCalendarWhereInput; +} +export { DestinationCalendarListRelationFilter as DestinationCalendarListRelationFilter }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarOrderByInput.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarOrderByInput.ts new file mode 100644 index 0000000..2930da3 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarOrderByInput.ts @@ -0,0 +1,100 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class DestinationCalendarOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + integration?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + externalId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bookingId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTypeId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + credentialId?: SortOrder; +} + +export { DestinationCalendarOrderByInput as DestinationCalendarOrderByInput }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarUpdateInput.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarUpdateInput.ts new file mode 100644 index 0000000..8cdd3ce --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarUpdateInput.ts @@ -0,0 +1,94 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, ValidateNested } from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; + +@InputType() +class DestinationCalendarUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + integration?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + externalId?: string; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => CredentialWhereUniqueInput, + }) + @ValidateNested() + @Type(() => CredentialWhereUniqueInput) + @IsOptional() + @Field(() => CredentialWhereUniqueInput, { + nullable: true, + }) + credential?: CredentialWhereUniqueInput | null; +} + +export { DestinationCalendarUpdateInput as DestinationCalendarUpdateInput }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereInput.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereInput.ts new file mode 100644 index 0000000..07bb874 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereInput.ts @@ -0,0 +1,107 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; + +@InputType() +class DestinationCalendarWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + integration?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + externalId?: StringFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => CredentialWhereUniqueInput, + }) + @ValidateNested() + @Type(() => CredentialWhereUniqueInput) + @IsOptional() + @Field(() => CredentialWhereUniqueInput, { + nullable: true, + }) + credential?: CredentialWhereUniqueInput; +} + +export { DestinationCalendarWhereInput as DestinationCalendarWhereInput }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereUniqueInput.ts b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereUniqueInput.ts new file mode 100644 index 0000000..f771929 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/DestinationCalendarWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class DestinationCalendarWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { DestinationCalendarWhereUniqueInput as DestinationCalendarWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/UpdateDestinationCalendarArgs.ts b/apps/roi-cacl-2/src/destinationCalendar/base/UpdateDestinationCalendarArgs.ts new file mode 100644 index 0000000..ff85c09 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/UpdateDestinationCalendarArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { DestinationCalendarWhereUniqueInput } from "./DestinationCalendarWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { DestinationCalendarUpdateInput } from "./DestinationCalendarUpdateInput"; + +@ArgsType() +class UpdateDestinationCalendarArgs { + @ApiProperty({ + required: true, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @Field(() => DestinationCalendarWhereUniqueInput, { nullable: false }) + where!: DestinationCalendarWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => DestinationCalendarUpdateInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarUpdateInput) + @Field(() => DestinationCalendarUpdateInput, { nullable: false }) + data!: DestinationCalendarUpdateInput; +} + +export { UpdateDestinationCalendarArgs as UpdateDestinationCalendarArgs }; diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.spec.ts b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.spec.ts new file mode 100644 index 0000000..aaeb909 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.spec.ts @@ -0,0 +1,172 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { DestinationCalendarController } from "../destinationCalendar.controller"; +import { DestinationCalendarService } from "../destinationCalendar.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", +}; +const CREATE_RESULT = { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", +}; + +const service = { + createDestinationCalendar() { + return CREATE_RESULT; + }, + destinationCalendars: () => FIND_MANY_RESULT, + destinationCalendar: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("DestinationCalendar", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: DestinationCalendarService, + useValue: service, + }, + ], + controllers: [DestinationCalendarController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /destinationCalendars", async () => { + await request(app.getHttpServer()) + .post("/destinationCalendars") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /destinationCalendars", async () => { + await request(app.getHttpServer()) + .get("/destinationCalendars") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /destinationCalendars/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/destinationCalendars"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /destinationCalendars/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/destinationCalendars"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /destinationCalendars existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/destinationCalendars") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/destinationCalendars") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.ts b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.ts new file mode 100644 index 0000000..045fbbe --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.controller.base.ts @@ -0,0 +1,305 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { DestinationCalendarService } from "../destinationCalendar.service"; +import { DestinationCalendarCreateInput } from "./DestinationCalendarCreateInput"; +import { DestinationCalendar } from "./DestinationCalendar"; +import { DestinationCalendarFindManyArgs } from "./DestinationCalendarFindManyArgs"; +import { DestinationCalendarWhereUniqueInput } from "./DestinationCalendarWhereUniqueInput"; +import { DestinationCalendarUpdateInput } from "./DestinationCalendarUpdateInput"; + +export class DestinationCalendarControllerBase { + constructor(protected readonly service: DestinationCalendarService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: DestinationCalendar }) + async createDestinationCalendar( + @common.Body() data: DestinationCalendarCreateInput + ): Promise<DestinationCalendar> { + return await this.service.createDestinationCalendar({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + credential: data.credential + ? { + connect: data.credential, + } + : undefined, + }, + select: { + id: true, + integration: true, + externalId: true, + + user: { + select: { + id: true, + }, + }, + + booking: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + credential: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [DestinationCalendar] }) + @ApiNestedQuery(DestinationCalendarFindManyArgs) + async destinationCalendars( + @common.Req() request: Request + ): Promise<DestinationCalendar[]> { + const args = plainToClass(DestinationCalendarFindManyArgs, request.query); + return this.service.destinationCalendars({ + ...args, + select: { + id: true, + integration: true, + externalId: true, + + user: { + select: { + id: true, + }, + }, + + booking: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + credential: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: DestinationCalendar }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async destinationCalendar( + @common.Param() params: DestinationCalendarWhereUniqueInput + ): Promise<DestinationCalendar | null> { + const result = await this.service.destinationCalendar({ + where: params, + select: { + id: true, + integration: true, + externalId: true, + + user: { + select: { + id: true, + }, + }, + + booking: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + credential: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: DestinationCalendar }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateDestinationCalendar( + @common.Param() params: DestinationCalendarWhereUniqueInput, + @common.Body() data: DestinationCalendarUpdateInput + ): Promise<DestinationCalendar | null> { + try { + return await this.service.updateDestinationCalendar({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + credential: data.credential + ? { + connect: data.credential, + } + : undefined, + }, + select: { + id: true, + integration: true, + externalId: true, + + user: { + select: { + id: true, + }, + }, + + booking: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + credential: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: DestinationCalendar }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteDestinationCalendar( + @common.Param() params: DestinationCalendarWhereUniqueInput + ): Promise<DestinationCalendar | null> { + try { + return await this.service.deleteDestinationCalendar({ + where: params, + select: { + id: true, + integration: true, + externalId: true, + + user: { + select: { + id: true, + }, + }, + + booking: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + credential: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.module.base.ts b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.module.base.ts new file mode 100644 index 0000000..beb9734 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class DestinationCalendarModuleBase {} diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.resolver.base.ts b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.resolver.base.ts new file mode 100644 index 0000000..6b490ae --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.resolver.base.ts @@ -0,0 +1,215 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { DestinationCalendar } from "./DestinationCalendar"; +import { DestinationCalendarCountArgs } from "./DestinationCalendarCountArgs"; +import { DestinationCalendarFindManyArgs } from "./DestinationCalendarFindManyArgs"; +import { DestinationCalendarFindUniqueArgs } from "./DestinationCalendarFindUniqueArgs"; +import { CreateDestinationCalendarArgs } from "./CreateDestinationCalendarArgs"; +import { UpdateDestinationCalendarArgs } from "./UpdateDestinationCalendarArgs"; +import { DeleteDestinationCalendarArgs } from "./DeleteDestinationCalendarArgs"; +import { User } from "../../user/base/User"; +import { Booking } from "../../booking/base/Booking"; +import { EventType } from "../../eventType/base/EventType"; +import { Credential } from "../../credential/base/Credential"; +import { DestinationCalendarService } from "../destinationCalendar.service"; +@graphql.Resolver(() => DestinationCalendar) +export class DestinationCalendarResolverBase { + constructor(protected readonly service: DestinationCalendarService) {} + + async _destinationCalendarsMeta( + @graphql.Args() args: DestinationCalendarCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [DestinationCalendar]) + async destinationCalendars( + @graphql.Args() args: DestinationCalendarFindManyArgs + ): Promise<DestinationCalendar[]> { + return this.service.destinationCalendars(args); + } + + @graphql.Query(() => DestinationCalendar, { nullable: true }) + async destinationCalendar( + @graphql.Args() args: DestinationCalendarFindUniqueArgs + ): Promise<DestinationCalendar | null> { + const result = await this.service.destinationCalendar(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => DestinationCalendar) + async createDestinationCalendar( + @graphql.Args() args: CreateDestinationCalendarArgs + ): Promise<DestinationCalendar> { + return await this.service.createDestinationCalendar({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + credential: args.data.credential + ? { + connect: args.data.credential, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => DestinationCalendar) + async updateDestinationCalendar( + @graphql.Args() args: UpdateDestinationCalendarArgs + ): Promise<DestinationCalendar | null> { + try { + return await this.service.updateDestinationCalendar({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + credential: args.data.credential + ? { + connect: args.data.credential, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => DestinationCalendar) + async deleteDestinationCalendar( + @graphql.Args() args: DeleteDestinationCalendarArgs + ): Promise<DestinationCalendar | null> { + try { + return await this.service.deleteDestinationCalendar(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser( + @graphql.Parent() parent: DestinationCalendar + ): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => Booking, { + nullable: true, + name: "booking", + }) + async getBooking( + @graphql.Parent() parent: DestinationCalendar + ): Promise<Booking | null> { + const result = await this.service.getBooking(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => EventType, { + nullable: true, + name: "eventType", + }) + async getEventType( + @graphql.Parent() parent: DestinationCalendar + ): Promise<EventType | null> { + const result = await this.service.getEventType(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => Credential, { + nullable: true, + name: "credential", + }) + async getCredential( + @graphql.Parent() parent: DestinationCalendar + ): Promise<Credential | null> { + const result = await this.service.getCredential(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.service.base.ts b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.service.base.ts new file mode 100644 index 0000000..314e012 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/base/destinationCalendar.service.base.ts @@ -0,0 +1,97 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + DestinationCalendar as PrismaDestinationCalendar, + User as PrismaUser, + Booking as PrismaBooking, + EventType as PrismaEventType, + Credential as PrismaCredential, +} from "@prisma/client"; + +export class DestinationCalendarServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.DestinationCalendarCountArgs, "select"> + ): Promise<number> { + return this.prisma.destinationCalendar.count(args); + } + + async destinationCalendars<T extends Prisma.DestinationCalendarFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.DestinationCalendarFindManyArgs> + ): Promise<PrismaDestinationCalendar[]> { + return this.prisma.destinationCalendar.findMany<Prisma.DestinationCalendarFindManyArgs>( + args + ); + } + async destinationCalendar<T extends Prisma.DestinationCalendarFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.DestinationCalendarFindUniqueArgs> + ): Promise<PrismaDestinationCalendar | null> { + return this.prisma.destinationCalendar.findUnique(args); + } + async createDestinationCalendar< + T extends Prisma.DestinationCalendarCreateArgs + >( + args: Prisma.SelectSubset<T, Prisma.DestinationCalendarCreateArgs> + ): Promise<PrismaDestinationCalendar> { + return this.prisma.destinationCalendar.create<T>(args); + } + async updateDestinationCalendar< + T extends Prisma.DestinationCalendarUpdateArgs + >( + args: Prisma.SelectSubset<T, Prisma.DestinationCalendarUpdateArgs> + ): Promise<PrismaDestinationCalendar> { + return this.prisma.destinationCalendar.update<T>(args); + } + async deleteDestinationCalendar< + T extends Prisma.DestinationCalendarDeleteArgs + >( + args: Prisma.SelectSubset<T, Prisma.DestinationCalendarDeleteArgs> + ): Promise<PrismaDestinationCalendar> { + return this.prisma.destinationCalendar.delete(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.destinationCalendar + .findUnique({ + where: { id: parentId }, + }) + .user(); + } + + async getBooking(parentId: number): Promise<PrismaBooking | null> { + return this.prisma.destinationCalendar + .findUnique({ + where: { id: parentId }, + }) + .booking(); + } + + async getEventType(parentId: number): Promise<PrismaEventType | null> { + return this.prisma.destinationCalendar + .findUnique({ + where: { id: parentId }, + }) + .eventType(); + } + + async getCredential(parentId: number): Promise<PrismaCredential | null> { + return this.prisma.destinationCalendar + .findUnique({ + where: { id: parentId }, + }) + .credential(); + } +} diff --git a/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.controller.ts b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.controller.ts new file mode 100644 index 0000000..2cc35ad --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { DestinationCalendarService } from "./destinationCalendar.service"; +import { DestinationCalendarControllerBase } from "./base/destinationCalendar.controller.base"; + +@swagger.ApiTags("destinationCalendars") +@common.Controller("destinationCalendars") +export class DestinationCalendarController extends DestinationCalendarControllerBase { + constructor(protected readonly service: DestinationCalendarService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.module.ts b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.module.ts new file mode 100644 index 0000000..3afa296 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { DestinationCalendarModuleBase } from "./base/destinationCalendar.module.base"; +import { DestinationCalendarService } from "./destinationCalendar.service"; +import { DestinationCalendarController } from "./destinationCalendar.controller"; +import { DestinationCalendarResolver } from "./destinationCalendar.resolver"; + +@Module({ + imports: [DestinationCalendarModuleBase], + controllers: [DestinationCalendarController], + providers: [DestinationCalendarService, DestinationCalendarResolver], + exports: [DestinationCalendarService], +}) +export class DestinationCalendarModule {} diff --git a/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.resolver.ts b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.resolver.ts new file mode 100644 index 0000000..33e00fe --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { DestinationCalendarResolverBase } from "./base/destinationCalendar.resolver.base"; +import { DestinationCalendar } from "./base/DestinationCalendar"; +import { DestinationCalendarService } from "./destinationCalendar.service"; + +@graphql.Resolver(() => DestinationCalendar) +export class DestinationCalendarResolver extends DestinationCalendarResolverBase { + constructor(protected readonly service: DestinationCalendarService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.service.ts b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.service.ts new file mode 100644 index 0000000..d5cdd90 --- /dev/null +++ b/apps/roi-cacl-2/src/destinationCalendar/destinationCalendar.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { DestinationCalendarServiceBase } from "./base/destinationCalendar.service.base"; + +@Injectable() +export class DestinationCalendarService extends DestinationCalendarServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/errors.ts b/apps/roi-cacl-2/src/errors.ts new file mode 100644 index 0000000..bd1aa6d --- /dev/null +++ b/apps/roi-cacl-2/src/errors.ts @@ -0,0 +1,16 @@ +import * as common from "@nestjs/common"; +import { ApiProperty } from "@nestjs/swagger"; + +export class ForbiddenException extends common.ForbiddenException { + @ApiProperty() + statusCode!: number; + @ApiProperty() + message!: string; +} + +export class NotFoundException extends common.NotFoundException { + @ApiProperty() + statusCode!: number; + @ApiProperty() + message!: string; +} diff --git a/apps/roi-cacl-2/src/eventType/base/AvailabilityCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/AvailabilityCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..94ac148 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/AvailabilityCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AvailabilityCreateNestedManyWithoutEventTypesInput { + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + connect?: Array<AvailabilityWhereUniqueInput>; +} + +export { AvailabilityCreateNestedManyWithoutEventTypesInput as AvailabilityCreateNestedManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/AvailabilityUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/AvailabilityUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..c54f969 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/AvailabilityUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AvailabilityUpdateManyWithoutEventTypesInput { + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + connect?: Array<AvailabilityWhereUniqueInput>; + + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + disconnect?: Array<AvailabilityWhereUniqueInput>; + + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + set?: Array<AvailabilityWhereUniqueInput>; +} + +export { AvailabilityUpdateManyWithoutEventTypesInput as AvailabilityUpdateManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/BookingCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/BookingCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..589bd15 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/BookingCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class BookingCreateNestedManyWithoutEventTypesInput { + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + connect?: Array<BookingWhereUniqueInput>; +} + +export { BookingCreateNestedManyWithoutEventTypesInput as BookingCreateNestedManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/BookingUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/BookingUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..b840519 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/BookingUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class BookingUpdateManyWithoutEventTypesInput { + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + connect?: Array<BookingWhereUniqueInput>; + + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + disconnect?: Array<BookingWhereUniqueInput>; + + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + set?: Array<BookingWhereUniqueInput>; +} + +export { BookingUpdateManyWithoutEventTypesInput as BookingUpdateManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/CreateEventTypeArgs.ts b/apps/roi-cacl-2/src/eventType/base/CreateEventTypeArgs.ts new file mode 100644 index 0000000..9a233a7 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/CreateEventTypeArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCreateInput } from "./EventTypeCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateEventTypeArgs { + @ApiProperty({ + required: true, + type: () => EventTypeCreateInput, + }) + @ValidateNested() + @Type(() => EventTypeCreateInput) + @Field(() => EventTypeCreateInput, { nullable: false }) + data!: EventTypeCreateInput; +} + +export { CreateEventTypeArgs as CreateEventTypeArgs }; diff --git a/apps/roi-cacl-2/src/eventType/base/DeleteEventTypeArgs.ts b/apps/roi-cacl-2/src/eventType/base/DeleteEventTypeArgs.ts new file mode 100644 index 0000000..bc5cee8 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/DeleteEventTypeArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereUniqueInput } from "./EventTypeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteEventTypeArgs { + @ApiProperty({ + required: true, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @Field(() => EventTypeWhereUniqueInput, { nullable: false }) + where!: EventTypeWhereUniqueInput; +} + +export { DeleteEventTypeArgs as DeleteEventTypeArgs }; diff --git a/apps/roi-cacl-2/src/eventType/base/EnumEventTypePeriodType.ts b/apps/roi-cacl-2/src/eventType/base/EnumEventTypePeriodType.ts new file mode 100644 index 0000000..a8c9c36 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EnumEventTypePeriodType.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumEventTypePeriodType { + Unlimited = "UNLIMITED", + Rolling = "ROLLING", + Range = "RANGE", +} + +registerEnumType(EnumEventTypePeriodType, { + name: "EnumEventTypePeriodType", +}); diff --git a/apps/roi-cacl-2/src/eventType/base/EnumEventTypeSchedulingType.ts b/apps/roi-cacl-2/src/eventType/base/EnumEventTypeSchedulingType.ts new file mode 100644 index 0000000..b418b2d --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EnumEventTypeSchedulingType.ts @@ -0,0 +1,21 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumEventTypeSchedulingType { + RoundRobin = "ROUND_ROBIN", + Collective = "COLLECTIVE", +} + +registerEnumType(EnumEventTypeSchedulingType, { + name: "EnumEventTypeSchedulingType", +}); diff --git a/apps/roi-cacl-2/src/eventType/base/EventType.ts b/apps/roi-cacl-2/src/eventType/base/EventType.ts new file mode 100644 index 0000000..c479c30 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventType.ts @@ -0,0 +1,417 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsString, + IsOptional, + IsBoolean, + ValidateNested, + IsEnum, + IsDate, +} from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { JsonValue } from "type-fest"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; +import { Team } from "../../team/base/Team"; +import { EnumEventTypePeriodType } from "./EnumEventTypePeriodType"; +import { EnumEventTypeSchedulingType } from "./EnumEventTypeSchedulingType"; +import { Schedule } from "../../schedule/base/Schedule"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { Booking } from "../../booking/base/Booking"; +import { Availability } from "../../availability/base/Availability"; +import { EventTypeCustomInput } from "../../eventTypeCustomInput/base/EventTypeCustomInput"; +import { Webhook } from "../../webhook/base/Webhook"; +import { HashedLink } from "../../hashedLink/base/HashedLink"; +import { WorkflowsOnEventType } from "../../workflowsOnEventType/base/WorkflowsOnEventType"; + +@ObjectType() +class EventType { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + title!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + slug!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + description!: string | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + position!: number; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + locations!: JsonValue; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + length!: number; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hidden!: boolean; + + @ApiProperty({ + required: true, + type: () => [User], + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + users?: Array<User>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + userId!: number | null; + + @ApiProperty({ + required: false, + type: () => Team, + }) + @ValidateNested() + @Type(() => Team) + @IsOptional() + team?: Team | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + eventName!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone!: string | null; + + @ApiProperty({ + required: true, + enum: EnumEventTypePeriodType, + }) + @IsEnum(EnumEventTypePeriodType) + @Field(() => EnumEventTypePeriodType, { + nullable: true, + }) + periodType?: "UNLIMITED" | "ROLLING" | "RANGE"; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + periodStartDate!: Date | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + periodEndDate!: Date | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + periodDays!: number | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + periodCountCalendarDays!: boolean | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + requiresConfirmation!: boolean; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + recurringEvent!: JsonValue; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + disableGuests!: boolean; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hideCalendarNotes!: boolean; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + minimumBookingNotice!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + beforeEventBuffer!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + afterEventBuffer!: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + seatsPerTimeSlot!: number | null; + + @ApiProperty({ + required: false, + enum: EnumEventTypeSchedulingType, + }) + @IsEnum(EnumEventTypeSchedulingType) + @IsOptional() + @Field(() => EnumEventTypeSchedulingType, { + nullable: true, + }) + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE" | null; + + @ApiProperty({ + required: false, + type: () => Schedule, + }) + @ValidateNested() + @Type(() => Schedule) + @IsOptional() + schedule?: Schedule | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + price!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + currency!: string; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + slotInterval!: number | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + metadata!: JsonValue; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + successRedirectUrl!: string | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendar, + }) + @ValidateNested() + @Type(() => DestinationCalendar) + @IsOptional() + destinationCalendar?: DestinationCalendar | null; + + @ApiProperty({ + required: false, + type: () => [Booking], + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + bookings?: Array<Booking>; + + @ApiProperty({ + required: false, + type: () => [Availability], + }) + @ValidateNested() + @Type(() => Availability) + @IsOptional() + availability?: Array<Availability>; + + @ApiProperty({ + required: false, + type: () => [EventTypeCustomInput], + }) + @ValidateNested() + @Type(() => EventTypeCustomInput) + @IsOptional() + customInputs?: Array<EventTypeCustomInput>; + + @ApiProperty({ + required: false, + type: () => [Webhook], + }) + @ValidateNested() + @Type(() => Webhook) + @IsOptional() + webhooks?: Array<Webhook>; + + @ApiProperty({ + required: false, + type: () => HashedLink, + }) + @ValidateNested() + @Type(() => HashedLink) + @IsOptional() + hashedLink?: HashedLink | null; + + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventType], + }) + @ValidateNested() + @Type(() => WorkflowsOnEventType) + @IsOptional() + workflows?: Array<WorkflowsOnEventType>; +} + +export { EventType as EventType }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeCountArgs.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeCountArgs.ts new file mode 100644 index 0000000..5ecb9aa --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereInput } from "./EventTypeWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class EventTypeCountArgs { + @ApiProperty({ + required: false, + type: () => EventTypeWhereInput, + }) + @Field(() => EventTypeWhereInput, { nullable: true }) + @Type(() => EventTypeWhereInput) + where?: EventTypeWhereInput; +} + +export { EventTypeCountArgs as EventTypeCountArgs }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeCreateInput.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeCreateInput.ts new file mode 100644 index 0000000..6a98c26 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeCreateInput.ts @@ -0,0 +1,437 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsInt, + IsBoolean, + ValidateNested, + IsEnum, + IsDate, +} from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { UserCreateNestedManyWithoutEventTypesInput } from "./UserCreateNestedManyWithoutEventTypesInput"; +import { Type } from "class-transformer"; +import { TeamWhereUniqueInput } from "../../team/base/TeamWhereUniqueInput"; +import { EnumEventTypePeriodType } from "./EnumEventTypePeriodType"; +import { EnumEventTypeSchedulingType } from "./EnumEventTypeSchedulingType"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { BookingCreateNestedManyWithoutEventTypesInput } from "./BookingCreateNestedManyWithoutEventTypesInput"; +import { AvailabilityCreateNestedManyWithoutEventTypesInput } from "./AvailabilityCreateNestedManyWithoutEventTypesInput"; +import { EventTypeCustomInputCreateNestedManyWithoutEventTypesInput } from "./EventTypeCustomInputCreateNestedManyWithoutEventTypesInput"; +import { WebhookCreateNestedManyWithoutEventTypesInput } from "./WebhookCreateNestedManyWithoutEventTypesInput"; +import { HashedLinkWhereUniqueInput } from "../../hashedLink/base/HashedLinkWhereUniqueInput"; +import { WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput } from "./WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput"; + +@InputType() +class EventTypeCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + title!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + slug!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + description?: string | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + position!: number; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + locations?: InputJsonValue; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + length!: number; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hidden!: boolean; + + @ApiProperty({ + required: true, + type: () => UserCreateNestedManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => UserCreateNestedManyWithoutEventTypesInput) + @IsOptional() + @Field(() => UserCreateNestedManyWithoutEventTypesInput, { + nullable: true, + }) + users?: UserCreateNestedManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + userId?: number | null; + + @ApiProperty({ + required: false, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @IsOptional() + @Field(() => TeamWhereUniqueInput, { + nullable: true, + }) + team?: TeamWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + eventName?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone?: string | null; + + @ApiProperty({ + required: true, + enum: EnumEventTypePeriodType, + }) + @IsEnum(EnumEventTypePeriodType) + @Field(() => EnumEventTypePeriodType) + periodType!: "UNLIMITED" | "ROLLING" | "RANGE"; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + periodStartDate?: Date | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + periodEndDate?: Date | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + periodDays?: number | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + periodCountCalendarDays?: boolean | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + requiresConfirmation!: boolean; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + recurringEvent?: InputJsonValue; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + disableGuests!: boolean; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hideCalendarNotes!: boolean; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + minimumBookingNotice!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + beforeEventBuffer!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + afterEventBuffer!: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + seatsPerTimeSlot?: number | null; + + @ApiProperty({ + required: false, + enum: EnumEventTypeSchedulingType, + }) + @IsEnum(EnumEventTypeSchedulingType) + @IsOptional() + @Field(() => EnumEventTypeSchedulingType, { + nullable: true, + }) + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE" | null; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @IsOptional() + @Field(() => ScheduleWhereUniqueInput, { + nullable: true, + }) + schedule?: ScheduleWhereUniqueInput | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + price!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + currency!: string; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + slotInterval?: number | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + metadata?: InputJsonValue; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + successRedirectUrl?: string | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => BookingCreateNestedManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => BookingCreateNestedManyWithoutEventTypesInput) + @IsOptional() + @Field(() => BookingCreateNestedManyWithoutEventTypesInput, { + nullable: true, + }) + bookings?: BookingCreateNestedManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityCreateNestedManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => AvailabilityCreateNestedManyWithoutEventTypesInput) + @IsOptional() + @Field(() => AvailabilityCreateNestedManyWithoutEventTypesInput, { + nullable: true, + }) + availability?: AvailabilityCreateNestedManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputCreateNestedManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputCreateNestedManyWithoutEventTypesInput) + @IsOptional() + @Field(() => EventTypeCustomInputCreateNestedManyWithoutEventTypesInput, { + nullable: true, + }) + customInputs?: EventTypeCustomInputCreateNestedManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => WebhookCreateNestedManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => WebhookCreateNestedManyWithoutEventTypesInput) + @IsOptional() + @Field(() => WebhookCreateNestedManyWithoutEventTypesInput, { + nullable: true, + }) + webhooks?: WebhookCreateNestedManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => HashedLinkWhereUniqueInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereUniqueInput) + @IsOptional() + @Field(() => HashedLinkWhereUniqueInput, { + nullable: true, + }) + hashedLink?: HashedLinkWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput) + @IsOptional() + @Field(() => WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput, { + nullable: true, + }) + workflows?: WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput; +} + +export { EventTypeCreateInput as EventTypeCreateInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..217c878 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeCustomInputWhereUniqueInput } from "../../eventTypeCustomInput/base/EventTypeCustomInputWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeCustomInputCreateNestedManyWithoutEventTypesInput { + @Field(() => [EventTypeCustomInputWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeCustomInputWhereUniqueInput], + }) + connect?: Array<EventTypeCustomInputWhereUniqueInput>; +} + +export { EventTypeCustomInputCreateNestedManyWithoutEventTypesInput as EventTypeCustomInputCreateNestedManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..d09b902 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeCustomInputUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeCustomInputWhereUniqueInput } from "../../eventTypeCustomInput/base/EventTypeCustomInputWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeCustomInputUpdateManyWithoutEventTypesInput { + @Field(() => [EventTypeCustomInputWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeCustomInputWhereUniqueInput], + }) + connect?: Array<EventTypeCustomInputWhereUniqueInput>; + + @Field(() => [EventTypeCustomInputWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeCustomInputWhereUniqueInput], + }) + disconnect?: Array<EventTypeCustomInputWhereUniqueInput>; + + @Field(() => [EventTypeCustomInputWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeCustomInputWhereUniqueInput], + }) + set?: Array<EventTypeCustomInputWhereUniqueInput>; +} + +export { EventTypeCustomInputUpdateManyWithoutEventTypesInput as EventTypeCustomInputUpdateManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeFindManyArgs.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeFindManyArgs.ts new file mode 100644 index 0000000..4371640 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereInput } from "./EventTypeWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeOrderByInput } from "./EventTypeOrderByInput"; + +@ArgsType() +class EventTypeFindManyArgs { + @ApiProperty({ + required: false, + type: () => EventTypeWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => EventTypeWhereInput, { nullable: true }) + @Type(() => EventTypeWhereInput) + where?: EventTypeWhereInput; + + @ApiProperty({ + required: false, + type: [EventTypeOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [EventTypeOrderByInput], { nullable: true }) + @Type(() => EventTypeOrderByInput) + orderBy?: Array<EventTypeOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { EventTypeFindManyArgs as EventTypeFindManyArgs }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeFindUniqueArgs.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeFindUniqueArgs.ts new file mode 100644 index 0000000..8d827e7 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereUniqueInput } from "./EventTypeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class EventTypeFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @Field(() => EventTypeWhereUniqueInput, { nullable: false }) + where!: EventTypeWhereUniqueInput; +} + +export { EventTypeFindUniqueArgs as EventTypeFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeListRelationFilter.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeListRelationFilter.ts new file mode 100644 index 0000000..6ac18e8 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereInput } from "./EventTypeWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class EventTypeListRelationFilter { + @ApiProperty({ + required: false, + type: () => EventTypeWhereInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereInput) + @IsOptional() + @Field(() => EventTypeWhereInput, { + nullable: true, + }) + every?: EventTypeWhereInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereInput) + @IsOptional() + @Field(() => EventTypeWhereInput, { + nullable: true, + }) + some?: EventTypeWhereInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereInput) + @IsOptional() + @Field(() => EventTypeWhereInput, { + nullable: true, + }) + none?: EventTypeWhereInput; +} +export { EventTypeListRelationFilter as EventTypeListRelationFilter }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeOrderByInput.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeOrderByInput.ts new file mode 100644 index 0000000..22fb44c --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeOrderByInput.ts @@ -0,0 +1,397 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class EventTypeOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + title?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + slug?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + description?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + position?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + locations?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + length?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + hidden?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + teamId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventName?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + timeZone?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + periodType?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + periodStartDate?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + periodEndDate?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + periodDays?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + periodCountCalendarDays?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + requiresConfirmation?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + recurringEvent?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + disableGuests?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + hideCalendarNotes?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + minimumBookingNotice?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + beforeEventBuffer?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + afterEventBuffer?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + seatsPerTimeSlot?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + schedulingType?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + scheduleId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + price?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + currency?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + slotInterval?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + metadata?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + successRedirectUrl?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + destinationCalendarId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + hashedLinkId?: SortOrder; +} + +export { EventTypeOrderByInput as EventTypeOrderByInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeUpdateInput.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeUpdateInput.ts new file mode 100644 index 0000000..5e583eb --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeUpdateInput.ts @@ -0,0 +1,479 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsInt, + IsBoolean, + ValidateNested, + IsEnum, + IsDate, +} from "class-validator"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { UserUpdateManyWithoutEventTypesInput } from "./UserUpdateManyWithoutEventTypesInput"; +import { Type } from "class-transformer"; +import { TeamWhereUniqueInput } from "../../team/base/TeamWhereUniqueInput"; +import { EnumEventTypePeriodType } from "./EnumEventTypePeriodType"; +import { EnumEventTypeSchedulingType } from "./EnumEventTypeSchedulingType"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { BookingUpdateManyWithoutEventTypesInput } from "./BookingUpdateManyWithoutEventTypesInput"; +import { AvailabilityUpdateManyWithoutEventTypesInput } from "./AvailabilityUpdateManyWithoutEventTypesInput"; +import { EventTypeCustomInputUpdateManyWithoutEventTypesInput } from "./EventTypeCustomInputUpdateManyWithoutEventTypesInput"; +import { WebhookUpdateManyWithoutEventTypesInput } from "./WebhookUpdateManyWithoutEventTypesInput"; +import { HashedLinkWhereUniqueInput } from "../../hashedLink/base/HashedLinkWhereUniqueInput"; +import { WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput } from "./WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput"; + +@InputType() +class EventTypeUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + title?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + slug?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + description?: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + position?: number; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + locations?: InputJsonValue; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + length?: number; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + hidden?: boolean; + + @ApiProperty({ + required: false, + type: () => UserUpdateManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => UserUpdateManyWithoutEventTypesInput) + @IsOptional() + @Field(() => UserUpdateManyWithoutEventTypesInput, { + nullable: true, + }) + users?: UserUpdateManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + userId?: number | null; + + @ApiProperty({ + required: false, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @IsOptional() + @Field(() => TeamWhereUniqueInput, { + nullable: true, + }) + team?: TeamWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + eventName?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone?: string | null; + + @ApiProperty({ + required: false, + enum: EnumEventTypePeriodType, + }) + @IsEnum(EnumEventTypePeriodType) + @IsOptional() + @Field(() => EnumEventTypePeriodType, { + nullable: true, + }) + periodType?: "UNLIMITED" | "ROLLING" | "RANGE"; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + periodStartDate?: Date | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + periodEndDate?: Date | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + periodDays?: number | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + periodCountCalendarDays?: boolean | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + requiresConfirmation?: boolean; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + recurringEvent?: InputJsonValue; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + disableGuests?: boolean; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + hideCalendarNotes?: boolean; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + minimumBookingNotice?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + beforeEventBuffer?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + afterEventBuffer?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + seatsPerTimeSlot?: number | null; + + @ApiProperty({ + required: false, + enum: EnumEventTypeSchedulingType, + }) + @IsEnum(EnumEventTypeSchedulingType) + @IsOptional() + @Field(() => EnumEventTypeSchedulingType, { + nullable: true, + }) + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE" | null; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @IsOptional() + @Field(() => ScheduleWhereUniqueInput, { + nullable: true, + }) + schedule?: ScheduleWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + price?: number; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + currency?: string; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + slotInterval?: number | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + metadata?: InputJsonValue; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + successRedirectUrl?: string | null; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => BookingUpdateManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => BookingUpdateManyWithoutEventTypesInput) + @IsOptional() + @Field(() => BookingUpdateManyWithoutEventTypesInput, { + nullable: true, + }) + bookings?: BookingUpdateManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityUpdateManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => AvailabilityUpdateManyWithoutEventTypesInput) + @IsOptional() + @Field(() => AvailabilityUpdateManyWithoutEventTypesInput, { + nullable: true, + }) + availability?: AvailabilityUpdateManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputUpdateManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputUpdateManyWithoutEventTypesInput) + @IsOptional() + @Field(() => EventTypeCustomInputUpdateManyWithoutEventTypesInput, { + nullable: true, + }) + customInputs?: EventTypeCustomInputUpdateManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => WebhookUpdateManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => WebhookUpdateManyWithoutEventTypesInput) + @IsOptional() + @Field(() => WebhookUpdateManyWithoutEventTypesInput, { + nullable: true, + }) + webhooks?: WebhookUpdateManyWithoutEventTypesInput; + + @ApiProperty({ + required: false, + type: () => HashedLinkWhereUniqueInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereUniqueInput) + @IsOptional() + @Field(() => HashedLinkWhereUniqueInput, { + nullable: true, + }) + hashedLink?: HashedLinkWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput) + @IsOptional() + @Field(() => WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput, { + nullable: true, + }) + workflows?: WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput; +} + +export { EventTypeUpdateInput as EventTypeUpdateInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeWhereInput.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeWhereInput.ts new file mode 100644 index 0000000..1e3b655 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeWhereInput.ts @@ -0,0 +1,490 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested, IsEnum } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { UserListRelationFilter } from "../../user/base/UserListRelationFilter"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { TeamWhereUniqueInput } from "../../team/base/TeamWhereUniqueInput"; +import { EnumEventTypePeriodType } from "./EnumEventTypePeriodType"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; +import { EnumEventTypeSchedulingType } from "./EnumEventTypeSchedulingType"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { BookingListRelationFilter } from "../../booking/base/BookingListRelationFilter"; +import { AvailabilityListRelationFilter } from "../../availability/base/AvailabilityListRelationFilter"; +import { EventTypeCustomInputListRelationFilter } from "../../eventTypeCustomInput/base/EventTypeCustomInputListRelationFilter"; +import { WebhookListRelationFilter } from "../../webhook/base/WebhookListRelationFilter"; +import { HashedLinkWhereUniqueInput } from "../../hashedLink/base/HashedLinkWhereUniqueInput"; +import { WorkflowsOnEventTypeListRelationFilter } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeListRelationFilter"; + +@InputType() +class EventTypeWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + title?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + slug?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + description?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + position?: IntFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + locations?: JsonFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + length?: IntFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + hidden?: BooleanFilter; + + @ApiProperty({ + required: false, + type: () => UserListRelationFilter, + }) + @ValidateNested() + @Type(() => UserListRelationFilter) + @IsOptional() + @Field(() => UserListRelationFilter, { + nullable: true, + }) + users?: UserListRelationFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + userId?: IntNullableFilter; + + @ApiProperty({ + required: false, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @IsOptional() + @Field(() => TeamWhereUniqueInput, { + nullable: true, + }) + team?: TeamWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + eventName?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + timeZone?: StringNullableFilter; + + @ApiProperty({ + required: false, + enum: EnumEventTypePeriodType, + }) + @IsEnum(EnumEventTypePeriodType) + @IsOptional() + @Field(() => EnumEventTypePeriodType, { + nullable: true, + }) + periodType?: "UNLIMITED" | "ROLLING" | "RANGE"; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + periodStartDate?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + periodEndDate?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + periodDays?: IntNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanNullableFilter, + }) + @Type(() => BooleanNullableFilter) + @IsOptional() + @Field(() => BooleanNullableFilter, { + nullable: true, + }) + periodCountCalendarDays?: BooleanNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + requiresConfirmation?: BooleanFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + recurringEvent?: JsonFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + disableGuests?: BooleanFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + hideCalendarNotes?: BooleanFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + minimumBookingNotice?: IntFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + beforeEventBuffer?: IntFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + afterEventBuffer?: IntFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + seatsPerTimeSlot?: IntNullableFilter; + + @ApiProperty({ + required: false, + enum: EnumEventTypeSchedulingType, + }) + @IsEnum(EnumEventTypeSchedulingType) + @IsOptional() + @Field(() => EnumEventTypeSchedulingType, { + nullable: true, + }) + schedulingType?: "ROUND_ROBIN" | "COLLECTIVE"; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @IsOptional() + @Field(() => ScheduleWhereUniqueInput, { + nullable: true, + }) + schedule?: ScheduleWhereUniqueInput; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + price?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + currency?: StringFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + slotInterval?: IntNullableFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + metadata?: JsonFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + successRedirectUrl?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => BookingListRelationFilter, + }) + @ValidateNested() + @Type(() => BookingListRelationFilter) + @IsOptional() + @Field(() => BookingListRelationFilter, { + nullable: true, + }) + bookings?: BookingListRelationFilter; + + @ApiProperty({ + required: false, + type: () => AvailabilityListRelationFilter, + }) + @ValidateNested() + @Type(() => AvailabilityListRelationFilter) + @IsOptional() + @Field(() => AvailabilityListRelationFilter, { + nullable: true, + }) + availability?: AvailabilityListRelationFilter; + + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputListRelationFilter, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputListRelationFilter) + @IsOptional() + @Field(() => EventTypeCustomInputListRelationFilter, { + nullable: true, + }) + customInputs?: EventTypeCustomInputListRelationFilter; + + @ApiProperty({ + required: false, + type: () => WebhookListRelationFilter, + }) + @ValidateNested() + @Type(() => WebhookListRelationFilter) + @IsOptional() + @Field(() => WebhookListRelationFilter, { + nullable: true, + }) + webhooks?: WebhookListRelationFilter; + + @ApiProperty({ + required: false, + type: () => HashedLinkWhereUniqueInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereUniqueInput) + @IsOptional() + @Field(() => HashedLinkWhereUniqueInput, { + nullable: true, + }) + hashedLink?: HashedLinkWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeListRelationFilter, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeListRelationFilter) + @IsOptional() + @Field(() => WorkflowsOnEventTypeListRelationFilter, { + nullable: true, + }) + workflows?: WorkflowsOnEventTypeListRelationFilter; +} + +export { EventTypeWhereInput as EventTypeWhereInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/EventTypeWhereUniqueInput.ts b/apps/roi-cacl-2/src/eventType/base/EventTypeWhereUniqueInput.ts new file mode 100644 index 0000000..82de904 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/EventTypeWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class EventTypeWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { EventTypeWhereUniqueInput as EventTypeWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/UpdateEventTypeArgs.ts b/apps/roi-cacl-2/src/eventType/base/UpdateEventTypeArgs.ts new file mode 100644 index 0000000..f179996 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/UpdateEventTypeArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereUniqueInput } from "./EventTypeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeUpdateInput } from "./EventTypeUpdateInput"; + +@ArgsType() +class UpdateEventTypeArgs { + @ApiProperty({ + required: true, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @Field(() => EventTypeWhereUniqueInput, { nullable: false }) + where!: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => EventTypeUpdateInput, + }) + @ValidateNested() + @Type(() => EventTypeUpdateInput) + @Field(() => EventTypeUpdateInput, { nullable: false }) + data!: EventTypeUpdateInput; +} + +export { UpdateEventTypeArgs as UpdateEventTypeArgs }; diff --git a/apps/roi-cacl-2/src/eventType/base/UserCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/UserCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..9872a66 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/UserCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class UserCreateNestedManyWithoutEventTypesInput { + @Field(() => [UserWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [UserWhereUniqueInput], + }) + connect?: Array<UserWhereUniqueInput>; +} + +export { UserCreateNestedManyWithoutEventTypesInput as UserCreateNestedManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/UserUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/UserUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..5d1228a --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/UserUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class UserUpdateManyWithoutEventTypesInput { + @Field(() => [UserWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [UserWhereUniqueInput], + }) + connect?: Array<UserWhereUniqueInput>; + + @Field(() => [UserWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [UserWhereUniqueInput], + }) + disconnect?: Array<UserWhereUniqueInput>; + + @Field(() => [UserWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [UserWhereUniqueInput], + }) + set?: Array<UserWhereUniqueInput>; +} + +export { UserUpdateManyWithoutEventTypesInput as UserUpdateManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/WebhookCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/WebhookCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..ee11c54 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/WebhookCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WebhookCreateNestedManyWithoutEventTypesInput { + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + connect?: Array<WebhookWhereUniqueInput>; +} + +export { WebhookCreateNestedManyWithoutEventTypesInput as WebhookCreateNestedManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/WebhookUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/WebhookUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..773e792 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/WebhookUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WebhookUpdateManyWithoutEventTypesInput { + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + connect?: Array<WebhookWhereUniqueInput>; + + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + disconnect?: Array<WebhookWhereUniqueInput>; + + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + set?: Array<WebhookWhereUniqueInput>; +} + +export { WebhookUpdateManyWithoutEventTypesInput as WebhookUpdateManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..532a773 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput { + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + connect?: Array<WorkflowsOnEventTypeWhereUniqueInput>; +} + +export { WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput as WorkflowsOnEventTypeCreateNestedManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts b/apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts new file mode 100644 index 0000000..868b806 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput { + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + connect?: Array<WorkflowsOnEventTypeWhereUniqueInput>; + + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + disconnect?: Array<WorkflowsOnEventTypeWhereUniqueInput>; + + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + set?: Array<WorkflowsOnEventTypeWhereUniqueInput>; +} + +export { WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput as WorkflowsOnEventTypeUpdateManyWithoutEventTypesInput }; diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.spec.ts b/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.spec.ts new file mode 100644 index 0000000..6008ae4 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.spec.ts @@ -0,0 +1,278 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { EventTypeController } from "../eventType.controller"; +import { EventTypeService } from "../eventType.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + title: "exampleTitle", + slug: "exampleSlug", + description: "exampleDescription", + position: 42, + length: 42, + hidden: "true", + userId: 42, + eventName: "exampleEventName", + timeZone: "exampleTimeZone", + periodStartDate: new Date(), + periodEndDate: new Date(), + periodDays: 42, + periodCountCalendarDays: "true", + requiresConfirmation: "true", + disableGuests: "true", + hideCalendarNotes: "true", + minimumBookingNotice: 42, + beforeEventBuffer: 42, + afterEventBuffer: 42, + seatsPerTimeSlot: 42, + price: 42, + currency: "exampleCurrency", + slotInterval: 42, + successRedirectUrl: "exampleSuccessRedirectUrl", +}; +const CREATE_RESULT = { + id: 42, + title: "exampleTitle", + slug: "exampleSlug", + description: "exampleDescription", + position: 42, + length: 42, + hidden: "true", + userId: 42, + eventName: "exampleEventName", + timeZone: "exampleTimeZone", + periodStartDate: new Date(), + periodEndDate: new Date(), + periodDays: 42, + periodCountCalendarDays: "true", + requiresConfirmation: "true", + disableGuests: "true", + hideCalendarNotes: "true", + minimumBookingNotice: 42, + beforeEventBuffer: 42, + afterEventBuffer: 42, + seatsPerTimeSlot: 42, + price: 42, + currency: "exampleCurrency", + slotInterval: 42, + successRedirectUrl: "exampleSuccessRedirectUrl", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + title: "exampleTitle", + slug: "exampleSlug", + description: "exampleDescription", + position: 42, + length: 42, + hidden: "true", + userId: 42, + eventName: "exampleEventName", + timeZone: "exampleTimeZone", + periodStartDate: new Date(), + periodEndDate: new Date(), + periodDays: 42, + periodCountCalendarDays: "true", + requiresConfirmation: "true", + disableGuests: "true", + hideCalendarNotes: "true", + minimumBookingNotice: 42, + beforeEventBuffer: 42, + afterEventBuffer: 42, + seatsPerTimeSlot: 42, + price: 42, + currency: "exampleCurrency", + slotInterval: 42, + successRedirectUrl: "exampleSuccessRedirectUrl", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + title: "exampleTitle", + slug: "exampleSlug", + description: "exampleDescription", + position: 42, + length: 42, + hidden: "true", + userId: 42, + eventName: "exampleEventName", + timeZone: "exampleTimeZone", + periodStartDate: new Date(), + periodEndDate: new Date(), + periodDays: 42, + periodCountCalendarDays: "true", + requiresConfirmation: "true", + disableGuests: "true", + hideCalendarNotes: "true", + minimumBookingNotice: 42, + beforeEventBuffer: 42, + afterEventBuffer: 42, + seatsPerTimeSlot: 42, + price: 42, + currency: "exampleCurrency", + slotInterval: 42, + successRedirectUrl: "exampleSuccessRedirectUrl", +}; + +const service = { + createEventType() { + return CREATE_RESULT; + }, + eventTypes: () => FIND_MANY_RESULT, + eventType: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("EventType", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: EventTypeService, + useValue: service, + }, + ], + controllers: [EventTypeController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /eventTypes", async () => { + await request(app.getHttpServer()) + .post("/eventTypes") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + periodStartDate: CREATE_RESULT.periodStartDate.toISOString(), + periodEndDate: CREATE_RESULT.periodEndDate.toISOString(), + }); + }); + + test("GET /eventTypes", async () => { + await request(app.getHttpServer()) + .get("/eventTypes") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + periodStartDate: FIND_MANY_RESULT[0].periodStartDate.toISOString(), + periodEndDate: FIND_MANY_RESULT[0].periodEndDate.toISOString(), + }, + ]); + }); + + test("GET /eventTypes/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/eventTypes"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /eventTypes/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/eventTypes"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + periodStartDate: FIND_ONE_RESULT.periodStartDate.toISOString(), + periodEndDate: FIND_ONE_RESULT.periodEndDate.toISOString(), + }); + }); + + test("POST /eventTypes existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/eventTypes") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + periodStartDate: CREATE_RESULT.periodStartDate.toISOString(), + periodEndDate: CREATE_RESULT.periodEndDate.toISOString(), + }) + .then(function () { + agent + .post("/eventTypes") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts b/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts new file mode 100644 index 0000000..fd81cef --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts @@ -0,0 +1,1053 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { EventTypeService } from "../eventType.service"; +import { EventTypeCreateInput } from "./EventTypeCreateInput"; +import { EventType } from "./EventType"; +import { EventTypeFindManyArgs } from "./EventTypeFindManyArgs"; +import { EventTypeWhereUniqueInput } from "./EventTypeWhereUniqueInput"; +import { EventTypeUpdateInput } from "./EventTypeUpdateInput"; +import { UserFindManyArgs } from "../../user/base/UserFindManyArgs"; +import { User } from "../../user/base/User"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { BookingFindManyArgs } from "../../booking/base/BookingFindManyArgs"; +import { Booking } from "../../booking/base/Booking"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { AvailabilityFindManyArgs } from "../../availability/base/AvailabilityFindManyArgs"; +import { Availability } from "../../availability/base/Availability"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { EventTypeCustomInputFindManyArgs } from "../../eventTypeCustomInput/base/EventTypeCustomInputFindManyArgs"; +import { EventTypeCustomInput } from "../../eventTypeCustomInput/base/EventTypeCustomInput"; +import { EventTypeCustomInputWhereUniqueInput } from "../../eventTypeCustomInput/base/EventTypeCustomInputWhereUniqueInput"; +import { WebhookFindManyArgs } from "../../webhook/base/WebhookFindManyArgs"; +import { Webhook } from "../../webhook/base/Webhook"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { WorkflowsOnEventTypeFindManyArgs } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs"; +import { WorkflowsOnEventType } from "../../workflowsOnEventType/base/WorkflowsOnEventType"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput"; + +export class EventTypeControllerBase { + constructor(protected readonly service: EventTypeService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: EventType }) + async createEventType( + @common.Body() data: EventTypeCreateInput + ): Promise<EventType> { + return await this.service.createEventType({ + data: { + ...data, + + team: data.team + ? { + connect: data.team, + } + : undefined, + + schedule: data.schedule + ? { + connect: data.schedule, + } + : undefined, + + destinationCalendar: data.destinationCalendar + ? { + connect: data.destinationCalendar, + } + : undefined, + + hashedLink: data.hashedLink + ? { + connect: data.hashedLink, + } + : undefined, + }, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [EventType] }) + @ApiNestedQuery(EventTypeFindManyArgs) + async eventTypes(@common.Req() request: Request): Promise<EventType[]> { + const args = plainToClass(EventTypeFindManyArgs, request.query); + return this.service.eventTypes({ + ...args, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: EventType }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async eventType( + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<EventType | null> { + const result = await this.service.eventType({ + where: params, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: EventType }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateEventType( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() data: EventTypeUpdateInput + ): Promise<EventType | null> { + try { + return await this.service.updateEventType({ + where: params, + data: { + ...data, + + team: data.team + ? { + connect: data.team, + } + : undefined, + + schedule: data.schedule + ? { + connect: data.schedule, + } + : undefined, + + destinationCalendar: data.destinationCalendar + ? { + connect: data.destinationCalendar, + } + : undefined, + + hashedLink: data.hashedLink + ? { + connect: data.hashedLink, + } + : undefined, + }, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: EventType }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteEventType( + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<EventType | null> { + try { + return await this.service.deleteEventType({ + where: params, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/users") + @ApiNestedQuery(UserFindManyArgs) + async findUsers( + @common.Req() request: Request, + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<User[]> { + const query = plainToClass(UserFindManyArgs, request.query); + const results = await this.service.findUsers(params.id, { + ...query, + select: { + id: true, + username: true, + name: true, + email: true, + emailVerified: true, + password: true, + bio: true, + avatar: true, + timeZone: true, + weekStart: true, + startTime: true, + endTime: true, + bufferTime: true, + hideBranding: true, + theme: true, + createdDate: true, + trialEndsAt: true, + defaultScheduleId: true, + completedOnboarding: true, + locale: true, + timeFormat: true, + twoFactorSecret: true, + twoFactorEnabled: true, + identityProvider: true, + identityProviderId: true, + invitedTo: true, + plan: true, + brandColor: true, + darkBrandColor: true, + away: true, + allowDynamicBooking: true, + metadata: true, + verified: true, + role: true, + disableImpersonation: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/users") + async connectUsers( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: UserWhereUniqueInput[] + ): Promise<void> { + const data = { + users: { + connect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/users") + async updateUsers( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: UserWhereUniqueInput[] + ): Promise<void> { + const data = { + users: { + set: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/users") + async disconnectUsers( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: UserWhereUniqueInput[] + ): Promise<void> { + const data = { + users: { + disconnect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/bookings") + @ApiNestedQuery(BookingFindManyArgs) + async findBookings( + @common.Req() request: Request, + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<Booking[]> { + const query = plainToClass(BookingFindManyArgs, request.query); + const results = await this.service.findBookings(params.id, { + ...query, + select: { + id: true, + uid: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + title: true, + description: true, + customInputs: true, + startTime: true, + endTime: true, + location: true, + createdAt: true, + updatedAt: true, + status: true, + paid: true, + cancellationReason: true, + rejectionReason: true, + dynamicEventSlugRef: true, + dynamicGroupSlugRef: true, + rescheduled: true, + fromReschedule: true, + recurringEventId: true, + smsReminderNumber: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + dailyRef: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/bookings") + async connectBookings( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: BookingWhereUniqueInput[] + ): Promise<void> { + const data = { + bookings: { + connect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/bookings") + async updateBookings( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: BookingWhereUniqueInput[] + ): Promise<void> { + const data = { + bookings: { + set: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/bookings") + async disconnectBookings( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: BookingWhereUniqueInput[] + ): Promise<void> { + const data = { + bookings: { + disconnect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/availability") + @ApiNestedQuery(AvailabilityFindManyArgs) + async findAvailability( + @common.Req() request: Request, + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<Availability[]> { + const query = plainToClass(AvailabilityFindManyArgs, request.query); + const results = await this.service.findAvailability(params.id, { + ...query, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/availability") + async connectAvailability( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + connect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/availability") + async updateAvailability( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + set: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/availability") + async disconnectAvailability( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + disconnect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/customInputs") + @ApiNestedQuery(EventTypeCustomInputFindManyArgs) + async findCustomInputs( + @common.Req() request: Request, + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<EventTypeCustomInput[]> { + const query = plainToClass(EventTypeCustomInputFindManyArgs, request.query); + const results = await this.service.findCustomInputs(params.id, { + ...query, + select: { + id: true, + + eventType: { + select: { + id: true, + }, + }, + + label: true, + type: true, + required: true, + placeholder: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/customInputs") + async connectCustomInputs( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: EventTypeCustomInputWhereUniqueInput[] + ): Promise<void> { + const data = { + customInputs: { + connect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/customInputs") + async updateCustomInputs( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: EventTypeCustomInputWhereUniqueInput[] + ): Promise<void> { + const data = { + customInputs: { + set: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/customInputs") + async disconnectCustomInputs( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: EventTypeCustomInputWhereUniqueInput[] + ): Promise<void> { + const data = { + customInputs: { + disconnect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/webhooks") + @ApiNestedQuery(WebhookFindManyArgs) + async findWebhooks( + @common.Req() request: Request, + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<Webhook[]> { + const query = plainToClass(WebhookFindManyArgs, request.query); + const results = await this.service.findWebhooks(params.id, { + ...query, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/webhooks") + async connectWebhooks( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhooks: { + connect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/webhooks") + async updateWebhooks( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhooks: { + set: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/webhooks") + async disconnectWebhooks( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhooks: { + disconnect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/workflows") + @ApiNestedQuery(WorkflowsOnEventTypeFindManyArgs) + async findWorkflows( + @common.Req() request: Request, + @common.Param() params: EventTypeWhereUniqueInput + ): Promise<WorkflowsOnEventType[]> { + const query = plainToClass(WorkflowsOnEventTypeFindManyArgs, request.query); + const results = await this.service.findWorkflows(params.id, { + ...query, + select: { + id: true, + + workflow: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/workflows") + async connectWorkflows( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: WorkflowsOnEventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + workflows: { + connect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/workflows") + async updateWorkflows( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: WorkflowsOnEventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + workflows: { + set: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/workflows") + async disconnectWorkflows( + @common.Param() params: EventTypeWhereUniqueInput, + @common.Body() body: WorkflowsOnEventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + workflows: { + disconnect: body, + }, + }; + await this.service.updateEventType({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.module.base.ts b/apps/roi-cacl-2/src/eventType/base/eventType.module.base.ts new file mode 100644 index 0000000..4d2e373 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/eventType.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class EventTypeModuleBase {} diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts b/apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts new file mode 100644 index 0000000..cd08302 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts @@ -0,0 +1,309 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { EventType } from "./EventType"; +import { EventTypeCountArgs } from "./EventTypeCountArgs"; +import { EventTypeFindManyArgs } from "./EventTypeFindManyArgs"; +import { EventTypeFindUniqueArgs } from "./EventTypeFindUniqueArgs"; +import { CreateEventTypeArgs } from "./CreateEventTypeArgs"; +import { UpdateEventTypeArgs } from "./UpdateEventTypeArgs"; +import { DeleteEventTypeArgs } from "./DeleteEventTypeArgs"; +import { UserFindManyArgs } from "../../user/base/UserFindManyArgs"; +import { User } from "../../user/base/User"; +import { BookingFindManyArgs } from "../../booking/base/BookingFindManyArgs"; +import { Booking } from "../../booking/base/Booking"; +import { AvailabilityFindManyArgs } from "../../availability/base/AvailabilityFindManyArgs"; +import { Availability } from "../../availability/base/Availability"; +import { EventTypeCustomInputFindManyArgs } from "../../eventTypeCustomInput/base/EventTypeCustomInputFindManyArgs"; +import { EventTypeCustomInput } from "../../eventTypeCustomInput/base/EventTypeCustomInput"; +import { WebhookFindManyArgs } from "../../webhook/base/WebhookFindManyArgs"; +import { Webhook } from "../../webhook/base/Webhook"; +import { WorkflowsOnEventTypeFindManyArgs } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs"; +import { WorkflowsOnEventType } from "../../workflowsOnEventType/base/WorkflowsOnEventType"; +import { Team } from "../../team/base/Team"; +import { Schedule } from "../../schedule/base/Schedule"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { HashedLink } from "../../hashedLink/base/HashedLink"; +import { EventTypeService } from "../eventType.service"; +@graphql.Resolver(() => EventType) +export class EventTypeResolverBase { + constructor(protected readonly service: EventTypeService) {} + + async _eventTypesMeta( + @graphql.Args() args: EventTypeCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [EventType]) + async eventTypes( + @graphql.Args() args: EventTypeFindManyArgs + ): Promise<EventType[]> { + return this.service.eventTypes(args); + } + + @graphql.Query(() => EventType, { nullable: true }) + async eventType( + @graphql.Args() args: EventTypeFindUniqueArgs + ): Promise<EventType | null> { + const result = await this.service.eventType(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => EventType) + async createEventType( + @graphql.Args() args: CreateEventTypeArgs + ): Promise<EventType> { + return await this.service.createEventType({ + ...args, + data: { + ...args.data, + + team: args.data.team + ? { + connect: args.data.team, + } + : undefined, + + schedule: args.data.schedule + ? { + connect: args.data.schedule, + } + : undefined, + + destinationCalendar: args.data.destinationCalendar + ? { + connect: args.data.destinationCalendar, + } + : undefined, + + hashedLink: args.data.hashedLink + ? { + connect: args.data.hashedLink, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => EventType) + async updateEventType( + @graphql.Args() args: UpdateEventTypeArgs + ): Promise<EventType | null> { + try { + return await this.service.updateEventType({ + ...args, + data: { + ...args.data, + + team: args.data.team + ? { + connect: args.data.team, + } + : undefined, + + schedule: args.data.schedule + ? { + connect: args.data.schedule, + } + : undefined, + + destinationCalendar: args.data.destinationCalendar + ? { + connect: args.data.destinationCalendar, + } + : undefined, + + hashedLink: args.data.hashedLink + ? { + connect: args.data.hashedLink, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => EventType) + async deleteEventType( + @graphql.Args() args: DeleteEventTypeArgs + ): Promise<EventType | null> { + try { + return await this.service.deleteEventType(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [User], { name: "users" }) + async findUsers( + @graphql.Parent() parent: EventType, + @graphql.Args() args: UserFindManyArgs + ): Promise<User[]> { + const results = await this.service.findUsers(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Booking], { name: "bookings" }) + async findBookings( + @graphql.Parent() parent: EventType, + @graphql.Args() args: BookingFindManyArgs + ): Promise<Booking[]> { + const results = await this.service.findBookings(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Availability], { name: "availability" }) + async findAvailability( + @graphql.Parent() parent: EventType, + @graphql.Args() args: AvailabilityFindManyArgs + ): Promise<Availability[]> { + const results = await this.service.findAvailability(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [EventTypeCustomInput], { name: "customInputs" }) + async findCustomInputs( + @graphql.Parent() parent: EventType, + @graphql.Args() args: EventTypeCustomInputFindManyArgs + ): Promise<EventTypeCustomInput[]> { + const results = await this.service.findCustomInputs(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Webhook], { name: "webhooks" }) + async findWebhooks( + @graphql.Parent() parent: EventType, + @graphql.Args() args: WebhookFindManyArgs + ): Promise<Webhook[]> { + const results = await this.service.findWebhooks(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [WorkflowsOnEventType], { name: "workflows" }) + async findWorkflows( + @graphql.Parent() parent: EventType, + @graphql.Args() args: WorkflowsOnEventTypeFindManyArgs + ): Promise<WorkflowsOnEventType[]> { + const results = await this.service.findWorkflows(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => Team, { + nullable: true, + name: "team", + }) + async getTeam(@graphql.Parent() parent: EventType): Promise<Team | null> { + const result = await this.service.getTeam(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => Schedule, { + nullable: true, + name: "schedule", + }) + async getSchedule( + @graphql.Parent() parent: EventType + ): Promise<Schedule | null> { + const result = await this.service.getSchedule(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => DestinationCalendar, { + nullable: true, + name: "destinationCalendar", + }) + async getDestinationCalendar( + @graphql.Parent() parent: EventType + ): Promise<DestinationCalendar | null> { + const result = await this.service.getDestinationCalendar(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => HashedLink, { + nullable: true, + name: "hashedLink", + }) + async getHashedLink( + @graphql.Parent() parent: EventType + ): Promise<HashedLink | null> { + const result = await this.service.getHashedLink(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts b/apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts new file mode 100644 index 0000000..d3c7499 --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts @@ -0,0 +1,163 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + EventType as PrismaEventType, + User as PrismaUser, + Booking as PrismaBooking, + Availability as PrismaAvailability, + EventTypeCustomInput as PrismaEventTypeCustomInput, + Webhook as PrismaWebhook, + WorkflowsOnEventType as PrismaWorkflowsOnEventType, + Team as PrismaTeam, + Schedule as PrismaSchedule, + DestinationCalendar as PrismaDestinationCalendar, + HashedLink as PrismaHashedLink, +} from "@prisma/client"; + +export class EventTypeServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.EventTypeCountArgs, "select"> + ): Promise<number> { + return this.prisma.eventType.count(args); + } + + async eventTypes<T extends Prisma.EventTypeFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.EventTypeFindManyArgs> + ): Promise<PrismaEventType[]> { + return this.prisma.eventType.findMany<Prisma.EventTypeFindManyArgs>(args); + } + async eventType<T extends Prisma.EventTypeFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.EventTypeFindUniqueArgs> + ): Promise<PrismaEventType | null> { + return this.prisma.eventType.findUnique(args); + } + async createEventType<T extends Prisma.EventTypeCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.EventTypeCreateArgs> + ): Promise<PrismaEventType> { + return this.prisma.eventType.create<T>(args); + } + async updateEventType<T extends Prisma.EventTypeUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.EventTypeUpdateArgs> + ): Promise<PrismaEventType> { + return this.prisma.eventType.update<T>(args); + } + async deleteEventType<T extends Prisma.EventTypeDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.EventTypeDeleteArgs> + ): Promise<PrismaEventType> { + return this.prisma.eventType.delete(args); + } + + async findUsers( + parentId: number, + args: Prisma.UserFindManyArgs + ): Promise<PrismaUser[]> { + return this.prisma.eventType + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .users(args); + } + + async findBookings( + parentId: number, + args: Prisma.BookingFindManyArgs + ): Promise<PrismaBooking[]> { + return this.prisma.eventType + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .bookings(args); + } + + async findAvailability( + parentId: number, + args: Prisma.AvailabilityFindManyArgs + ): Promise<PrismaAvailability[]> { + return this.prisma.eventType + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .availability(args); + } + + async findCustomInputs( + parentId: number, + args: Prisma.EventTypeCustomInputFindManyArgs + ): Promise<PrismaEventTypeCustomInput[]> { + return this.prisma.eventType + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .customInputs(args); + } + + async findWebhooks( + parentId: number, + args: Prisma.WebhookFindManyArgs + ): Promise<PrismaWebhook[]> { + return this.prisma.eventType + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .webhooks(args); + } + + async findWorkflows( + parentId: number, + args: Prisma.WorkflowsOnEventTypeFindManyArgs + ): Promise<PrismaWorkflowsOnEventType[]> { + return this.prisma.eventType + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .workflows(args); + } + + async getTeam(parentId: number): Promise<PrismaTeam | null> { + return this.prisma.eventType + .findUnique({ + where: { id: parentId }, + }) + .team(); + } + + async getSchedule(parentId: number): Promise<PrismaSchedule | null> { + return this.prisma.eventType + .findUnique({ + where: { id: parentId }, + }) + .schedule(); + } + + async getDestinationCalendar( + parentId: number + ): Promise<PrismaDestinationCalendar | null> { + return this.prisma.eventType + .findUnique({ + where: { id: parentId }, + }) + .destinationCalendar(); + } + + async getHashedLink(parentId: number): Promise<PrismaHashedLink | null> { + return this.prisma.eventType + .findUnique({ + where: { id: parentId }, + }) + .hashedLink(); + } +} diff --git a/apps/roi-cacl-2/src/eventType/eventType.controller.ts b/apps/roi-cacl-2/src/eventType/eventType.controller.ts new file mode 100644 index 0000000..0e64c3a --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/eventType.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { EventTypeService } from "./eventType.service"; +import { EventTypeControllerBase } from "./base/eventType.controller.base"; + +@swagger.ApiTags("eventTypes") +@common.Controller("eventTypes") +export class EventTypeController extends EventTypeControllerBase { + constructor(protected readonly service: EventTypeService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/eventType/eventType.module.ts b/apps/roi-cacl-2/src/eventType/eventType.module.ts new file mode 100644 index 0000000..9d6a47c --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/eventType.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { EventTypeModuleBase } from "./base/eventType.module.base"; +import { EventTypeService } from "./eventType.service"; +import { EventTypeController } from "./eventType.controller"; +import { EventTypeResolver } from "./eventType.resolver"; + +@Module({ + imports: [EventTypeModuleBase], + controllers: [EventTypeController], + providers: [EventTypeService, EventTypeResolver], + exports: [EventTypeService], +}) +export class EventTypeModule {} diff --git a/apps/roi-cacl-2/src/eventType/eventType.resolver.ts b/apps/roi-cacl-2/src/eventType/eventType.resolver.ts new file mode 100644 index 0000000..652074d --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/eventType.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { EventTypeResolverBase } from "./base/eventType.resolver.base"; +import { EventType } from "./base/EventType"; +import { EventTypeService } from "./eventType.service"; + +@graphql.Resolver(() => EventType) +export class EventTypeResolver extends EventTypeResolverBase { + constructor(protected readonly service: EventTypeService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/eventType/eventType.service.ts b/apps/roi-cacl-2/src/eventType/eventType.service.ts new file mode 100644 index 0000000..282145e --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/eventType.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { EventTypeServiceBase } from "./base/eventType.service.base"; + +@Injectable() +export class EventTypeService extends EventTypeServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/CreateEventTypeCustomInputArgs.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/CreateEventTypeCustomInputArgs.ts new file mode 100644 index 0000000..ea7a88b --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/CreateEventTypeCustomInputArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCustomInputCreateInput } from "./EventTypeCustomInputCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateEventTypeCustomInputArgs { + @ApiProperty({ + required: true, + type: () => EventTypeCustomInputCreateInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputCreateInput) + @Field(() => EventTypeCustomInputCreateInput, { nullable: false }) + data!: EventTypeCustomInputCreateInput; +} + +export { CreateEventTypeCustomInputArgs as CreateEventTypeCustomInputArgs }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/DeleteEventTypeCustomInputArgs.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/DeleteEventTypeCustomInputArgs.ts new file mode 100644 index 0000000..e4162c2 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/DeleteEventTypeCustomInputArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCustomInputWhereUniqueInput } from "./EventTypeCustomInputWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteEventTypeCustomInputArgs { + @ApiProperty({ + required: true, + type: () => EventTypeCustomInputWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputWhereUniqueInput) + @Field(() => EventTypeCustomInputWhereUniqueInput, { nullable: false }) + where!: EventTypeCustomInputWhereUniqueInput; +} + +export { DeleteEventTypeCustomInputArgs as DeleteEventTypeCustomInputArgs }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EnumEventTypeCustomInputType.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EnumEventTypeCustomInputType.ts new file mode 100644 index 0000000..e15fd09 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EnumEventTypeCustomInputType.ts @@ -0,0 +1,23 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumEventTypeCustomInputType { + Text = "TEXT", + Textlong = "TEXTLONG", + Number = "NUMBER", + Bool = "BOOL", +} + +registerEnumType(EnumEventTypeCustomInputType, { + name: "EnumEventTypeCustomInputType", +}); diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInput.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInput.ts new file mode 100644 index 0000000..baad395 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInput.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + ValidateNested, + IsString, + IsEnum, + IsBoolean, +} from "class-validator"; +import { EventType } from "../../eventType/base/EventType"; +import { Type } from "class-transformer"; +import { EnumEventTypeCustomInputType } from "./EnumEventTypeCustomInputType"; + +@ObjectType() +class EventTypeCustomInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: () => EventType, + }) + @ValidateNested() + @Type(() => EventType) + eventType?: EventType; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + label!: string; + + @ApiProperty({ + required: true, + enum: EnumEventTypeCustomInputType, + }) + @IsEnum(EnumEventTypeCustomInputType) + @Field(() => EnumEventTypeCustomInputType, { + nullable: true, + }) + type?: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + required!: boolean; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + placeholder!: string; +} + +export { EventTypeCustomInput as EventTypeCustomInput }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCountArgs.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCountArgs.ts new file mode 100644 index 0000000..0e72784 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCustomInputWhereInput } from "./EventTypeCustomInputWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class EventTypeCustomInputCountArgs { + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputWhereInput, + }) + @Field(() => EventTypeCustomInputWhereInput, { nullable: true }) + @Type(() => EventTypeCustomInputWhereInput) + where?: EventTypeCustomInputWhereInput; +} + +export { EventTypeCustomInputCountArgs as EventTypeCustomInputCountArgs }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCreateInput.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCreateInput.ts new file mode 100644 index 0000000..800d84c --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputCreateInput.ts @@ -0,0 +1,63 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ValidateNested, IsString, IsEnum, IsBoolean } from "class-validator"; +import { Type } from "class-transformer"; +import { EnumEventTypeCustomInputType } from "./EnumEventTypeCustomInputType"; + +@InputType() +class EventTypeCustomInputCreateInput { + @ApiProperty({ + required: true, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @Field(() => EventTypeWhereUniqueInput) + eventType!: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + label!: string; + + @ApiProperty({ + required: true, + enum: EnumEventTypeCustomInputType, + }) + @IsEnum(EnumEventTypeCustomInputType) + @Field(() => EnumEventTypeCustomInputType) + type!: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + required!: boolean; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + placeholder!: string; +} + +export { EventTypeCustomInputCreateInput as EventTypeCustomInputCreateInput }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindManyArgs.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindManyArgs.ts new file mode 100644 index 0000000..2c08c2b --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCustomInputWhereInput } from "./EventTypeCustomInputWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeCustomInputOrderByInput } from "./EventTypeCustomInputOrderByInput"; + +@ArgsType() +class EventTypeCustomInputFindManyArgs { + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => EventTypeCustomInputWhereInput, { nullable: true }) + @Type(() => EventTypeCustomInputWhereInput) + where?: EventTypeCustomInputWhereInput; + + @ApiProperty({ + required: false, + type: [EventTypeCustomInputOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [EventTypeCustomInputOrderByInput], { nullable: true }) + @Type(() => EventTypeCustomInputOrderByInput) + orderBy?: Array<EventTypeCustomInputOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { EventTypeCustomInputFindManyArgs as EventTypeCustomInputFindManyArgs }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindUniqueArgs.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindUniqueArgs.ts new file mode 100644 index 0000000..90ad0c8 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCustomInputWhereUniqueInput } from "./EventTypeCustomInputWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class EventTypeCustomInputFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => EventTypeCustomInputWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputWhereUniqueInput) + @Field(() => EventTypeCustomInputWhereUniqueInput, { nullable: false }) + where!: EventTypeCustomInputWhereUniqueInput; +} + +export { EventTypeCustomInputFindUniqueArgs as EventTypeCustomInputFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputListRelationFilter.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputListRelationFilter.ts new file mode 100644 index 0000000..20f2022 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCustomInputWhereInput } from "./EventTypeCustomInputWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class EventTypeCustomInputListRelationFilter { + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputWhereInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputWhereInput) + @IsOptional() + @Field(() => EventTypeCustomInputWhereInput, { + nullable: true, + }) + every?: EventTypeCustomInputWhereInput; + + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputWhereInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputWhereInput) + @IsOptional() + @Field(() => EventTypeCustomInputWhereInput, { + nullable: true, + }) + some?: EventTypeCustomInputWhereInput; + + @ApiProperty({ + required: false, + type: () => EventTypeCustomInputWhereInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputWhereInput) + @IsOptional() + @Field(() => EventTypeCustomInputWhereInput, { + nullable: true, + }) + none?: EventTypeCustomInputWhereInput; +} +export { EventTypeCustomInputListRelationFilter as EventTypeCustomInputListRelationFilter }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputOrderByInput.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputOrderByInput.ts new file mode 100644 index 0000000..483878d --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputOrderByInput.ts @@ -0,0 +1,89 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class EventTypeCustomInputOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTypeId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + label?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + type?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + required?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + placeholder?: SortOrder; +} + +export { EventTypeCustomInputOrderByInput as EventTypeCustomInputOrderByInput }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputUpdateInput.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputUpdateInput.ts new file mode 100644 index 0000000..631d381 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputUpdateInput.ts @@ -0,0 +1,84 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { + ValidateNested, + IsOptional, + IsString, + IsEnum, + IsBoolean, +} from "class-validator"; +import { Type } from "class-transformer"; +import { EnumEventTypeCustomInputType } from "./EnumEventTypeCustomInputType"; + +@InputType() +class EventTypeCustomInputUpdateInput { + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + label?: string; + + @ApiProperty({ + required: false, + enum: EnumEventTypeCustomInputType, + }) + @IsEnum(EnumEventTypeCustomInputType) + @IsOptional() + @Field(() => EnumEventTypeCustomInputType, { + nullable: true, + }) + type?: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + required?: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + placeholder?: string; +} + +export { EventTypeCustomInputUpdateInput as EventTypeCustomInputUpdateInput }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereInput.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereInput.ts new file mode 100644 index 0000000..121aa47 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereInput.ts @@ -0,0 +1,92 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested, IsEnum } from "class-validator"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; +import { EnumEventTypeCustomInputType } from "./EnumEventTypeCustomInputType"; +import { BooleanFilter } from "../../util/BooleanFilter"; + +@InputType() +class EventTypeCustomInputWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + label?: StringFilter; + + @ApiProperty({ + required: false, + enum: EnumEventTypeCustomInputType, + }) + @IsEnum(EnumEventTypeCustomInputType) + @IsOptional() + @Field(() => EnumEventTypeCustomInputType, { + nullable: true, + }) + type?: "TEXT" | "TEXTLONG" | "NUMBER" | "BOOL"; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + required?: BooleanFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + placeholder?: StringFilter; +} + +export { EventTypeCustomInputWhereInput as EventTypeCustomInputWhereInput }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereUniqueInput.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereUniqueInput.ts new file mode 100644 index 0000000..466f14e --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/EventTypeCustomInputWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class EventTypeCustomInputWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { EventTypeCustomInputWhereUniqueInput as EventTypeCustomInputWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/UpdateEventTypeCustomInputArgs.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/UpdateEventTypeCustomInputArgs.ts new file mode 100644 index 0000000..f2f0097 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/UpdateEventTypeCustomInputArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { EventTypeCustomInputWhereUniqueInput } from "./EventTypeCustomInputWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeCustomInputUpdateInput } from "./EventTypeCustomInputUpdateInput"; + +@ArgsType() +class UpdateEventTypeCustomInputArgs { + @ApiProperty({ + required: true, + type: () => EventTypeCustomInputWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputWhereUniqueInput) + @Field(() => EventTypeCustomInputWhereUniqueInput, { nullable: false }) + where!: EventTypeCustomInputWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => EventTypeCustomInputUpdateInput, + }) + @ValidateNested() + @Type(() => EventTypeCustomInputUpdateInput) + @Field(() => EventTypeCustomInputUpdateInput, { nullable: false }) + data!: EventTypeCustomInputUpdateInput; +} + +export { UpdateEventTypeCustomInputArgs as UpdateEventTypeCustomInputArgs }; diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.spec.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.spec.ts new file mode 100644 index 0000000..ada3be8 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.spec.ts @@ -0,0 +1,176 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { EventTypeCustomInputController } from "../eventTypeCustomInput.controller"; +import { EventTypeCustomInputService } from "../eventTypeCustomInput.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + label: "exampleLabel", + required: "true", + placeholder: "examplePlaceholder", +}; +const CREATE_RESULT = { + id: 42, + label: "exampleLabel", + required: "true", + placeholder: "examplePlaceholder", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + label: "exampleLabel", + required: "true", + placeholder: "examplePlaceholder", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + label: "exampleLabel", + required: "true", + placeholder: "examplePlaceholder", +}; + +const service = { + createEventTypeCustomInput() { + return CREATE_RESULT; + }, + eventTypeCustomInputs: () => FIND_MANY_RESULT, + eventTypeCustomInput: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("EventTypeCustomInput", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: EventTypeCustomInputService, + useValue: service, + }, + ], + controllers: [EventTypeCustomInputController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /eventTypeCustomInputs", async () => { + await request(app.getHttpServer()) + .post("/eventTypeCustomInputs") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /eventTypeCustomInputs", async () => { + await request(app.getHttpServer()) + .get("/eventTypeCustomInputs") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /eventTypeCustomInputs/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/eventTypeCustomInputs"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /eventTypeCustomInputs/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/eventTypeCustomInputs"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /eventTypeCustomInputs existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/eventTypeCustomInputs") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/eventTypeCustomInputs") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.ts new file mode 100644 index 0000000..48efead --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.controller.base.ts @@ -0,0 +1,190 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { EventTypeCustomInputService } from "../eventTypeCustomInput.service"; +import { EventTypeCustomInputCreateInput } from "./EventTypeCustomInputCreateInput"; +import { EventTypeCustomInput } from "./EventTypeCustomInput"; +import { EventTypeCustomInputFindManyArgs } from "./EventTypeCustomInputFindManyArgs"; +import { EventTypeCustomInputWhereUniqueInput } from "./EventTypeCustomInputWhereUniqueInput"; +import { EventTypeCustomInputUpdateInput } from "./EventTypeCustomInputUpdateInput"; + +export class EventTypeCustomInputControllerBase { + constructor(protected readonly service: EventTypeCustomInputService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: EventTypeCustomInput }) + async createEventTypeCustomInput( + @common.Body() data: EventTypeCustomInputCreateInput + ): Promise<EventTypeCustomInput> { + return await this.service.createEventTypeCustomInput({ + data: { + ...data, + + eventType: { + connect: data.eventType, + }, + }, + select: { + id: true, + + eventType: { + select: { + id: true, + }, + }, + + label: true, + type: true, + required: true, + placeholder: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [EventTypeCustomInput] }) + @ApiNestedQuery(EventTypeCustomInputFindManyArgs) + async eventTypeCustomInputs( + @common.Req() request: Request + ): Promise<EventTypeCustomInput[]> { + const args = plainToClass(EventTypeCustomInputFindManyArgs, request.query); + return this.service.eventTypeCustomInputs({ + ...args, + select: { + id: true, + + eventType: { + select: { + id: true, + }, + }, + + label: true, + type: true, + required: true, + placeholder: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: EventTypeCustomInput }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async eventTypeCustomInput( + @common.Param() params: EventTypeCustomInputWhereUniqueInput + ): Promise<EventTypeCustomInput | null> { + const result = await this.service.eventTypeCustomInput({ + where: params, + select: { + id: true, + + eventType: { + select: { + id: true, + }, + }, + + label: true, + type: true, + required: true, + placeholder: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: EventTypeCustomInput }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateEventTypeCustomInput( + @common.Param() params: EventTypeCustomInputWhereUniqueInput, + @common.Body() data: EventTypeCustomInputUpdateInput + ): Promise<EventTypeCustomInput | null> { + try { + return await this.service.updateEventTypeCustomInput({ + where: params, + data: { + ...data, + + eventType: { + connect: data.eventType, + }, + }, + select: { + id: true, + + eventType: { + select: { + id: true, + }, + }, + + label: true, + type: true, + required: true, + placeholder: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: EventTypeCustomInput }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteEventTypeCustomInput( + @common.Param() params: EventTypeCustomInputWhereUniqueInput + ): Promise<EventTypeCustomInput | null> { + try { + return await this.service.deleteEventTypeCustomInput({ + where: params, + select: { + id: true, + + eventType: { + select: { + id: true, + }, + }, + + label: true, + type: true, + required: true, + placeholder: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.module.base.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.module.base.ts new file mode 100644 index 0000000..1346a4d --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class EventTypeCustomInputModuleBase {} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.resolver.base.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.resolver.base.ts new file mode 100644 index 0000000..29da814 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.resolver.base.ts @@ -0,0 +1,127 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { EventTypeCustomInput } from "./EventTypeCustomInput"; +import { EventTypeCustomInputCountArgs } from "./EventTypeCustomInputCountArgs"; +import { EventTypeCustomInputFindManyArgs } from "./EventTypeCustomInputFindManyArgs"; +import { EventTypeCustomInputFindUniqueArgs } from "./EventTypeCustomInputFindUniqueArgs"; +import { CreateEventTypeCustomInputArgs } from "./CreateEventTypeCustomInputArgs"; +import { UpdateEventTypeCustomInputArgs } from "./UpdateEventTypeCustomInputArgs"; +import { DeleteEventTypeCustomInputArgs } from "./DeleteEventTypeCustomInputArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { EventTypeCustomInputService } from "../eventTypeCustomInput.service"; +@graphql.Resolver(() => EventTypeCustomInput) +export class EventTypeCustomInputResolverBase { + constructor(protected readonly service: EventTypeCustomInputService) {} + + async _eventTypeCustomInputsMeta( + @graphql.Args() args: EventTypeCustomInputCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [EventTypeCustomInput]) + async eventTypeCustomInputs( + @graphql.Args() args: EventTypeCustomInputFindManyArgs + ): Promise<EventTypeCustomInput[]> { + return this.service.eventTypeCustomInputs(args); + } + + @graphql.Query(() => EventTypeCustomInput, { nullable: true }) + async eventTypeCustomInput( + @graphql.Args() args: EventTypeCustomInputFindUniqueArgs + ): Promise<EventTypeCustomInput | null> { + const result = await this.service.eventTypeCustomInput(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => EventTypeCustomInput) + async createEventTypeCustomInput( + @graphql.Args() args: CreateEventTypeCustomInputArgs + ): Promise<EventTypeCustomInput> { + return await this.service.createEventTypeCustomInput({ + ...args, + data: { + ...args.data, + + eventType: { + connect: args.data.eventType, + }, + }, + }); + } + + @graphql.Mutation(() => EventTypeCustomInput) + async updateEventTypeCustomInput( + @graphql.Args() args: UpdateEventTypeCustomInputArgs + ): Promise<EventTypeCustomInput | null> { + try { + return await this.service.updateEventTypeCustomInput({ + ...args, + data: { + ...args.data, + + eventType: { + connect: args.data.eventType, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => EventTypeCustomInput) + async deleteEventTypeCustomInput( + @graphql.Args() args: DeleteEventTypeCustomInputArgs + ): Promise<EventTypeCustomInput | null> { + try { + return await this.service.deleteEventTypeCustomInput(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => EventType, { + nullable: true, + name: "eventType", + }) + async getEventType( + @graphql.Parent() parent: EventTypeCustomInput + ): Promise<EventType | null> { + const result = await this.service.getEventType(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.service.base.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.service.base.ts new file mode 100644 index 0000000..f75353d --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/base/eventTypeCustomInput.service.base.ts @@ -0,0 +1,74 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + EventTypeCustomInput as PrismaEventTypeCustomInput, + EventType as PrismaEventType, +} from "@prisma/client"; + +export class EventTypeCustomInputServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.EventTypeCustomInputCountArgs, "select"> + ): Promise<number> { + return this.prisma.eventTypeCustomInput.count(args); + } + + async eventTypeCustomInputs< + T extends Prisma.EventTypeCustomInputFindManyArgs + >( + args: Prisma.SelectSubset<T, Prisma.EventTypeCustomInputFindManyArgs> + ): Promise<PrismaEventTypeCustomInput[]> { + return this.prisma.eventTypeCustomInput.findMany<Prisma.EventTypeCustomInputFindManyArgs>( + args + ); + } + async eventTypeCustomInput< + T extends Prisma.EventTypeCustomInputFindUniqueArgs + >( + args: Prisma.SelectSubset<T, Prisma.EventTypeCustomInputFindUniqueArgs> + ): Promise<PrismaEventTypeCustomInput | null> { + return this.prisma.eventTypeCustomInput.findUnique(args); + } + async createEventTypeCustomInput< + T extends Prisma.EventTypeCustomInputCreateArgs + >( + args: Prisma.SelectSubset<T, Prisma.EventTypeCustomInputCreateArgs> + ): Promise<PrismaEventTypeCustomInput> { + return this.prisma.eventTypeCustomInput.create<T>(args); + } + async updateEventTypeCustomInput< + T extends Prisma.EventTypeCustomInputUpdateArgs + >( + args: Prisma.SelectSubset<T, Prisma.EventTypeCustomInputUpdateArgs> + ): Promise<PrismaEventTypeCustomInput> { + return this.prisma.eventTypeCustomInput.update<T>(args); + } + async deleteEventTypeCustomInput< + T extends Prisma.EventTypeCustomInputDeleteArgs + >( + args: Prisma.SelectSubset<T, Prisma.EventTypeCustomInputDeleteArgs> + ): Promise<PrismaEventTypeCustomInput> { + return this.prisma.eventTypeCustomInput.delete(args); + } + + async getEventType(parentId: number): Promise<PrismaEventType | null> { + return this.prisma.eventTypeCustomInput + .findUnique({ + where: { id: parentId }, + }) + .eventType(); + } +} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.controller.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.controller.ts new file mode 100644 index 0000000..f4bdc77 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { EventTypeCustomInputService } from "./eventTypeCustomInput.service"; +import { EventTypeCustomInputControllerBase } from "./base/eventTypeCustomInput.controller.base"; + +@swagger.ApiTags("eventTypeCustomInputs") +@common.Controller("eventTypeCustomInputs") +export class EventTypeCustomInputController extends EventTypeCustomInputControllerBase { + constructor(protected readonly service: EventTypeCustomInputService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.module.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.module.ts new file mode 100644 index 0000000..98f0e16 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { EventTypeCustomInputModuleBase } from "./base/eventTypeCustomInput.module.base"; +import { EventTypeCustomInputService } from "./eventTypeCustomInput.service"; +import { EventTypeCustomInputController } from "./eventTypeCustomInput.controller"; +import { EventTypeCustomInputResolver } from "./eventTypeCustomInput.resolver"; + +@Module({ + imports: [EventTypeCustomInputModuleBase], + controllers: [EventTypeCustomInputController], + providers: [EventTypeCustomInputService, EventTypeCustomInputResolver], + exports: [EventTypeCustomInputService], +}) +export class EventTypeCustomInputModule {} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.resolver.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.resolver.ts new file mode 100644 index 0000000..6fae146 --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { EventTypeCustomInputResolverBase } from "./base/eventTypeCustomInput.resolver.base"; +import { EventTypeCustomInput } from "./base/EventTypeCustomInput"; +import { EventTypeCustomInputService } from "./eventTypeCustomInput.service"; + +@graphql.Resolver(() => EventTypeCustomInput) +export class EventTypeCustomInputResolver extends EventTypeCustomInputResolverBase { + constructor(protected readonly service: EventTypeCustomInputService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.service.ts b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.service.ts new file mode 100644 index 0000000..cb8bf1c --- /dev/null +++ b/apps/roi-cacl-2/src/eventTypeCustomInput/eventTypeCustomInput.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { EventTypeCustomInputServiceBase } from "./base/eventTypeCustomInput.service.base"; + +@Injectable() +export class EventTypeCustomInputService extends EventTypeCustomInputServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/feedback/base/CreateFeedbackArgs.ts b/apps/roi-cacl-2/src/feedback/base/CreateFeedbackArgs.ts new file mode 100644 index 0000000..b3a06c0 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/CreateFeedbackArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { FeedbackCreateInput } from "./FeedbackCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateFeedbackArgs { + @ApiProperty({ + required: true, + type: () => FeedbackCreateInput, + }) + @ValidateNested() + @Type(() => FeedbackCreateInput) + @Field(() => FeedbackCreateInput, { nullable: false }) + data!: FeedbackCreateInput; +} + +export { CreateFeedbackArgs as CreateFeedbackArgs }; diff --git a/apps/roi-cacl-2/src/feedback/base/DeleteFeedbackArgs.ts b/apps/roi-cacl-2/src/feedback/base/DeleteFeedbackArgs.ts new file mode 100644 index 0000000..08ba535 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/DeleteFeedbackArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { FeedbackWhereUniqueInput } from "./FeedbackWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteFeedbackArgs { + @ApiProperty({ + required: true, + type: () => FeedbackWhereUniqueInput, + }) + @ValidateNested() + @Type(() => FeedbackWhereUniqueInput) + @Field(() => FeedbackWhereUniqueInput, { nullable: false }) + where!: FeedbackWhereUniqueInput; +} + +export { DeleteFeedbackArgs as DeleteFeedbackArgs }; diff --git a/apps/roi-cacl-2/src/feedback/base/Feedback.ts b/apps/roi-cacl-2/src/feedback/base/Feedback.ts new file mode 100644 index 0000000..4b76283 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/Feedback.ts @@ -0,0 +1,70 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsDate, + ValidateNested, + IsString, + IsOptional, +} from "class-validator"; +import { Type } from "class-transformer"; +import { User } from "../../user/base/User"; + +@ObjectType() +class Feedback { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + date!: Date; + + @ApiProperty({ + required: true, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + user?: User; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + rating!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + comment!: string | null; +} + +export { Feedback as Feedback }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackCountArgs.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackCountArgs.ts new file mode 100644 index 0000000..2503047 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { FeedbackWhereInput } from "./FeedbackWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class FeedbackCountArgs { + @ApiProperty({ + required: false, + type: () => FeedbackWhereInput, + }) + @Field(() => FeedbackWhereInput, { nullable: true }) + @Type(() => FeedbackWhereInput) + where?: FeedbackWhereInput; +} + +export { FeedbackCountArgs as FeedbackCountArgs }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackCreateInput.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackCreateInput.ts new file mode 100644 index 0000000..9ef8552 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackCreateInput.ts @@ -0,0 +1,57 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsDate, ValidateNested, IsString, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class FeedbackCreateInput { + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + date!: Date; + + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput) + user!: UserWhereUniqueInput; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + rating!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + comment?: string | null; +} + +export { FeedbackCreateInput as FeedbackCreateInput }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackFindManyArgs.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackFindManyArgs.ts new file mode 100644 index 0000000..defe99d --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { FeedbackWhereInput } from "./FeedbackWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { FeedbackOrderByInput } from "./FeedbackOrderByInput"; + +@ArgsType() +class FeedbackFindManyArgs { + @ApiProperty({ + required: false, + type: () => FeedbackWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => FeedbackWhereInput, { nullable: true }) + @Type(() => FeedbackWhereInput) + where?: FeedbackWhereInput; + + @ApiProperty({ + required: false, + type: [FeedbackOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [FeedbackOrderByInput], { nullable: true }) + @Type(() => FeedbackOrderByInput) + orderBy?: Array<FeedbackOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { FeedbackFindManyArgs as FeedbackFindManyArgs }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackFindUniqueArgs.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackFindUniqueArgs.ts new file mode 100644 index 0000000..e8cbfa5 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { FeedbackWhereUniqueInput } from "./FeedbackWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class FeedbackFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => FeedbackWhereUniqueInput, + }) + @ValidateNested() + @Type(() => FeedbackWhereUniqueInput) + @Field(() => FeedbackWhereUniqueInput, { nullable: false }) + where!: FeedbackWhereUniqueInput; +} + +export { FeedbackFindUniqueArgs as FeedbackFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackListRelationFilter.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackListRelationFilter.ts new file mode 100644 index 0000000..81cdf68 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { FeedbackWhereInput } from "./FeedbackWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class FeedbackListRelationFilter { + @ApiProperty({ + required: false, + type: () => FeedbackWhereInput, + }) + @ValidateNested() + @Type(() => FeedbackWhereInput) + @IsOptional() + @Field(() => FeedbackWhereInput, { + nullable: true, + }) + every?: FeedbackWhereInput; + + @ApiProperty({ + required: false, + type: () => FeedbackWhereInput, + }) + @ValidateNested() + @Type(() => FeedbackWhereInput) + @IsOptional() + @Field(() => FeedbackWhereInput, { + nullable: true, + }) + some?: FeedbackWhereInput; + + @ApiProperty({ + required: false, + type: () => FeedbackWhereInput, + }) + @ValidateNested() + @Type(() => FeedbackWhereInput) + @IsOptional() + @Field(() => FeedbackWhereInput, { + nullable: true, + }) + none?: FeedbackWhereInput; +} +export { FeedbackListRelationFilter as FeedbackListRelationFilter }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackOrderByInput.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackOrderByInput.ts new file mode 100644 index 0000000..a046dc2 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackOrderByInput.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class FeedbackOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + date?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + rating?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + comment?: SortOrder; +} + +export { FeedbackOrderByInput as FeedbackOrderByInput }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackUpdateInput.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackUpdateInput.ts new file mode 100644 index 0000000..c7d2fe0 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackUpdateInput.ts @@ -0,0 +1,66 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsDate, IsOptional, ValidateNested, IsString } from "class-validator"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class FeedbackUpdateInput { + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + date?: Date; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + rating?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + comment?: string | null; +} + +export { FeedbackUpdateInput as FeedbackUpdateInput }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackWhereInput.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackWhereInput.ts new file mode 100644 index 0000000..1301d07 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackWhereInput.ts @@ -0,0 +1,81 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; + +@InputType() +class FeedbackWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + date?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + rating?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + comment?: StringNullableFilter; +} + +export { FeedbackWhereInput as FeedbackWhereInput }; diff --git a/apps/roi-cacl-2/src/feedback/base/FeedbackWhereUniqueInput.ts b/apps/roi-cacl-2/src/feedback/base/FeedbackWhereUniqueInput.ts new file mode 100644 index 0000000..f1e267d --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/FeedbackWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class FeedbackWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { FeedbackWhereUniqueInput as FeedbackWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/feedback/base/UpdateFeedbackArgs.ts b/apps/roi-cacl-2/src/feedback/base/UpdateFeedbackArgs.ts new file mode 100644 index 0000000..3b7a33b --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/UpdateFeedbackArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { FeedbackWhereUniqueInput } from "./FeedbackWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { FeedbackUpdateInput } from "./FeedbackUpdateInput"; + +@ArgsType() +class UpdateFeedbackArgs { + @ApiProperty({ + required: true, + type: () => FeedbackWhereUniqueInput, + }) + @ValidateNested() + @Type(() => FeedbackWhereUniqueInput) + @Field(() => FeedbackWhereUniqueInput, { nullable: false }) + where!: FeedbackWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => FeedbackUpdateInput, + }) + @ValidateNested() + @Type(() => FeedbackUpdateInput) + @Field(() => FeedbackUpdateInput, { nullable: false }) + data!: FeedbackUpdateInput; +} + +export { UpdateFeedbackArgs as UpdateFeedbackArgs }; diff --git a/apps/roi-cacl-2/src/feedback/base/feedback.controller.base.spec.ts b/apps/roi-cacl-2/src/feedback/base/feedback.controller.base.spec.ts new file mode 100644 index 0000000..a1d91ea --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/feedback.controller.base.spec.ts @@ -0,0 +1,190 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { FeedbackController } from "../feedback.controller"; +import { FeedbackService } from "../feedback.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + date: new Date(), + rating: "exampleRating", + comment: "exampleComment", +}; +const CREATE_RESULT = { + id: 42, + date: new Date(), + rating: "exampleRating", + comment: "exampleComment", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + date: new Date(), + rating: "exampleRating", + comment: "exampleComment", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + date: new Date(), + rating: "exampleRating", + comment: "exampleComment", +}; + +const service = { + createFeedback() { + return CREATE_RESULT; + }, + feedbacks: () => FIND_MANY_RESULT, + feedback: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Feedback", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: FeedbackService, + useValue: service, + }, + ], + controllers: [FeedbackController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /feedbacks", async () => { + await request(app.getHttpServer()) + .post("/feedbacks") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + date: CREATE_RESULT.date.toISOString(), + }); + }); + + test("GET /feedbacks", async () => { + await request(app.getHttpServer()) + .get("/feedbacks") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + date: FIND_MANY_RESULT[0].date.toISOString(), + }, + ]); + }); + + test("GET /feedbacks/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/feedbacks"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /feedbacks/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/feedbacks"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + date: FIND_ONE_RESULT.date.toISOString(), + }); + }); + + test("POST /feedbacks existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/feedbacks") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + date: CREATE_RESULT.date.toISOString(), + }) + .then(function () { + agent + .post("/feedbacks") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/feedback/base/feedback.controller.base.ts b/apps/roi-cacl-2/src/feedback/base/feedback.controller.base.ts new file mode 100644 index 0000000..08a5a1d --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/feedback.controller.base.ts @@ -0,0 +1,183 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { FeedbackService } from "../feedback.service"; +import { FeedbackCreateInput } from "./FeedbackCreateInput"; +import { Feedback } from "./Feedback"; +import { FeedbackFindManyArgs } from "./FeedbackFindManyArgs"; +import { FeedbackWhereUniqueInput } from "./FeedbackWhereUniqueInput"; +import { FeedbackUpdateInput } from "./FeedbackUpdateInput"; + +export class FeedbackControllerBase { + constructor(protected readonly service: FeedbackService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Feedback }) + async createFeedback( + @common.Body() data: FeedbackCreateInput + ): Promise<Feedback> { + return await this.service.createFeedback({ + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + date: true, + + user: { + select: { + id: true, + }, + }, + + rating: true, + comment: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Feedback] }) + @ApiNestedQuery(FeedbackFindManyArgs) + async feedbacks(@common.Req() request: Request): Promise<Feedback[]> { + const args = plainToClass(FeedbackFindManyArgs, request.query); + return this.service.feedbacks({ + ...args, + select: { + id: true, + date: true, + + user: { + select: { + id: true, + }, + }, + + rating: true, + comment: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Feedback }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async feedback( + @common.Param() params: FeedbackWhereUniqueInput + ): Promise<Feedback | null> { + const result = await this.service.feedback({ + where: params, + select: { + id: true, + date: true, + + user: { + select: { + id: true, + }, + }, + + rating: true, + comment: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Feedback }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateFeedback( + @common.Param() params: FeedbackWhereUniqueInput, + @common.Body() data: FeedbackUpdateInput + ): Promise<Feedback | null> { + try { + return await this.service.updateFeedback({ + where: params, + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + date: true, + + user: { + select: { + id: true, + }, + }, + + rating: true, + comment: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Feedback }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteFeedback( + @common.Param() params: FeedbackWhereUniqueInput + ): Promise<Feedback | null> { + try { + return await this.service.deleteFeedback({ + where: params, + select: { + id: true, + date: true, + + user: { + select: { + id: true, + }, + }, + + rating: true, + comment: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/feedback/base/feedback.module.base.ts b/apps/roi-cacl-2/src/feedback/base/feedback.module.base.ts new file mode 100644 index 0000000..d0705e2 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/feedback.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class FeedbackModuleBase {} diff --git a/apps/roi-cacl-2/src/feedback/base/feedback.resolver.base.ts b/apps/roi-cacl-2/src/feedback/base/feedback.resolver.base.ts new file mode 100644 index 0000000..9557c5d --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/feedback.resolver.base.ts @@ -0,0 +1,125 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Feedback } from "./Feedback"; +import { FeedbackCountArgs } from "./FeedbackCountArgs"; +import { FeedbackFindManyArgs } from "./FeedbackFindManyArgs"; +import { FeedbackFindUniqueArgs } from "./FeedbackFindUniqueArgs"; +import { CreateFeedbackArgs } from "./CreateFeedbackArgs"; +import { UpdateFeedbackArgs } from "./UpdateFeedbackArgs"; +import { DeleteFeedbackArgs } from "./DeleteFeedbackArgs"; +import { User } from "../../user/base/User"; +import { FeedbackService } from "../feedback.service"; +@graphql.Resolver(() => Feedback) +export class FeedbackResolverBase { + constructor(protected readonly service: FeedbackService) {} + + async _feedbacksMeta( + @graphql.Args() args: FeedbackCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Feedback]) + async feedbacks( + @graphql.Args() args: FeedbackFindManyArgs + ): Promise<Feedback[]> { + return this.service.feedbacks(args); + } + + @graphql.Query(() => Feedback, { nullable: true }) + async feedback( + @graphql.Args() args: FeedbackFindUniqueArgs + ): Promise<Feedback | null> { + const result = await this.service.feedback(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Feedback) + async createFeedback( + @graphql.Args() args: CreateFeedbackArgs + ): Promise<Feedback> { + return await this.service.createFeedback({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } + + @graphql.Mutation(() => Feedback) + async updateFeedback( + @graphql.Args() args: UpdateFeedbackArgs + ): Promise<Feedback | null> { + try { + return await this.service.updateFeedback({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Feedback) + async deleteFeedback( + @graphql.Args() args: DeleteFeedbackArgs + ): Promise<Feedback | null> { + try { + return await this.service.deleteFeedback(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Feedback): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/feedback/base/feedback.service.base.ts b/apps/roi-cacl-2/src/feedback/base/feedback.service.base.ts new file mode 100644 index 0000000..198128a --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/base/feedback.service.base.ts @@ -0,0 +1,59 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + Feedback as PrismaFeedback, + User as PrismaUser, +} from "@prisma/client"; + +export class FeedbackServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.FeedbackCountArgs, "select">): Promise<number> { + return this.prisma.feedback.count(args); + } + + async feedbacks<T extends Prisma.FeedbackFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.FeedbackFindManyArgs> + ): Promise<PrismaFeedback[]> { + return this.prisma.feedback.findMany<Prisma.FeedbackFindManyArgs>(args); + } + async feedback<T extends Prisma.FeedbackFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.FeedbackFindUniqueArgs> + ): Promise<PrismaFeedback | null> { + return this.prisma.feedback.findUnique(args); + } + async createFeedback<T extends Prisma.FeedbackCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.FeedbackCreateArgs> + ): Promise<PrismaFeedback> { + return this.prisma.feedback.create<T>(args); + } + async updateFeedback<T extends Prisma.FeedbackUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.FeedbackUpdateArgs> + ): Promise<PrismaFeedback> { + return this.prisma.feedback.update<T>(args); + } + async deleteFeedback<T extends Prisma.FeedbackDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.FeedbackDeleteArgs> + ): Promise<PrismaFeedback> { + return this.prisma.feedback.delete(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.feedback + .findUnique({ + where: { id: parentId }, + }) + .user(); + } +} diff --git a/apps/roi-cacl-2/src/feedback/feedback.controller.ts b/apps/roi-cacl-2/src/feedback/feedback.controller.ts new file mode 100644 index 0000000..06a848e --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/feedback.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { FeedbackService } from "./feedback.service"; +import { FeedbackControllerBase } from "./base/feedback.controller.base"; + +@swagger.ApiTags("feedbacks") +@common.Controller("feedbacks") +export class FeedbackController extends FeedbackControllerBase { + constructor(protected readonly service: FeedbackService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/feedback/feedback.module.ts b/apps/roi-cacl-2/src/feedback/feedback.module.ts new file mode 100644 index 0000000..43a9a09 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/feedback.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { FeedbackModuleBase } from "./base/feedback.module.base"; +import { FeedbackService } from "./feedback.service"; +import { FeedbackController } from "./feedback.controller"; +import { FeedbackResolver } from "./feedback.resolver"; + +@Module({ + imports: [FeedbackModuleBase], + controllers: [FeedbackController], + providers: [FeedbackService, FeedbackResolver], + exports: [FeedbackService], +}) +export class FeedbackModule {} diff --git a/apps/roi-cacl-2/src/feedback/feedback.resolver.ts b/apps/roi-cacl-2/src/feedback/feedback.resolver.ts new file mode 100644 index 0000000..593181c --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/feedback.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { FeedbackResolverBase } from "./base/feedback.resolver.base"; +import { Feedback } from "./base/Feedback"; +import { FeedbackService } from "./feedback.service"; + +@graphql.Resolver(() => Feedback) +export class FeedbackResolver extends FeedbackResolverBase { + constructor(protected readonly service: FeedbackService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/feedback/feedback.service.ts b/apps/roi-cacl-2/src/feedback/feedback.service.ts new file mode 100644 index 0000000..831c1a7 --- /dev/null +++ b/apps/roi-cacl-2/src/feedback/feedback.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { FeedbackServiceBase } from "./base/feedback.service.base"; + +@Injectable() +export class FeedbackService extends FeedbackServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/filters/HttpExceptions.filter.ts b/apps/roi-cacl-2/src/filters/HttpExceptions.filter.ts new file mode 100644 index 0000000..f5eda8e --- /dev/null +++ b/apps/roi-cacl-2/src/filters/HttpExceptions.filter.ts @@ -0,0 +1,89 @@ +import { + ArgumentsHost, + Catch, + HttpException, + HttpServer, + HttpStatus, +} from "@nestjs/common"; +import { BaseExceptionFilter } from "@nestjs/core"; +import { Prisma } from "@prisma/client"; +import { Response } from "express"; + +export type ErrorCodesStatusMapping = { + [key: string]: number; +}; + +/** + * {@link PrismaClientExceptionFilter} handling {@link Prisma.PrismaClientKnownRequestError} exceptions. + */ +@Catch(Prisma?.PrismaClientKnownRequestError) +export class HttpExceptionFilter extends BaseExceptionFilter { + /** + * default error codes mapping + * + * Error codes definition for Prisma Client (Query Engine) + * @see https://www.prisma.io/docs/reference/api-reference/error-reference#prisma-client-query-engine + */ + private errorCodesStatusMapping: ErrorCodesStatusMapping = { + P2000: HttpStatus.BAD_REQUEST, + P2002: HttpStatus.CONFLICT, + P2025: HttpStatus.NOT_FOUND, + }; + + /** + * @param applicationRef + */ + // eslint-disable-next-line @typescript-eslint/no-useless-constructor + constructor(applicationRef?: HttpServer) { + super(applicationRef); + } + + /** + * @param exception + * @param host + * @returns + */ + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + catch(exception: Prisma.PrismaClientKnownRequestError, host: ArgumentsHost) { + const statusCode = this.errorCodesStatusMapping[exception.code]; + let message; + if (host.getType() === "http") { + // for http requests (REST) + // Todo : Add all other exception types and also add mapping + const ctx = host.switchToHttp(); + const response = ctx.getResponse<Response>(); + if (exception.code === "P2002") { + // Handling Unique Key Constraint Violation Error + const fields = (exception.meta as { target: string[] }).target; + message = `Another record with the requested (${fields.join( + ", " + )}) already exists`; + } else { + message = + `[${exception.code}]: ` + + this.exceptionShortMessage(exception.message); + } + if (!Object.keys(this.errorCodesStatusMapping).includes(exception.code)) { + return super.catch(exception, host); + } + const errorResponse = { + message: message, + statusCode: statusCode, + }; + response.status(statusCode).send(errorResponse); + } + return new HttpException({ statusCode, message }, statusCode); + } + + /** + * @param exception + * @returns short message for the exception + */ + exceptionShortMessage(message: string): string { + const shortMessage = message.substring(message.indexOf("→")); + return shortMessage + .substring(shortMessage.indexOf("\n")) + .replace(/\n/g, "") + .trim(); + } +} diff --git a/apps/roi-cacl-2/src/hashedLink/base/CreateHashedLinkArgs.ts b/apps/roi-cacl-2/src/hashedLink/base/CreateHashedLinkArgs.ts new file mode 100644 index 0000000..1e92563 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/CreateHashedLinkArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { HashedLinkCreateInput } from "./HashedLinkCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateHashedLinkArgs { + @ApiProperty({ + required: true, + type: () => HashedLinkCreateInput, + }) + @ValidateNested() + @Type(() => HashedLinkCreateInput) + @Field(() => HashedLinkCreateInput, { nullable: false }) + data!: HashedLinkCreateInput; +} + +export { CreateHashedLinkArgs as CreateHashedLinkArgs }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/DeleteHashedLinkArgs.ts b/apps/roi-cacl-2/src/hashedLink/base/DeleteHashedLinkArgs.ts new file mode 100644 index 0000000..986fd95 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/DeleteHashedLinkArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { HashedLinkWhereUniqueInput } from "./HashedLinkWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteHashedLinkArgs { + @ApiProperty({ + required: true, + type: () => HashedLinkWhereUniqueInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereUniqueInput) + @Field(() => HashedLinkWhereUniqueInput, { nullable: false }) + where!: HashedLinkWhereUniqueInput; +} + +export { DeleteHashedLinkArgs as DeleteHashedLinkArgs }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLink.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLink.ts new file mode 100644 index 0000000..d640871 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLink.ts @@ -0,0 +1,45 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsString, ValidateNested } from "class-validator"; +import { EventType } from "../../eventType/base/EventType"; +import { Type } from "class-transformer"; + +@ObjectType() +class HashedLink { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + link!: string; + + @ApiProperty({ + required: true, + type: () => EventType, + }) + @ValidateNested() + @Type(() => EventType) + eventType?: EventType; +} + +export { HashedLink as HashedLink }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkCountArgs.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkCountArgs.ts new file mode 100644 index 0000000..042fffe --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { HashedLinkWhereInput } from "./HashedLinkWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class HashedLinkCountArgs { + @ApiProperty({ + required: false, + type: () => HashedLinkWhereInput, + }) + @Field(() => HashedLinkWhereInput, { nullable: true }) + @Type(() => HashedLinkWhereInput) + where?: HashedLinkWhereInput; +} + +export { HashedLinkCountArgs as HashedLinkCountArgs }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkCreateInput.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkCreateInput.ts new file mode 100644 index 0000000..7f15385 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkCreateInput.ts @@ -0,0 +1,38 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, ValidateNested } from "class-validator"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class HashedLinkCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + link!: string; + + @ApiProperty({ + required: true, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @Field(() => EventTypeWhereUniqueInput) + eventType!: EventTypeWhereUniqueInput; +} + +export { HashedLinkCreateInput as HashedLinkCreateInput }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindManyArgs.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindManyArgs.ts new file mode 100644 index 0000000..2436ac7 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { HashedLinkWhereInput } from "./HashedLinkWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { HashedLinkOrderByInput } from "./HashedLinkOrderByInput"; + +@ArgsType() +class HashedLinkFindManyArgs { + @ApiProperty({ + required: false, + type: () => HashedLinkWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => HashedLinkWhereInput, { nullable: true }) + @Type(() => HashedLinkWhereInput) + where?: HashedLinkWhereInput; + + @ApiProperty({ + required: false, + type: [HashedLinkOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [HashedLinkOrderByInput], { nullable: true }) + @Type(() => HashedLinkOrderByInput) + orderBy?: Array<HashedLinkOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { HashedLinkFindManyArgs as HashedLinkFindManyArgs }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindUniqueArgs.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindUniqueArgs.ts new file mode 100644 index 0000000..e99b508 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { HashedLinkWhereUniqueInput } from "./HashedLinkWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class HashedLinkFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => HashedLinkWhereUniqueInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereUniqueInput) + @Field(() => HashedLinkWhereUniqueInput, { nullable: false }) + where!: HashedLinkWhereUniqueInput; +} + +export { HashedLinkFindUniqueArgs as HashedLinkFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkListRelationFilter.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkListRelationFilter.ts new file mode 100644 index 0000000..dd3a4b8 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { HashedLinkWhereInput } from "./HashedLinkWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class HashedLinkListRelationFilter { + @ApiProperty({ + required: false, + type: () => HashedLinkWhereInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereInput) + @IsOptional() + @Field(() => HashedLinkWhereInput, { + nullable: true, + }) + every?: HashedLinkWhereInput; + + @ApiProperty({ + required: false, + type: () => HashedLinkWhereInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereInput) + @IsOptional() + @Field(() => HashedLinkWhereInput, { + nullable: true, + }) + some?: HashedLinkWhereInput; + + @ApiProperty({ + required: false, + type: () => HashedLinkWhereInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereInput) + @IsOptional() + @Field(() => HashedLinkWhereInput, { + nullable: true, + }) + none?: HashedLinkWhereInput; +} +export { HashedLinkListRelationFilter as HashedLinkListRelationFilter }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkOrderByInput.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkOrderByInput.ts new file mode 100644 index 0000000..ad47c85 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkOrderByInput.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class HashedLinkOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + link?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTypeId?: SortOrder; +} + +export { HashedLinkOrderByInput as HashedLinkOrderByInput }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkUpdateInput.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkUpdateInput.ts new file mode 100644 index 0000000..722babe --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkUpdateInput.ts @@ -0,0 +1,44 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, ValidateNested } from "class-validator"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { Type } from "class-transformer"; + +@InputType() +class HashedLinkUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + link?: string; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; +} + +export { HashedLinkUpdateInput as HashedLinkUpdateInput }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereInput.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereInput.ts new file mode 100644 index 0000000..c5a322d --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereInput.ts @@ -0,0 +1,57 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; + +@InputType() +class HashedLinkWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + link?: StringFilter; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; +} + +export { HashedLinkWhereInput as HashedLinkWhereInput }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereUniqueInput.ts b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereUniqueInput.ts new file mode 100644 index 0000000..a3ea6e5 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/HashedLinkWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class HashedLinkWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { HashedLinkWhereUniqueInput as HashedLinkWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/UpdateHashedLinkArgs.ts b/apps/roi-cacl-2/src/hashedLink/base/UpdateHashedLinkArgs.ts new file mode 100644 index 0000000..f123bdb --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/UpdateHashedLinkArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { HashedLinkWhereUniqueInput } from "./HashedLinkWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { HashedLinkUpdateInput } from "./HashedLinkUpdateInput"; + +@ArgsType() +class UpdateHashedLinkArgs { + @ApiProperty({ + required: true, + type: () => HashedLinkWhereUniqueInput, + }) + @ValidateNested() + @Type(() => HashedLinkWhereUniqueInput) + @Field(() => HashedLinkWhereUniqueInput, { nullable: false }) + where!: HashedLinkWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => HashedLinkUpdateInput, + }) + @ValidateNested() + @Type(() => HashedLinkUpdateInput) + @Field(() => HashedLinkUpdateInput, { nullable: false }) + data!: HashedLinkUpdateInput; +} + +export { UpdateHashedLinkArgs as UpdateHashedLinkArgs }; diff --git a/apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.spec.ts b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.spec.ts new file mode 100644 index 0000000..aa63d0d --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.spec.ts @@ -0,0 +1,168 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { HashedLinkController } from "../hashedLink.controller"; +import { HashedLinkService } from "../hashedLink.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + link: "exampleLink", +}; +const CREATE_RESULT = { + id: 42, + link: "exampleLink", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + link: "exampleLink", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + link: "exampleLink", +}; + +const service = { + createHashedLink() { + return CREATE_RESULT; + }, + hashedLinks: () => FIND_MANY_RESULT, + hashedLink: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("HashedLink", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: HashedLinkService, + useValue: service, + }, + ], + controllers: [HashedLinkController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /hashedLinks", async () => { + await request(app.getHttpServer()) + .post("/hashedLinks") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /hashedLinks", async () => { + await request(app.getHttpServer()) + .get("/hashedLinks") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /hashedLinks/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/hashedLinks"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /hashedLinks/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/hashedLinks"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /hashedLinks existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/hashedLinks") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/hashedLinks") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.ts b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.ts new file mode 100644 index 0000000..001ddb5 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.controller.base.ts @@ -0,0 +1,168 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { HashedLinkService } from "../hashedLink.service"; +import { HashedLinkCreateInput } from "./HashedLinkCreateInput"; +import { HashedLink } from "./HashedLink"; +import { HashedLinkFindManyArgs } from "./HashedLinkFindManyArgs"; +import { HashedLinkWhereUniqueInput } from "./HashedLinkWhereUniqueInput"; +import { HashedLinkUpdateInput } from "./HashedLinkUpdateInput"; + +export class HashedLinkControllerBase { + constructor(protected readonly service: HashedLinkService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: HashedLink }) + async createHashedLink( + @common.Body() data: HashedLinkCreateInput + ): Promise<HashedLink> { + return await this.service.createHashedLink({ + data: { + ...data, + + eventType: { + connect: data.eventType, + }, + }, + select: { + id: true, + link: true, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [HashedLink] }) + @ApiNestedQuery(HashedLinkFindManyArgs) + async hashedLinks(@common.Req() request: Request): Promise<HashedLink[]> { + const args = plainToClass(HashedLinkFindManyArgs, request.query); + return this.service.hashedLinks({ + ...args, + select: { + id: true, + link: true, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: HashedLink }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async hashedLink( + @common.Param() params: HashedLinkWhereUniqueInput + ): Promise<HashedLink | null> { + const result = await this.service.hashedLink({ + where: params, + select: { + id: true, + link: true, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: HashedLink }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateHashedLink( + @common.Param() params: HashedLinkWhereUniqueInput, + @common.Body() data: HashedLinkUpdateInput + ): Promise<HashedLink | null> { + try { + return await this.service.updateHashedLink({ + where: params, + data: { + ...data, + + eventType: { + connect: data.eventType, + }, + }, + select: { + id: true, + link: true, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: HashedLink }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteHashedLink( + @common.Param() params: HashedLinkWhereUniqueInput + ): Promise<HashedLink | null> { + try { + return await this.service.deleteHashedLink({ + where: params, + select: { + id: true, + link: true, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/hashedLink/base/hashedLink.module.base.ts b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.module.base.ts new file mode 100644 index 0000000..4e4780b --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class HashedLinkModuleBase {} diff --git a/apps/roi-cacl-2/src/hashedLink/base/hashedLink.resolver.base.ts b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.resolver.base.ts new file mode 100644 index 0000000..fa60bbe --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.resolver.base.ts @@ -0,0 +1,127 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { HashedLink } from "./HashedLink"; +import { HashedLinkCountArgs } from "./HashedLinkCountArgs"; +import { HashedLinkFindManyArgs } from "./HashedLinkFindManyArgs"; +import { HashedLinkFindUniqueArgs } from "./HashedLinkFindUniqueArgs"; +import { CreateHashedLinkArgs } from "./CreateHashedLinkArgs"; +import { UpdateHashedLinkArgs } from "./UpdateHashedLinkArgs"; +import { DeleteHashedLinkArgs } from "./DeleteHashedLinkArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { HashedLinkService } from "../hashedLink.service"; +@graphql.Resolver(() => HashedLink) +export class HashedLinkResolverBase { + constructor(protected readonly service: HashedLinkService) {} + + async _hashedLinksMeta( + @graphql.Args() args: HashedLinkCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [HashedLink]) + async hashedLinks( + @graphql.Args() args: HashedLinkFindManyArgs + ): Promise<HashedLink[]> { + return this.service.hashedLinks(args); + } + + @graphql.Query(() => HashedLink, { nullable: true }) + async hashedLink( + @graphql.Args() args: HashedLinkFindUniqueArgs + ): Promise<HashedLink | null> { + const result = await this.service.hashedLink(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => HashedLink) + async createHashedLink( + @graphql.Args() args: CreateHashedLinkArgs + ): Promise<HashedLink> { + return await this.service.createHashedLink({ + ...args, + data: { + ...args.data, + + eventType: { + connect: args.data.eventType, + }, + }, + }); + } + + @graphql.Mutation(() => HashedLink) + async updateHashedLink( + @graphql.Args() args: UpdateHashedLinkArgs + ): Promise<HashedLink | null> { + try { + return await this.service.updateHashedLink({ + ...args, + data: { + ...args.data, + + eventType: { + connect: args.data.eventType, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => HashedLink) + async deleteHashedLink( + @graphql.Args() args: DeleteHashedLinkArgs + ): Promise<HashedLink | null> { + try { + return await this.service.deleteHashedLink(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => EventType, { + nullable: true, + name: "eventType", + }) + async getEventType( + @graphql.Parent() parent: HashedLink + ): Promise<EventType | null> { + const result = await this.service.getEventType(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/hashedLink/base/hashedLink.service.base.ts b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.service.base.ts new file mode 100644 index 0000000..de4d7d4 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/base/hashedLink.service.base.ts @@ -0,0 +1,61 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + HashedLink as PrismaHashedLink, + EventType as PrismaEventType, +} from "@prisma/client"; + +export class HashedLinkServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.HashedLinkCountArgs, "select"> + ): Promise<number> { + return this.prisma.hashedLink.count(args); + } + + async hashedLinks<T extends Prisma.HashedLinkFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.HashedLinkFindManyArgs> + ): Promise<PrismaHashedLink[]> { + return this.prisma.hashedLink.findMany<Prisma.HashedLinkFindManyArgs>(args); + } + async hashedLink<T extends Prisma.HashedLinkFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.HashedLinkFindUniqueArgs> + ): Promise<PrismaHashedLink | null> { + return this.prisma.hashedLink.findUnique(args); + } + async createHashedLink<T extends Prisma.HashedLinkCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.HashedLinkCreateArgs> + ): Promise<PrismaHashedLink> { + return this.prisma.hashedLink.create<T>(args); + } + async updateHashedLink<T extends Prisma.HashedLinkUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.HashedLinkUpdateArgs> + ): Promise<PrismaHashedLink> { + return this.prisma.hashedLink.update<T>(args); + } + async deleteHashedLink<T extends Prisma.HashedLinkDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.HashedLinkDeleteArgs> + ): Promise<PrismaHashedLink> { + return this.prisma.hashedLink.delete(args); + } + + async getEventType(parentId: number): Promise<PrismaEventType | null> { + return this.prisma.hashedLink + .findUnique({ + where: { id: parentId }, + }) + .eventType(); + } +} diff --git a/apps/roi-cacl-2/src/hashedLink/hashedLink.controller.ts b/apps/roi-cacl-2/src/hashedLink/hashedLink.controller.ts new file mode 100644 index 0000000..6e26b78 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/hashedLink.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { HashedLinkService } from "./hashedLink.service"; +import { HashedLinkControllerBase } from "./base/hashedLink.controller.base"; + +@swagger.ApiTags("hashedLinks") +@common.Controller("hashedLinks") +export class HashedLinkController extends HashedLinkControllerBase { + constructor(protected readonly service: HashedLinkService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/hashedLink/hashedLink.module.ts b/apps/roi-cacl-2/src/hashedLink/hashedLink.module.ts new file mode 100644 index 0000000..300ca21 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/hashedLink.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { HashedLinkModuleBase } from "./base/hashedLink.module.base"; +import { HashedLinkService } from "./hashedLink.service"; +import { HashedLinkController } from "./hashedLink.controller"; +import { HashedLinkResolver } from "./hashedLink.resolver"; + +@Module({ + imports: [HashedLinkModuleBase], + controllers: [HashedLinkController], + providers: [HashedLinkService, HashedLinkResolver], + exports: [HashedLinkService], +}) +export class HashedLinkModule {} diff --git a/apps/roi-cacl-2/src/hashedLink/hashedLink.resolver.ts b/apps/roi-cacl-2/src/hashedLink/hashedLink.resolver.ts new file mode 100644 index 0000000..ac4bc02 --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/hashedLink.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { HashedLinkResolverBase } from "./base/hashedLink.resolver.base"; +import { HashedLink } from "./base/HashedLink"; +import { HashedLinkService } from "./hashedLink.service"; + +@graphql.Resolver(() => HashedLink) +export class HashedLinkResolver extends HashedLinkResolverBase { + constructor(protected readonly service: HashedLinkService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/hashedLink/hashedLink.service.ts b/apps/roi-cacl-2/src/hashedLink/hashedLink.service.ts new file mode 100644 index 0000000..6a1db5d --- /dev/null +++ b/apps/roi-cacl-2/src/hashedLink/hashedLink.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { HashedLinkServiceBase } from "./base/hashedLink.service.base"; + +@Injectable() +export class HashedLinkService extends HashedLinkServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/health/base/health.controller.base.ts b/apps/roi-cacl-2/src/health/base/health.controller.base.ts new file mode 100644 index 0000000..afd9e0d --- /dev/null +++ b/apps/roi-cacl-2/src/health/base/health.controller.base.ts @@ -0,0 +1,19 @@ +import { Get, HttpStatus, Res } from "@nestjs/common"; +import { Response } from "express"; +import { HealthService } from "../health.service"; + +export class HealthControllerBase { + constructor(protected readonly healthService: HealthService) {} + @Get("live") + healthLive(@Res() response: Response): Response<void> { + return response.status(HttpStatus.NO_CONTENT).send(); + } + @Get("ready") + async healthReady(@Res() response: Response): Promise<Response<void>> { + const dbConnection = await this.healthService.isDbReady(); + if (!dbConnection) { + return response.status(HttpStatus.NOT_FOUND).send(); + } + return response.status(HttpStatus.NO_CONTENT).send(); + } +} diff --git a/apps/roi-cacl-2/src/health/base/health.service.base.ts b/apps/roi-cacl-2/src/health/base/health.service.base.ts new file mode 100644 index 0000000..49a93a5 --- /dev/null +++ b/apps/roi-cacl-2/src/health/base/health.service.base.ts @@ -0,0 +1,15 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../../prisma/prisma.service"; + +@Injectable() +export class HealthServiceBase { + constructor(protected readonly prisma: PrismaService) {} + async isDbReady(): Promise<boolean> { + try { + await this.prisma.$queryRaw`SELECT 1`; + return true; + } catch (error) { + return false; + } + } +} diff --git a/apps/roi-cacl-2/src/health/health.controller.ts b/apps/roi-cacl-2/src/health/health.controller.ts new file mode 100644 index 0000000..ff484e7 --- /dev/null +++ b/apps/roi-cacl-2/src/health/health.controller.ts @@ -0,0 +1,10 @@ +import { Controller } from "@nestjs/common"; +import { HealthControllerBase } from "./base/health.controller.base"; +import { HealthService } from "./health.service"; + +@Controller("_health") +export class HealthController extends HealthControllerBase { + constructor(protected readonly healthService: HealthService) { + super(healthService); + } +} diff --git a/apps/roi-cacl-2/src/health/health.module.ts b/apps/roi-cacl-2/src/health/health.module.ts new file mode 100644 index 0000000..39eff7f --- /dev/null +++ b/apps/roi-cacl-2/src/health/health.module.ts @@ -0,0 +1,10 @@ +import { Module } from "@nestjs/common"; +import { HealthController } from "./health.controller"; +import { HealthService } from "./health.service"; + +@Module({ + controllers: [HealthController], + providers: [HealthService], + exports: [HealthService], +}) +export class HealthModule {} diff --git a/apps/roi-cacl-2/src/health/health.service.ts b/apps/roi-cacl-2/src/health/health.service.ts new file mode 100644 index 0000000..44d9343 --- /dev/null +++ b/apps/roi-cacl-2/src/health/health.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { HealthServiceBase } from "./base/health.service.base"; + +@Injectable() +export class HealthService extends HealthServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/impersonation/base/CreateImpersonationArgs.ts b/apps/roi-cacl-2/src/impersonation/base/CreateImpersonationArgs.ts new file mode 100644 index 0000000..0d162bc --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/CreateImpersonationArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ImpersonationCreateInput } from "./ImpersonationCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateImpersonationArgs { + @ApiProperty({ + required: true, + type: () => ImpersonationCreateInput, + }) + @ValidateNested() + @Type(() => ImpersonationCreateInput) + @Field(() => ImpersonationCreateInput, { nullable: false }) + data!: ImpersonationCreateInput; +} + +export { CreateImpersonationArgs as CreateImpersonationArgs }; diff --git a/apps/roi-cacl-2/src/impersonation/base/DeleteImpersonationArgs.ts b/apps/roi-cacl-2/src/impersonation/base/DeleteImpersonationArgs.ts new file mode 100644 index 0000000..b625248 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/DeleteImpersonationArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ImpersonationWhereUniqueInput } from "./ImpersonationWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteImpersonationArgs { + @ApiProperty({ + required: true, + type: () => ImpersonationWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ImpersonationWhereUniqueInput) + @Field(() => ImpersonationWhereUniqueInput, { nullable: false }) + where!: ImpersonationWhereUniqueInput; +} + +export { DeleteImpersonationArgs as DeleteImpersonationArgs }; diff --git a/apps/roi-cacl-2/src/impersonation/base/Impersonation.ts b/apps/roi-cacl-2/src/impersonation/base/Impersonation.ts new file mode 100644 index 0000000..0a27e42 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/Impersonation.ts @@ -0,0 +1,53 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsDate, ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { User } from "../../user/base/User"; + +@ObjectType() +class Impersonation { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; + + @ApiProperty({ + required: true, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + impersonatedUser?: User; + + @ApiProperty({ + required: true, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + impersonatedBy?: User; +} + +export { Impersonation as Impersonation }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationCountArgs.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationCountArgs.ts new file mode 100644 index 0000000..9dc15cd --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ImpersonationWhereInput } from "./ImpersonationWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class ImpersonationCountArgs { + @ApiProperty({ + required: false, + type: () => ImpersonationWhereInput, + }) + @Field(() => ImpersonationWhereInput, { nullable: true }) + @Type(() => ImpersonationWhereInput) + where?: ImpersonationWhereInput; +} + +export { ImpersonationCountArgs as ImpersonationCountArgs }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationCreateInput.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationCreateInput.ts new file mode 100644 index 0000000..b891a2e --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationCreateInput.ts @@ -0,0 +1,39 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ImpersonationCreateInput { + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput) + impersonatedUser!: UserWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput) + impersonatedBy!: UserWhereUniqueInput; +} + +export { ImpersonationCreateInput as ImpersonationCreateInput }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationFindManyArgs.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationFindManyArgs.ts new file mode 100644 index 0000000..465e704 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ImpersonationWhereInput } from "./ImpersonationWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { ImpersonationOrderByInput } from "./ImpersonationOrderByInput"; + +@ArgsType() +class ImpersonationFindManyArgs { + @ApiProperty({ + required: false, + type: () => ImpersonationWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => ImpersonationWhereInput, { nullable: true }) + @Type(() => ImpersonationWhereInput) + where?: ImpersonationWhereInput; + + @ApiProperty({ + required: false, + type: [ImpersonationOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [ImpersonationOrderByInput], { nullable: true }) + @Type(() => ImpersonationOrderByInput) + orderBy?: Array<ImpersonationOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { ImpersonationFindManyArgs as ImpersonationFindManyArgs }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationFindUniqueArgs.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationFindUniqueArgs.ts new file mode 100644 index 0000000..241b72d --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ImpersonationWhereUniqueInput } from "./ImpersonationWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class ImpersonationFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => ImpersonationWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ImpersonationWhereUniqueInput) + @Field(() => ImpersonationWhereUniqueInput, { nullable: false }) + where!: ImpersonationWhereUniqueInput; +} + +export { ImpersonationFindUniqueArgs as ImpersonationFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationListRelationFilter.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationListRelationFilter.ts new file mode 100644 index 0000000..ed646ce --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ImpersonationWhereInput } from "./ImpersonationWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ImpersonationListRelationFilter { + @ApiProperty({ + required: false, + type: () => ImpersonationWhereInput, + }) + @ValidateNested() + @Type(() => ImpersonationWhereInput) + @IsOptional() + @Field(() => ImpersonationWhereInput, { + nullable: true, + }) + every?: ImpersonationWhereInput; + + @ApiProperty({ + required: false, + type: () => ImpersonationWhereInput, + }) + @ValidateNested() + @Type(() => ImpersonationWhereInput) + @IsOptional() + @Field(() => ImpersonationWhereInput, { + nullable: true, + }) + some?: ImpersonationWhereInput; + + @ApiProperty({ + required: false, + type: () => ImpersonationWhereInput, + }) + @ValidateNested() + @Type(() => ImpersonationWhereInput) + @IsOptional() + @Field(() => ImpersonationWhereInput, { + nullable: true, + }) + none?: ImpersonationWhereInput; +} +export { ImpersonationListRelationFilter as ImpersonationListRelationFilter }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationOrderByInput.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationOrderByInput.ts new file mode 100644 index 0000000..42ed875 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationOrderByInput.ts @@ -0,0 +1,67 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class ImpersonationOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + impersonatedUserId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + impersonatedById?: SortOrder; +} + +export { ImpersonationOrderByInput as ImpersonationOrderByInput }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationUpdateInput.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationUpdateInput.ts new file mode 100644 index 0000000..ccf17ac --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationUpdateInput.ts @@ -0,0 +1,45 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ImpersonationUpdateInput { + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + impersonatedUser?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + impersonatedBy?: UserWhereUniqueInput; +} + +export { ImpersonationUpdateInput as ImpersonationUpdateInput }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereInput.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereInput.ts new file mode 100644 index 0000000..58764bf --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereInput.ts @@ -0,0 +1,69 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class ImpersonationWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + impersonatedUser?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + impersonatedBy?: UserWhereUniqueInput; +} + +export { ImpersonationWhereInput as ImpersonationWhereInput }; diff --git a/apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereUniqueInput.ts b/apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereUniqueInput.ts new file mode 100644 index 0000000..783448a --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/ImpersonationWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class ImpersonationWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { ImpersonationWhereUniqueInput as ImpersonationWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/impersonation/base/UpdateImpersonationArgs.ts b/apps/roi-cacl-2/src/impersonation/base/UpdateImpersonationArgs.ts new file mode 100644 index 0000000..c83f747 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/UpdateImpersonationArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ImpersonationWhereUniqueInput } from "./ImpersonationWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { ImpersonationUpdateInput } from "./ImpersonationUpdateInput"; + +@ArgsType() +class UpdateImpersonationArgs { + @ApiProperty({ + required: true, + type: () => ImpersonationWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ImpersonationWhereUniqueInput) + @Field(() => ImpersonationWhereUniqueInput, { nullable: false }) + where!: ImpersonationWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => ImpersonationUpdateInput, + }) + @ValidateNested() + @Type(() => ImpersonationUpdateInput) + @Field(() => ImpersonationUpdateInput, { nullable: false }) + data!: ImpersonationUpdateInput; +} + +export { UpdateImpersonationArgs as UpdateImpersonationArgs }; diff --git a/apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.spec.ts b/apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.spec.ts new file mode 100644 index 0000000..cc7e87c --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.spec.ts @@ -0,0 +1,182 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { ImpersonationController } from "../impersonation.controller"; +import { ImpersonationService } from "../impersonation.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + createdAt: new Date(), +}; +const CREATE_RESULT = { + id: 42, + createdAt: new Date(), +}; +const FIND_MANY_RESULT = [ + { + id: 42, + createdAt: new Date(), + }, +]; +const FIND_ONE_RESULT = { + id: 42, + createdAt: new Date(), +}; + +const service = { + createImpersonation() { + return CREATE_RESULT; + }, + impersonations: () => FIND_MANY_RESULT, + impersonation: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Impersonation", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: ImpersonationService, + useValue: service, + }, + ], + controllers: [ImpersonationController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /impersonations", async () => { + await request(app.getHttpServer()) + .post("/impersonations") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + }); + }); + + test("GET /impersonations", async () => { + await request(app.getHttpServer()) + .get("/impersonations") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + }, + ]); + }); + + test("GET /impersonations/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/impersonations"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /impersonations/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/impersonations"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + }); + }); + + test("POST /impersonations existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/impersonations") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + }) + .then(function () { + agent + .post("/impersonations") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.ts b/apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.ts new file mode 100644 index 0000000..91a0b8c --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/impersonation.controller.base.ts @@ -0,0 +1,208 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { ImpersonationService } from "../impersonation.service"; +import { ImpersonationCreateInput } from "./ImpersonationCreateInput"; +import { Impersonation } from "./Impersonation"; +import { ImpersonationFindManyArgs } from "./ImpersonationFindManyArgs"; +import { ImpersonationWhereUniqueInput } from "./ImpersonationWhereUniqueInput"; +import { ImpersonationUpdateInput } from "./ImpersonationUpdateInput"; + +export class ImpersonationControllerBase { + constructor(protected readonly service: ImpersonationService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Impersonation }) + async createImpersonation( + @common.Body() data: ImpersonationCreateInput + ): Promise<Impersonation> { + return await this.service.createImpersonation({ + data: { + ...data, + + impersonatedUser: { + connect: data.impersonatedUser, + }, + + impersonatedBy: { + connect: data.impersonatedBy, + }, + }, + select: { + id: true, + createdAt: true, + + impersonatedUser: { + select: { + id: true, + }, + }, + + impersonatedBy: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Impersonation] }) + @ApiNestedQuery(ImpersonationFindManyArgs) + async impersonations( + @common.Req() request: Request + ): Promise<Impersonation[]> { + const args = plainToClass(ImpersonationFindManyArgs, request.query); + return this.service.impersonations({ + ...args, + select: { + id: true, + createdAt: true, + + impersonatedUser: { + select: { + id: true, + }, + }, + + impersonatedBy: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Impersonation }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async impersonation( + @common.Param() params: ImpersonationWhereUniqueInput + ): Promise<Impersonation | null> { + const result = await this.service.impersonation({ + where: params, + select: { + id: true, + createdAt: true, + + impersonatedUser: { + select: { + id: true, + }, + }, + + impersonatedBy: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Impersonation }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateImpersonation( + @common.Param() params: ImpersonationWhereUniqueInput, + @common.Body() data: ImpersonationUpdateInput + ): Promise<Impersonation | null> { + try { + return await this.service.updateImpersonation({ + where: params, + data: { + ...data, + + impersonatedUser: { + connect: data.impersonatedUser, + }, + + impersonatedBy: { + connect: data.impersonatedBy, + }, + }, + select: { + id: true, + createdAt: true, + + impersonatedUser: { + select: { + id: true, + }, + }, + + impersonatedBy: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Impersonation }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteImpersonation( + @common.Param() params: ImpersonationWhereUniqueInput + ): Promise<Impersonation | null> { + try { + return await this.service.deleteImpersonation({ + where: params, + select: { + id: true, + createdAt: true, + + impersonatedUser: { + select: { + id: true, + }, + }, + + impersonatedBy: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/impersonation/base/impersonation.module.base.ts b/apps/roi-cacl-2/src/impersonation/base/impersonation.module.base.ts new file mode 100644 index 0000000..15e43dc --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/impersonation.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class ImpersonationModuleBase {} diff --git a/apps/roi-cacl-2/src/impersonation/base/impersonation.resolver.base.ts b/apps/roi-cacl-2/src/impersonation/base/impersonation.resolver.base.ts new file mode 100644 index 0000000..ae2c74e --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/impersonation.resolver.base.ts @@ -0,0 +1,150 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Impersonation } from "./Impersonation"; +import { ImpersonationCountArgs } from "./ImpersonationCountArgs"; +import { ImpersonationFindManyArgs } from "./ImpersonationFindManyArgs"; +import { ImpersonationFindUniqueArgs } from "./ImpersonationFindUniqueArgs"; +import { CreateImpersonationArgs } from "./CreateImpersonationArgs"; +import { UpdateImpersonationArgs } from "./UpdateImpersonationArgs"; +import { DeleteImpersonationArgs } from "./DeleteImpersonationArgs"; +import { User } from "../../user/base/User"; +import { ImpersonationService } from "../impersonation.service"; +@graphql.Resolver(() => Impersonation) +export class ImpersonationResolverBase { + constructor(protected readonly service: ImpersonationService) {} + + async _impersonationsMeta( + @graphql.Args() args: ImpersonationCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Impersonation]) + async impersonations( + @graphql.Args() args: ImpersonationFindManyArgs + ): Promise<Impersonation[]> { + return this.service.impersonations(args); + } + + @graphql.Query(() => Impersonation, { nullable: true }) + async impersonation( + @graphql.Args() args: ImpersonationFindUniqueArgs + ): Promise<Impersonation | null> { + const result = await this.service.impersonation(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Impersonation) + async createImpersonation( + @graphql.Args() args: CreateImpersonationArgs + ): Promise<Impersonation> { + return await this.service.createImpersonation({ + ...args, + data: { + ...args.data, + + impersonatedUser: { + connect: args.data.impersonatedUser, + }, + + impersonatedBy: { + connect: args.data.impersonatedBy, + }, + }, + }); + } + + @graphql.Mutation(() => Impersonation) + async updateImpersonation( + @graphql.Args() args: UpdateImpersonationArgs + ): Promise<Impersonation | null> { + try { + return await this.service.updateImpersonation({ + ...args, + data: { + ...args.data, + + impersonatedUser: { + connect: args.data.impersonatedUser, + }, + + impersonatedBy: { + connect: args.data.impersonatedBy, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Impersonation) + async deleteImpersonation( + @graphql.Args() args: DeleteImpersonationArgs + ): Promise<Impersonation | null> { + try { + return await this.service.deleteImpersonation(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "impersonatedUser", + }) + async getImpersonatedUser( + @graphql.Parent() parent: Impersonation + ): Promise<User | null> { + const result = await this.service.getImpersonatedUser(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "impersonatedBy", + }) + async getImpersonatedBy( + @graphql.Parent() parent: Impersonation + ): Promise<User | null> { + const result = await this.service.getImpersonatedBy(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/impersonation/base/impersonation.service.base.ts b/apps/roi-cacl-2/src/impersonation/base/impersonation.service.base.ts new file mode 100644 index 0000000..45e53e7 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/base/impersonation.service.base.ts @@ -0,0 +1,71 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + Impersonation as PrismaImpersonation, + User as PrismaUser, +} from "@prisma/client"; + +export class ImpersonationServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.ImpersonationCountArgs, "select"> + ): Promise<number> { + return this.prisma.impersonation.count(args); + } + + async impersonations<T extends Prisma.ImpersonationFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.ImpersonationFindManyArgs> + ): Promise<PrismaImpersonation[]> { + return this.prisma.impersonation.findMany<Prisma.ImpersonationFindManyArgs>( + args + ); + } + async impersonation<T extends Prisma.ImpersonationFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.ImpersonationFindUniqueArgs> + ): Promise<PrismaImpersonation | null> { + return this.prisma.impersonation.findUnique(args); + } + async createImpersonation<T extends Prisma.ImpersonationCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.ImpersonationCreateArgs> + ): Promise<PrismaImpersonation> { + return this.prisma.impersonation.create<T>(args); + } + async updateImpersonation<T extends Prisma.ImpersonationUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.ImpersonationUpdateArgs> + ): Promise<PrismaImpersonation> { + return this.prisma.impersonation.update<T>(args); + } + async deleteImpersonation<T extends Prisma.ImpersonationDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.ImpersonationDeleteArgs> + ): Promise<PrismaImpersonation> { + return this.prisma.impersonation.delete(args); + } + + async getImpersonatedUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.impersonation + .findUnique({ + where: { id: parentId }, + }) + .impersonatedUser(); + } + + async getImpersonatedBy(parentId: number): Promise<PrismaUser | null> { + return this.prisma.impersonation + .findUnique({ + where: { id: parentId }, + }) + .impersonatedBy(); + } +} diff --git a/apps/roi-cacl-2/src/impersonation/impersonation.controller.ts b/apps/roi-cacl-2/src/impersonation/impersonation.controller.ts new file mode 100644 index 0000000..5d5f537 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/impersonation.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { ImpersonationService } from "./impersonation.service"; +import { ImpersonationControllerBase } from "./base/impersonation.controller.base"; + +@swagger.ApiTags("impersonations") +@common.Controller("impersonations") +export class ImpersonationController extends ImpersonationControllerBase { + constructor(protected readonly service: ImpersonationService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/impersonation/impersonation.module.ts b/apps/roi-cacl-2/src/impersonation/impersonation.module.ts new file mode 100644 index 0000000..a2252f2 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/impersonation.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { ImpersonationModuleBase } from "./base/impersonation.module.base"; +import { ImpersonationService } from "./impersonation.service"; +import { ImpersonationController } from "./impersonation.controller"; +import { ImpersonationResolver } from "./impersonation.resolver"; + +@Module({ + imports: [ImpersonationModuleBase], + controllers: [ImpersonationController], + providers: [ImpersonationService, ImpersonationResolver], + exports: [ImpersonationService], +}) +export class ImpersonationModule {} diff --git a/apps/roi-cacl-2/src/impersonation/impersonation.resolver.ts b/apps/roi-cacl-2/src/impersonation/impersonation.resolver.ts new file mode 100644 index 0000000..833d4b3 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/impersonation.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { ImpersonationResolverBase } from "./base/impersonation.resolver.base"; +import { Impersonation } from "./base/Impersonation"; +import { ImpersonationService } from "./impersonation.service"; + +@graphql.Resolver(() => Impersonation) +export class ImpersonationResolver extends ImpersonationResolverBase { + constructor(protected readonly service: ImpersonationService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/impersonation/impersonation.service.ts b/apps/roi-cacl-2/src/impersonation/impersonation.service.ts new file mode 100644 index 0000000..cc752d4 --- /dev/null +++ b/apps/roi-cacl-2/src/impersonation/impersonation.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { ImpersonationServiceBase } from "./base/impersonation.service.base"; + +@Injectable() +export class ImpersonationService extends ImpersonationServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/main.ts b/apps/roi-cacl-2/src/main.ts new file mode 100644 index 0000000..474eead --- /dev/null +++ b/apps/roi-cacl-2/src/main.ts @@ -0,0 +1,53 @@ +import { ValidationPipe } from "@nestjs/common"; +import { HttpAdapterHost, NestFactory } from "@nestjs/core"; +import { OpenAPIObject, SwaggerModule } from "@nestjs/swagger"; +import { HttpExceptionFilter } from "./filters/HttpExceptions.filter"; +import { AppModule } from "./app.module"; +import { connectMicroservices } from "./connectMicroservices"; +import { + swaggerPath, + swaggerDocumentOptions, + swaggerSetupOptions, +} from "./swagger"; + +const { PORT = 3000 } = process.env; + +async function main() { + const app = await NestFactory.create(AppModule, { cors: true }); + + app.setGlobalPrefix("api"); + app.useGlobalPipes( + new ValidationPipe({ + transform: true, + forbidUnknownValues: false, + }) + ); + + const document = SwaggerModule.createDocument(app, swaggerDocumentOptions); + + /** check if there is Public decorator for each path (action) and its method (findMany / findOne) on each controller */ + Object.values((document as OpenAPIObject).paths).forEach((path: any) => { + Object.values(path).forEach((method: any) => { + if ( + Array.isArray(method.security) && + method.security.includes("isPublic") + ) { + method.security = []; + } + }); + }); + + await connectMicroservices(app); + await app.startAllMicroservices(); + + SwaggerModule.setup(swaggerPath, app, document, swaggerSetupOptions); + + const { httpAdapter } = app.get(HttpAdapterHost); + app.useGlobalFilters(new HttpExceptionFilter(httpAdapter)); + + void app.listen(PORT); + + return app; +} + +module.exports = main(); diff --git a/apps/roi-cacl-2/src/membership/base/CreateMembershipArgs.ts b/apps/roi-cacl-2/src/membership/base/CreateMembershipArgs.ts new file mode 100644 index 0000000..49a1881 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/CreateMembershipArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { MembershipCreateInput } from "./MembershipCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateMembershipArgs { + @ApiProperty({ + required: true, + type: () => MembershipCreateInput, + }) + @ValidateNested() + @Type(() => MembershipCreateInput) + @Field(() => MembershipCreateInput, { nullable: false }) + data!: MembershipCreateInput; +} + +export { CreateMembershipArgs as CreateMembershipArgs }; diff --git a/apps/roi-cacl-2/src/membership/base/DeleteMembershipArgs.ts b/apps/roi-cacl-2/src/membership/base/DeleteMembershipArgs.ts new file mode 100644 index 0000000..f84f902 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/DeleteMembershipArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { MembershipWhereUniqueInput } from "./MembershipWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteMembershipArgs { + @ApiProperty({ + required: true, + type: () => MembershipWhereUniqueInput, + }) + @ValidateNested() + @Type(() => MembershipWhereUniqueInput) + @Field(() => MembershipWhereUniqueInput, { nullable: false }) + where!: MembershipWhereUniqueInput; +} + +export { DeleteMembershipArgs as DeleteMembershipArgs }; diff --git a/apps/roi-cacl-2/src/membership/base/EnumMembershipRole.ts b/apps/roi-cacl-2/src/membership/base/EnumMembershipRole.ts new file mode 100644 index 0000000..341099d --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/EnumMembershipRole.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumMembershipRole { + Member = "MEMBER", + Admin = "ADMIN", + Owner = "OWNER", +} + +registerEnumType(EnumMembershipRole, { + name: "EnumMembershipRole", +}); diff --git a/apps/roi-cacl-2/src/membership/base/Membership.ts b/apps/roi-cacl-2/src/membership/base/Membership.ts new file mode 100644 index 0000000..b774e21 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/Membership.ts @@ -0,0 +1,65 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsBoolean, IsEnum, ValidateNested } from "class-validator"; +import { EnumMembershipRole } from "./EnumMembershipRole"; +import { Team } from "../../team/base/Team"; +import { Type } from "class-transformer"; +import { User } from "../../user/base/User"; + +@ObjectType() +class Membership { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + accepted!: boolean; + + @ApiProperty({ + required: true, + enum: EnumMembershipRole, + }) + @IsEnum(EnumMembershipRole) + @Field(() => EnumMembershipRole, { + nullable: true, + }) + role?: "MEMBER" | "ADMIN" | "OWNER"; + + @ApiProperty({ + required: true, + type: () => Team, + }) + @ValidateNested() + @Type(() => Team) + team?: Team; + + @ApiProperty({ + required: true, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + user?: User; +} + +export { Membership as Membership }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipCountArgs.ts b/apps/roi-cacl-2/src/membership/base/MembershipCountArgs.ts new file mode 100644 index 0000000..1480008 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { MembershipWhereInput } from "./MembershipWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class MembershipCountArgs { + @ApiProperty({ + required: false, + type: () => MembershipWhereInput, + }) + @Field(() => MembershipWhereInput, { nullable: true }) + @Type(() => MembershipWhereInput) + where?: MembershipWhereInput; +} + +export { MembershipCountArgs as MembershipCountArgs }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipCreateInput.ts b/apps/roi-cacl-2/src/membership/base/MembershipCreateInput.ts new file mode 100644 index 0000000..a765bdd --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipCreateInput.ts @@ -0,0 +1,57 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsBoolean, IsEnum, ValidateNested } from "class-validator"; +import { EnumMembershipRole } from "./EnumMembershipRole"; +import { TeamWhereUniqueInput } from "../../team/base/TeamWhereUniqueInput"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class MembershipCreateInput { + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + accepted!: boolean; + + @ApiProperty({ + required: true, + enum: EnumMembershipRole, + }) + @IsEnum(EnumMembershipRole) + @Field(() => EnumMembershipRole) + role!: "MEMBER" | "ADMIN" | "OWNER"; + + @ApiProperty({ + required: true, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @Field(() => TeamWhereUniqueInput) + team!: TeamWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput) + user!: UserWhereUniqueInput; +} + +export { MembershipCreateInput as MembershipCreateInput }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipFindManyArgs.ts b/apps/roi-cacl-2/src/membership/base/MembershipFindManyArgs.ts new file mode 100644 index 0000000..26cc414 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { MembershipWhereInput } from "./MembershipWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { MembershipOrderByInput } from "./MembershipOrderByInput"; + +@ArgsType() +class MembershipFindManyArgs { + @ApiProperty({ + required: false, + type: () => MembershipWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => MembershipWhereInput, { nullable: true }) + @Type(() => MembershipWhereInput) + where?: MembershipWhereInput; + + @ApiProperty({ + required: false, + type: [MembershipOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [MembershipOrderByInput], { nullable: true }) + @Type(() => MembershipOrderByInput) + orderBy?: Array<MembershipOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { MembershipFindManyArgs as MembershipFindManyArgs }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipFindUniqueArgs.ts b/apps/roi-cacl-2/src/membership/base/MembershipFindUniqueArgs.ts new file mode 100644 index 0000000..5369523 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { MembershipWhereUniqueInput } from "./MembershipWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class MembershipFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => MembershipWhereUniqueInput, + }) + @ValidateNested() + @Type(() => MembershipWhereUniqueInput) + @Field(() => MembershipWhereUniqueInput, { nullable: false }) + where!: MembershipWhereUniqueInput; +} + +export { MembershipFindUniqueArgs as MembershipFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipListRelationFilter.ts b/apps/roi-cacl-2/src/membership/base/MembershipListRelationFilter.ts new file mode 100644 index 0000000..21e1c75 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { MembershipWhereInput } from "./MembershipWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class MembershipListRelationFilter { + @ApiProperty({ + required: false, + type: () => MembershipWhereInput, + }) + @ValidateNested() + @Type(() => MembershipWhereInput) + @IsOptional() + @Field(() => MembershipWhereInput, { + nullable: true, + }) + every?: MembershipWhereInput; + + @ApiProperty({ + required: false, + type: () => MembershipWhereInput, + }) + @ValidateNested() + @Type(() => MembershipWhereInput) + @IsOptional() + @Field(() => MembershipWhereInput, { + nullable: true, + }) + some?: MembershipWhereInput; + + @ApiProperty({ + required: false, + type: () => MembershipWhereInput, + }) + @ValidateNested() + @Type(() => MembershipWhereInput) + @IsOptional() + @Field(() => MembershipWhereInput, { + nullable: true, + }) + none?: MembershipWhereInput; +} +export { MembershipListRelationFilter as MembershipListRelationFilter }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipOrderByInput.ts b/apps/roi-cacl-2/src/membership/base/MembershipOrderByInput.ts new file mode 100644 index 0000000..a72dfb5 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipOrderByInput.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class MembershipOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + accepted?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + role?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + teamId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; +} + +export { MembershipOrderByInput as MembershipOrderByInput }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipUpdateInput.ts b/apps/roi-cacl-2/src/membership/base/MembershipUpdateInput.ts new file mode 100644 index 0000000..9642f3f --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipUpdateInput.ts @@ -0,0 +1,69 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsBoolean, IsOptional, IsEnum, ValidateNested } from "class-validator"; +import { EnumMembershipRole } from "./EnumMembershipRole"; +import { TeamWhereUniqueInput } from "../../team/base/TeamWhereUniqueInput"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class MembershipUpdateInput { + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + accepted?: boolean; + + @ApiProperty({ + required: false, + enum: EnumMembershipRole, + }) + @IsEnum(EnumMembershipRole) + @IsOptional() + @Field(() => EnumMembershipRole, { + nullable: true, + }) + role?: "MEMBER" | "ADMIN" | "OWNER"; + + @ApiProperty({ + required: false, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @IsOptional() + @Field(() => TeamWhereUniqueInput, { + nullable: true, + }) + team?: TeamWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; +} + +export { MembershipUpdateInput as MembershipUpdateInput }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipWhereInput.ts b/apps/roi-cacl-2/src/membership/base/MembershipWhereInput.ts new file mode 100644 index 0000000..f88b107 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipWhereInput.ts @@ -0,0 +1,82 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, IsEnum, ValidateNested } from "class-validator"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { EnumMembershipRole } from "./EnumMembershipRole"; +import { TeamWhereUniqueInput } from "../../team/base/TeamWhereUniqueInput"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class MembershipWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + accepted?: BooleanFilter; + + @ApiProperty({ + required: false, + enum: EnumMembershipRole, + }) + @IsEnum(EnumMembershipRole) + @IsOptional() + @Field(() => EnumMembershipRole, { + nullable: true, + }) + role?: "MEMBER" | "ADMIN" | "OWNER"; + + @ApiProperty({ + required: false, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @IsOptional() + @Field(() => TeamWhereUniqueInput, { + nullable: true, + }) + team?: TeamWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; +} + +export { MembershipWhereInput as MembershipWhereInput }; diff --git a/apps/roi-cacl-2/src/membership/base/MembershipWhereUniqueInput.ts b/apps/roi-cacl-2/src/membership/base/MembershipWhereUniqueInput.ts new file mode 100644 index 0000000..2fe98e6 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/MembershipWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class MembershipWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { MembershipWhereUniqueInput as MembershipWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/membership/base/UpdateMembershipArgs.ts b/apps/roi-cacl-2/src/membership/base/UpdateMembershipArgs.ts new file mode 100644 index 0000000..6d50a26 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/UpdateMembershipArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { MembershipWhereUniqueInput } from "./MembershipWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { MembershipUpdateInput } from "./MembershipUpdateInput"; + +@ArgsType() +class UpdateMembershipArgs { + @ApiProperty({ + required: true, + type: () => MembershipWhereUniqueInput, + }) + @ValidateNested() + @Type(() => MembershipWhereUniqueInput) + @Field(() => MembershipWhereUniqueInput, { nullable: false }) + where!: MembershipWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => MembershipUpdateInput, + }) + @ValidateNested() + @Type(() => MembershipUpdateInput) + @Field(() => MembershipUpdateInput, { nullable: false }) + data!: MembershipUpdateInput; +} + +export { UpdateMembershipArgs as UpdateMembershipArgs }; diff --git a/apps/roi-cacl-2/src/membership/base/membership.controller.base.spec.ts b/apps/roi-cacl-2/src/membership/base/membership.controller.base.spec.ts new file mode 100644 index 0000000..c9046d3 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/membership.controller.base.spec.ts @@ -0,0 +1,168 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { MembershipController } from "../membership.controller"; +import { MembershipService } from "../membership.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + accepted: "true", +}; +const CREATE_RESULT = { + id: 42, + accepted: "true", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + accepted: "true", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + accepted: "true", +}; + +const service = { + createMembership() { + return CREATE_RESULT; + }, + memberships: () => FIND_MANY_RESULT, + membership: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Membership", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: MembershipService, + useValue: service, + }, + ], + controllers: [MembershipController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /memberships", async () => { + await request(app.getHttpServer()) + .post("/memberships") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /memberships", async () => { + await request(app.getHttpServer()) + .get("/memberships") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /memberships/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/memberships"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /memberships/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/memberships"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /memberships existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/memberships") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/memberships") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/membership/base/membership.controller.base.ts b/apps/roi-cacl-2/src/membership/base/membership.controller.base.ts new file mode 100644 index 0000000..20f8af9 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/membership.controller.base.ts @@ -0,0 +1,211 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { MembershipService } from "../membership.service"; +import { MembershipCreateInput } from "./MembershipCreateInput"; +import { Membership } from "./Membership"; +import { MembershipFindManyArgs } from "./MembershipFindManyArgs"; +import { MembershipWhereUniqueInput } from "./MembershipWhereUniqueInput"; +import { MembershipUpdateInput } from "./MembershipUpdateInput"; + +export class MembershipControllerBase { + constructor(protected readonly service: MembershipService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Membership }) + async createMembership( + @common.Body() data: MembershipCreateInput + ): Promise<Membership> { + return await this.service.createMembership({ + data: { + ...data, + + team: { + connect: data.team, + }, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + accepted: true, + role: true, + + team: { + select: { + id: true, + }, + }, + + user: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Membership] }) + @ApiNestedQuery(MembershipFindManyArgs) + async memberships(@common.Req() request: Request): Promise<Membership[]> { + const args = plainToClass(MembershipFindManyArgs, request.query); + return this.service.memberships({ + ...args, + select: { + id: true, + accepted: true, + role: true, + + team: { + select: { + id: true, + }, + }, + + user: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Membership }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async membership( + @common.Param() params: MembershipWhereUniqueInput + ): Promise<Membership | null> { + const result = await this.service.membership({ + where: params, + select: { + id: true, + accepted: true, + role: true, + + team: { + select: { + id: true, + }, + }, + + user: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Membership }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateMembership( + @common.Param() params: MembershipWhereUniqueInput, + @common.Body() data: MembershipUpdateInput + ): Promise<Membership | null> { + try { + return await this.service.updateMembership({ + where: params, + data: { + ...data, + + team: { + connect: data.team, + }, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + accepted: true, + role: true, + + team: { + select: { + id: true, + }, + }, + + user: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Membership }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteMembership( + @common.Param() params: MembershipWhereUniqueInput + ): Promise<Membership | null> { + try { + return await this.service.deleteMembership({ + where: params, + select: { + id: true, + accepted: true, + role: true, + + team: { + select: { + id: true, + }, + }, + + user: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/membership/base/membership.module.base.ts b/apps/roi-cacl-2/src/membership/base/membership.module.base.ts new file mode 100644 index 0000000..39efc03 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/membership.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class MembershipModuleBase {} diff --git a/apps/roi-cacl-2/src/membership/base/membership.resolver.base.ts b/apps/roi-cacl-2/src/membership/base/membership.resolver.base.ts new file mode 100644 index 0000000..4d71cac --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/membership.resolver.base.ts @@ -0,0 +1,147 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Membership } from "./Membership"; +import { MembershipCountArgs } from "./MembershipCountArgs"; +import { MembershipFindManyArgs } from "./MembershipFindManyArgs"; +import { MembershipFindUniqueArgs } from "./MembershipFindUniqueArgs"; +import { CreateMembershipArgs } from "./CreateMembershipArgs"; +import { UpdateMembershipArgs } from "./UpdateMembershipArgs"; +import { DeleteMembershipArgs } from "./DeleteMembershipArgs"; +import { Team } from "../../team/base/Team"; +import { User } from "../../user/base/User"; +import { MembershipService } from "../membership.service"; +@graphql.Resolver(() => Membership) +export class MembershipResolverBase { + constructor(protected readonly service: MembershipService) {} + + async _membershipsMeta( + @graphql.Args() args: MembershipCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Membership]) + async memberships( + @graphql.Args() args: MembershipFindManyArgs + ): Promise<Membership[]> { + return this.service.memberships(args); + } + + @graphql.Query(() => Membership, { nullable: true }) + async membership( + @graphql.Args() args: MembershipFindUniqueArgs + ): Promise<Membership | null> { + const result = await this.service.membership(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Membership) + async createMembership( + @graphql.Args() args: CreateMembershipArgs + ): Promise<Membership> { + return await this.service.createMembership({ + ...args, + data: { + ...args.data, + + team: { + connect: args.data.team, + }, + + user: { + connect: args.data.user, + }, + }, + }); + } + + @graphql.Mutation(() => Membership) + async updateMembership( + @graphql.Args() args: UpdateMembershipArgs + ): Promise<Membership | null> { + try { + return await this.service.updateMembership({ + ...args, + data: { + ...args.data, + + team: { + connect: args.data.team, + }, + + user: { + connect: args.data.user, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Membership) + async deleteMembership( + @graphql.Args() args: DeleteMembershipArgs + ): Promise<Membership | null> { + try { + return await this.service.deleteMembership(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => Team, { + nullable: true, + name: "team", + }) + async getTeam(@graphql.Parent() parent: Membership): Promise<Team | null> { + const result = await this.service.getTeam(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Membership): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/membership/base/membership.service.base.ts b/apps/roi-cacl-2/src/membership/base/membership.service.base.ts new file mode 100644 index 0000000..e1cc559 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/base/membership.service.base.ts @@ -0,0 +1,71 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Membership as PrismaMembership, + Team as PrismaTeam, + User as PrismaUser, +} from "@prisma/client"; + +export class MembershipServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.MembershipCountArgs, "select"> + ): Promise<number> { + return this.prisma.membership.count(args); + } + + async memberships<T extends Prisma.MembershipFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.MembershipFindManyArgs> + ): Promise<PrismaMembership[]> { + return this.prisma.membership.findMany<Prisma.MembershipFindManyArgs>(args); + } + async membership<T extends Prisma.MembershipFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.MembershipFindUniqueArgs> + ): Promise<PrismaMembership | null> { + return this.prisma.membership.findUnique(args); + } + async createMembership<T extends Prisma.MembershipCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.MembershipCreateArgs> + ): Promise<PrismaMembership> { + return this.prisma.membership.create<T>(args); + } + async updateMembership<T extends Prisma.MembershipUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.MembershipUpdateArgs> + ): Promise<PrismaMembership> { + return this.prisma.membership.update<T>(args); + } + async deleteMembership<T extends Prisma.MembershipDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.MembershipDeleteArgs> + ): Promise<PrismaMembership> { + return this.prisma.membership.delete(args); + } + + async getTeam(parentId: number): Promise<PrismaTeam | null> { + return this.prisma.membership + .findUnique({ + where: { id: parentId }, + }) + .team(); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.membership + .findUnique({ + where: { id: parentId }, + }) + .user(); + } +} diff --git a/apps/roi-cacl-2/src/membership/membership.controller.ts b/apps/roi-cacl-2/src/membership/membership.controller.ts new file mode 100644 index 0000000..285142a --- /dev/null +++ b/apps/roi-cacl-2/src/membership/membership.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { MembershipService } from "./membership.service"; +import { MembershipControllerBase } from "./base/membership.controller.base"; + +@swagger.ApiTags("memberships") +@common.Controller("memberships") +export class MembershipController extends MembershipControllerBase { + constructor(protected readonly service: MembershipService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/membership/membership.module.ts b/apps/roi-cacl-2/src/membership/membership.module.ts new file mode 100644 index 0000000..1cba28c --- /dev/null +++ b/apps/roi-cacl-2/src/membership/membership.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { MembershipModuleBase } from "./base/membership.module.base"; +import { MembershipService } from "./membership.service"; +import { MembershipController } from "./membership.controller"; +import { MembershipResolver } from "./membership.resolver"; + +@Module({ + imports: [MembershipModuleBase], + controllers: [MembershipController], + providers: [MembershipService, MembershipResolver], + exports: [MembershipService], +}) +export class MembershipModule {} diff --git a/apps/roi-cacl-2/src/membership/membership.resolver.ts b/apps/roi-cacl-2/src/membership/membership.resolver.ts new file mode 100644 index 0000000..7163597 --- /dev/null +++ b/apps/roi-cacl-2/src/membership/membership.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { MembershipResolverBase } from "./base/membership.resolver.base"; +import { Membership } from "./base/Membership"; +import { MembershipService } from "./membership.service"; + +@graphql.Resolver(() => Membership) +export class MembershipResolver extends MembershipResolverBase { + constructor(protected readonly service: MembershipService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/membership/membership.service.ts b/apps/roi-cacl-2/src/membership/membership.service.ts new file mode 100644 index 0000000..076255e --- /dev/null +++ b/apps/roi-cacl-2/src/membership/membership.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { MembershipServiceBase } from "./base/membership.service.base"; + +@Injectable() +export class MembershipService extends MembershipServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/payment/base/CreatePaymentArgs.ts b/apps/roi-cacl-2/src/payment/base/CreatePaymentArgs.ts new file mode 100644 index 0000000..08c4550 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/CreatePaymentArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { PaymentCreateInput } from "./PaymentCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreatePaymentArgs { + @ApiProperty({ + required: true, + type: () => PaymentCreateInput, + }) + @ValidateNested() + @Type(() => PaymentCreateInput) + @Field(() => PaymentCreateInput, { nullable: false }) + data!: PaymentCreateInput; +} + +export { CreatePaymentArgs as CreatePaymentArgs }; diff --git a/apps/roi-cacl-2/src/payment/base/DeletePaymentArgs.ts b/apps/roi-cacl-2/src/payment/base/DeletePaymentArgs.ts new file mode 100644 index 0000000..0e2f53c --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/DeletePaymentArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { PaymentWhereUniqueInput } from "./PaymentWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeletePaymentArgs { + @ApiProperty({ + required: true, + type: () => PaymentWhereUniqueInput, + }) + @ValidateNested() + @Type(() => PaymentWhereUniqueInput) + @Field(() => PaymentWhereUniqueInput, { nullable: false }) + where!: PaymentWhereUniqueInput; +} + +export { DeletePaymentArgs as DeletePaymentArgs }; diff --git a/apps/roi-cacl-2/src/payment/base/EnumPaymentType.ts b/apps/roi-cacl-2/src/payment/base/EnumPaymentType.ts new file mode 100644 index 0000000..3998964 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/EnumPaymentType.ts @@ -0,0 +1,20 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumPaymentType { + Stripe = "STRIPE", +} + +registerEnumType(EnumPaymentType, { + name: "EnumPaymentType", +}); diff --git a/apps/roi-cacl-2/src/payment/base/Payment.ts b/apps/roi-cacl-2/src/payment/base/Payment.ts new file mode 100644 index 0000000..13d4cea --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/Payment.ts @@ -0,0 +1,122 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsString, + IsEnum, + ValidateNested, + IsOptional, + IsBoolean, +} from "class-validator"; +import { EnumPaymentType } from "./EnumPaymentType"; +import { Booking } from "../../booking/base/Booking"; +import { Type } from "class-transformer"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { JsonValue } from "type-fest"; + +@ObjectType() +class Payment { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + uid!: string; + + @ApiProperty({ + required: true, + enum: EnumPaymentType, + }) + @IsEnum(EnumPaymentType) + @Field(() => EnumPaymentType, { + nullable: true, + }) + type?: "STRIPE"; + + @ApiProperty({ + required: false, + type: () => Booking, + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + booking?: Booking | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + amount!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + fee!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + currency!: string; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + success!: boolean; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + refunded!: boolean; + + @ApiProperty({ + required: true, + }) + @IsJSONValue() + @Field(() => GraphQLJSON) + data!: JsonValue; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + externalId!: string; +} + +export { Payment as Payment }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentCountArgs.ts b/apps/roi-cacl-2/src/payment/base/PaymentCountArgs.ts new file mode 100644 index 0000000..bded3ae --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { PaymentWhereInput } from "./PaymentWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class PaymentCountArgs { + @ApiProperty({ + required: false, + type: () => PaymentWhereInput, + }) + @Field(() => PaymentWhereInput, { nullable: true }) + @Type(() => PaymentWhereInput) + where?: PaymentWhereInput; +} + +export { PaymentCountArgs as PaymentCountArgs }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentCreateInput.ts b/apps/roi-cacl-2/src/payment/base/PaymentCreateInput.ts new file mode 100644 index 0000000..6a5702a --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentCreateInput.ts @@ -0,0 +1,115 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsEnum, + ValidateNested, + IsOptional, + IsInt, + IsBoolean, +} from "class-validator"; +import { EnumPaymentType } from "./EnumPaymentType"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; + +@InputType() +class PaymentCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + uid!: string; + + @ApiProperty({ + required: true, + enum: EnumPaymentType, + }) + @IsEnum(EnumPaymentType) + @Field(() => EnumPaymentType) + type!: "STRIPE"; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + amount!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + fee!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + currency!: string; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + success!: boolean; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + refunded!: boolean; + + @ApiProperty({ + required: true, + }) + @IsJSONValue() + @Field(() => GraphQLJSON) + data!: InputJsonValue; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + externalId!: string; +} + +export { PaymentCreateInput as PaymentCreateInput }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentFindManyArgs.ts b/apps/roi-cacl-2/src/payment/base/PaymentFindManyArgs.ts new file mode 100644 index 0000000..1f9f9c5 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { PaymentWhereInput } from "./PaymentWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { PaymentOrderByInput } from "./PaymentOrderByInput"; + +@ArgsType() +class PaymentFindManyArgs { + @ApiProperty({ + required: false, + type: () => PaymentWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => PaymentWhereInput, { nullable: true }) + @Type(() => PaymentWhereInput) + where?: PaymentWhereInput; + + @ApiProperty({ + required: false, + type: [PaymentOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [PaymentOrderByInput], { nullable: true }) + @Type(() => PaymentOrderByInput) + orderBy?: Array<PaymentOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { PaymentFindManyArgs as PaymentFindManyArgs }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentFindUniqueArgs.ts b/apps/roi-cacl-2/src/payment/base/PaymentFindUniqueArgs.ts new file mode 100644 index 0000000..1f849bd --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { PaymentWhereUniqueInput } from "./PaymentWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class PaymentFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => PaymentWhereUniqueInput, + }) + @ValidateNested() + @Type(() => PaymentWhereUniqueInput) + @Field(() => PaymentWhereUniqueInput, { nullable: false }) + where!: PaymentWhereUniqueInput; +} + +export { PaymentFindUniqueArgs as PaymentFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentListRelationFilter.ts b/apps/roi-cacl-2/src/payment/base/PaymentListRelationFilter.ts new file mode 100644 index 0000000..027a9e6 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { PaymentWhereInput } from "./PaymentWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class PaymentListRelationFilter { + @ApiProperty({ + required: false, + type: () => PaymentWhereInput, + }) + @ValidateNested() + @Type(() => PaymentWhereInput) + @IsOptional() + @Field(() => PaymentWhereInput, { + nullable: true, + }) + every?: PaymentWhereInput; + + @ApiProperty({ + required: false, + type: () => PaymentWhereInput, + }) + @ValidateNested() + @Type(() => PaymentWhereInput) + @IsOptional() + @Field(() => PaymentWhereInput, { + nullable: true, + }) + some?: PaymentWhereInput; + + @ApiProperty({ + required: false, + type: () => PaymentWhereInput, + }) + @ValidateNested() + @Type(() => PaymentWhereInput) + @IsOptional() + @Field(() => PaymentWhereInput, { + nullable: true, + }) + none?: PaymentWhereInput; +} +export { PaymentListRelationFilter as PaymentListRelationFilter }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentOrderByInput.ts b/apps/roi-cacl-2/src/payment/base/PaymentOrderByInput.ts new file mode 100644 index 0000000..03bb0f1 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentOrderByInput.ts @@ -0,0 +1,144 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class PaymentOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + uid?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + type?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bookingId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + amount?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + fee?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + currency?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + success?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + refunded?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + data?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + externalId?: SortOrder; +} + +export { PaymentOrderByInput as PaymentOrderByInput }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentUpdateInput.ts b/apps/roi-cacl-2/src/payment/base/PaymentUpdateInput.ts new file mode 100644 index 0000000..54bad75 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentUpdateInput.ts @@ -0,0 +1,142 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsEnum, + ValidateNested, + IsInt, + IsBoolean, +} from "class-validator"; +import { EnumPaymentType } from "./EnumPaymentType"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { Type } from "class-transformer"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; + +@InputType() +class PaymentUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + uid?: string; + + @ApiProperty({ + required: false, + enum: EnumPaymentType, + }) + @IsEnum(EnumPaymentType) + @IsOptional() + @Field(() => EnumPaymentType, { + nullable: true, + }) + type?: "STRIPE"; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + amount?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + fee?: number; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + currency?: string; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + success?: boolean; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + refunded?: boolean; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + data?: InputJsonValue; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + externalId?: string; +} + +export { PaymentUpdateInput as PaymentUpdateInput }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentWhereInput.ts b/apps/roi-cacl-2/src/payment/base/PaymentWhereInput.ts new file mode 100644 index 0000000..c40ac3a --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentWhereInput.ts @@ -0,0 +1,148 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, IsEnum, ValidateNested } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { EnumPaymentType } from "./EnumPaymentType"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { JsonFilter } from "../../util/JsonFilter"; + +@InputType() +class PaymentWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + uid?: StringFilter; + + @ApiProperty({ + required: false, + enum: EnumPaymentType, + }) + @IsEnum(EnumPaymentType) + @IsOptional() + @Field(() => EnumPaymentType, { + nullable: true, + }) + type?: "STRIPE"; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + amount?: IntFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + fee?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + currency?: StringFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + success?: BooleanFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + refunded?: BooleanFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + data?: JsonFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + externalId?: StringFilter; +} + +export { PaymentWhereInput as PaymentWhereInput }; diff --git a/apps/roi-cacl-2/src/payment/base/PaymentWhereUniqueInput.ts b/apps/roi-cacl-2/src/payment/base/PaymentWhereUniqueInput.ts new file mode 100644 index 0000000..ebfe698 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/PaymentWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class PaymentWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { PaymentWhereUniqueInput as PaymentWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/payment/base/UpdatePaymentArgs.ts b/apps/roi-cacl-2/src/payment/base/UpdatePaymentArgs.ts new file mode 100644 index 0000000..8987d5b --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/UpdatePaymentArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { PaymentWhereUniqueInput } from "./PaymentWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { PaymentUpdateInput } from "./PaymentUpdateInput"; + +@ArgsType() +class UpdatePaymentArgs { + @ApiProperty({ + required: true, + type: () => PaymentWhereUniqueInput, + }) + @ValidateNested() + @Type(() => PaymentWhereUniqueInput) + @Field(() => PaymentWhereUniqueInput, { nullable: false }) + where!: PaymentWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => PaymentUpdateInput, + }) + @ValidateNested() + @Type(() => PaymentUpdateInput) + @Field(() => PaymentUpdateInput, { nullable: false }) + data!: PaymentUpdateInput; +} + +export { UpdatePaymentArgs as UpdatePaymentArgs }; diff --git a/apps/roi-cacl-2/src/payment/base/payment.controller.base.spec.ts b/apps/roi-cacl-2/src/payment/base/payment.controller.base.spec.ts new file mode 100644 index 0000000..c1e8072 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/payment.controller.base.spec.ts @@ -0,0 +1,192 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { PaymentController } from "../payment.controller"; +import { PaymentService } from "../payment.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + uid: "exampleUid", + amount: 42, + fee: 42, + currency: "exampleCurrency", + success: "true", + refunded: "true", + externalId: "exampleExternalId", +}; +const CREATE_RESULT = { + id: 42, + uid: "exampleUid", + amount: 42, + fee: 42, + currency: "exampleCurrency", + success: "true", + refunded: "true", + externalId: "exampleExternalId", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + uid: "exampleUid", + amount: 42, + fee: 42, + currency: "exampleCurrency", + success: "true", + refunded: "true", + externalId: "exampleExternalId", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + uid: "exampleUid", + amount: 42, + fee: 42, + currency: "exampleCurrency", + success: "true", + refunded: "true", + externalId: "exampleExternalId", +}; + +const service = { + createPayment() { + return CREATE_RESULT; + }, + payments: () => FIND_MANY_RESULT, + payment: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Payment", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: PaymentService, + useValue: service, + }, + ], + controllers: [PaymentController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /payments", async () => { + await request(app.getHttpServer()) + .post("/payments") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /payments", async () => { + await request(app.getHttpServer()) + .get("/payments") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /payments/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/payments"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /payments/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/payments"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /payments existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/payments") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/payments") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/payment/base/payment.controller.base.ts b/apps/roi-cacl-2/src/payment/base/payment.controller.base.ts new file mode 100644 index 0000000..8935f5d --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/payment.controller.base.ts @@ -0,0 +1,217 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { PaymentService } from "../payment.service"; +import { PaymentCreateInput } from "./PaymentCreateInput"; +import { Payment } from "./Payment"; +import { PaymentFindManyArgs } from "./PaymentFindManyArgs"; +import { PaymentWhereUniqueInput } from "./PaymentWhereUniqueInput"; +import { PaymentUpdateInput } from "./PaymentUpdateInput"; + +export class PaymentControllerBase { + constructor(protected readonly service: PaymentService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Payment }) + async createPayment( + @common.Body() data: PaymentCreateInput + ): Promise<Payment> { + return await this.service.createPayment({ + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + uid: true, + type: true, + + booking: { + select: { + id: true, + }, + }, + + amount: true, + fee: true, + currency: true, + success: true, + refunded: true, + data: true, + externalId: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Payment] }) + @ApiNestedQuery(PaymentFindManyArgs) + async payments(@common.Req() request: Request): Promise<Payment[]> { + const args = plainToClass(PaymentFindManyArgs, request.query); + return this.service.payments({ + ...args, + select: { + id: true, + uid: true, + type: true, + + booking: { + select: { + id: true, + }, + }, + + amount: true, + fee: true, + currency: true, + success: true, + refunded: true, + data: true, + externalId: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Payment }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async payment( + @common.Param() params: PaymentWhereUniqueInput + ): Promise<Payment | null> { + const result = await this.service.payment({ + where: params, + select: { + id: true, + uid: true, + type: true, + + booking: { + select: { + id: true, + }, + }, + + amount: true, + fee: true, + currency: true, + success: true, + refunded: true, + data: true, + externalId: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Payment }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updatePayment( + @common.Param() params: PaymentWhereUniqueInput, + @common.Body() data: PaymentUpdateInput + ): Promise<Payment | null> { + try { + return await this.service.updatePayment({ + where: params, + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + }, + select: { + id: true, + uid: true, + type: true, + + booking: { + select: { + id: true, + }, + }, + + amount: true, + fee: true, + currency: true, + success: true, + refunded: true, + data: true, + externalId: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Payment }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deletePayment( + @common.Param() params: PaymentWhereUniqueInput + ): Promise<Payment | null> { + try { + return await this.service.deletePayment({ + where: params, + select: { + id: true, + uid: true, + type: true, + + booking: { + select: { + id: true, + }, + }, + + amount: true, + fee: true, + currency: true, + success: true, + refunded: true, + data: true, + externalId: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/payment/base/payment.module.base.ts b/apps/roi-cacl-2/src/payment/base/payment.module.base.ts new file mode 100644 index 0000000..bd786e5 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/payment.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class PaymentModuleBase {} diff --git a/apps/roi-cacl-2/src/payment/base/payment.resolver.base.ts b/apps/roi-cacl-2/src/payment/base/payment.resolver.base.ts new file mode 100644 index 0000000..27ad43e --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/payment.resolver.base.ts @@ -0,0 +1,129 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Payment } from "./Payment"; +import { PaymentCountArgs } from "./PaymentCountArgs"; +import { PaymentFindManyArgs } from "./PaymentFindManyArgs"; +import { PaymentFindUniqueArgs } from "./PaymentFindUniqueArgs"; +import { CreatePaymentArgs } from "./CreatePaymentArgs"; +import { UpdatePaymentArgs } from "./UpdatePaymentArgs"; +import { DeletePaymentArgs } from "./DeletePaymentArgs"; +import { Booking } from "../../booking/base/Booking"; +import { PaymentService } from "../payment.service"; +@graphql.Resolver(() => Payment) +export class PaymentResolverBase { + constructor(protected readonly service: PaymentService) {} + + async _paymentsMeta( + @graphql.Args() args: PaymentCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Payment]) + async payments( + @graphql.Args() args: PaymentFindManyArgs + ): Promise<Payment[]> { + return this.service.payments(args); + } + + @graphql.Query(() => Payment, { nullable: true }) + async payment( + @graphql.Args() args: PaymentFindUniqueArgs + ): Promise<Payment | null> { + const result = await this.service.payment(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Payment) + async createPayment( + @graphql.Args() args: CreatePaymentArgs + ): Promise<Payment> { + return await this.service.createPayment({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Payment) + async updatePayment( + @graphql.Args() args: UpdatePaymentArgs + ): Promise<Payment | null> { + try { + return await this.service.updatePayment({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Payment) + async deletePayment( + @graphql.Args() args: DeletePaymentArgs + ): Promise<Payment | null> { + try { + return await this.service.deletePayment(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => Booking, { + nullable: true, + name: "booking", + }) + async getBooking(@graphql.Parent() parent: Payment): Promise<Booking | null> { + const result = await this.service.getBooking(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/payment/base/payment.service.base.ts b/apps/roi-cacl-2/src/payment/base/payment.service.base.ts new file mode 100644 index 0000000..398ed84 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/base/payment.service.base.ts @@ -0,0 +1,59 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + Payment as PrismaPayment, + Booking as PrismaBooking, +} from "@prisma/client"; + +export class PaymentServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.PaymentCountArgs, "select">): Promise<number> { + return this.prisma.payment.count(args); + } + + async payments<T extends Prisma.PaymentFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.PaymentFindManyArgs> + ): Promise<PrismaPayment[]> { + return this.prisma.payment.findMany<Prisma.PaymentFindManyArgs>(args); + } + async payment<T extends Prisma.PaymentFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.PaymentFindUniqueArgs> + ): Promise<PrismaPayment | null> { + return this.prisma.payment.findUnique(args); + } + async createPayment<T extends Prisma.PaymentCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.PaymentCreateArgs> + ): Promise<PrismaPayment> { + return this.prisma.payment.create<T>(args); + } + async updatePayment<T extends Prisma.PaymentUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.PaymentUpdateArgs> + ): Promise<PrismaPayment> { + return this.prisma.payment.update<T>(args); + } + async deletePayment<T extends Prisma.PaymentDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.PaymentDeleteArgs> + ): Promise<PrismaPayment> { + return this.prisma.payment.delete(args); + } + + async getBooking(parentId: number): Promise<PrismaBooking | null> { + return this.prisma.payment + .findUnique({ + where: { id: parentId }, + }) + .booking(); + } +} diff --git a/apps/roi-cacl-2/src/payment/payment.controller.ts b/apps/roi-cacl-2/src/payment/payment.controller.ts new file mode 100644 index 0000000..7c02bc3 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/payment.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { PaymentService } from "./payment.service"; +import { PaymentControllerBase } from "./base/payment.controller.base"; + +@swagger.ApiTags("payments") +@common.Controller("payments") +export class PaymentController extends PaymentControllerBase { + constructor(protected readonly service: PaymentService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/payment/payment.module.ts b/apps/roi-cacl-2/src/payment/payment.module.ts new file mode 100644 index 0000000..8779d63 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/payment.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { PaymentModuleBase } from "./base/payment.module.base"; +import { PaymentService } from "./payment.service"; +import { PaymentController } from "./payment.controller"; +import { PaymentResolver } from "./payment.resolver"; + +@Module({ + imports: [PaymentModuleBase], + controllers: [PaymentController], + providers: [PaymentService, PaymentResolver], + exports: [PaymentService], +}) +export class PaymentModule {} diff --git a/apps/roi-cacl-2/src/payment/payment.resolver.ts b/apps/roi-cacl-2/src/payment/payment.resolver.ts new file mode 100644 index 0000000..6df076d --- /dev/null +++ b/apps/roi-cacl-2/src/payment/payment.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { PaymentResolverBase } from "./base/payment.resolver.base"; +import { Payment } from "./base/Payment"; +import { PaymentService } from "./payment.service"; + +@graphql.Resolver(() => Payment) +export class PaymentResolver extends PaymentResolverBase { + constructor(protected readonly service: PaymentService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/payment/payment.service.ts b/apps/roi-cacl-2/src/payment/payment.service.ts new file mode 100644 index 0000000..e331cf6 --- /dev/null +++ b/apps/roi-cacl-2/src/payment/payment.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { PaymentServiceBase } from "./base/payment.service.base"; + +@Injectable() +export class PaymentService extends PaymentServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/prisma.util.spec.ts b/apps/roi-cacl-2/src/prisma.util.spec.ts new file mode 100644 index 0000000..0aa308e --- /dev/null +++ b/apps/roi-cacl-2/src/prisma.util.spec.ts @@ -0,0 +1,23 @@ +import { + isRecordNotFoundError, + PRISMA_QUERY_INTERPRETATION_ERROR, +} from "./prisma.util"; + +describe("isRecordNotFoundError", () => { + test("returns true for record not found error", () => { + expect( + isRecordNotFoundError( + Object.assign( + new Error(`Error occurred during query execution: + InterpretationError("Error for binding '0': RecordNotFound("Record to update not found.")")`), + { + code: PRISMA_QUERY_INTERPRETATION_ERROR, + } + ) + ) + ).toBe(true); + }); + test("returns false for any other error", () => { + expect(isRecordNotFoundError(new Error())).toBe(false); + }); +}); diff --git a/apps/roi-cacl-2/src/prisma.util.ts b/apps/roi-cacl-2/src/prisma.util.ts new file mode 100644 index 0000000..029b98a --- /dev/null +++ b/apps/roi-cacl-2/src/prisma.util.ts @@ -0,0 +1,29 @@ +export const PRISMA_QUERY_INTERPRETATION_ERROR = "P2016"; +export const PRISMA_RECORD_NOT_FOUND = "RecordNotFound"; + +export function isRecordNotFoundError(error: any): boolean { + return ( + error instanceof Error && + "code" in error && + error.code === PRISMA_QUERY_INTERPRETATION_ERROR && + error.message.includes(PRISMA_RECORD_NOT_FOUND) + ); +} + +export async function transformStringFieldUpdateInput< + T extends undefined | string | { set?: string } +>(input: T, transform: (input: string) => Promise<string>): Promise<T> { + if (typeof input === "object" && typeof input?.set === "string") { + return { set: await transform(input.set) } as T; + } + if (typeof input === "object") { + if (typeof input.set === "string") { + return { set: await transform(input.set) } as T; + } + return input; + } + if (typeof input === "string") { + return (await transform(input)) as T; + } + return input; +} diff --git a/apps/roi-cacl-2/src/prisma/prisma.module.ts b/apps/roi-cacl-2/src/prisma/prisma.module.ts new file mode 100644 index 0000000..1edbf95 --- /dev/null +++ b/apps/roi-cacl-2/src/prisma/prisma.module.ts @@ -0,0 +1,9 @@ +import { Global, Module } from "@nestjs/common"; +import { PrismaService } from "./prisma.service"; + +@Global() +@Module({ + providers: [PrismaService], + exports: [PrismaService], +}) +export class PrismaModule {} diff --git a/apps/roi-cacl-2/src/prisma/prisma.service.ts b/apps/roi-cacl-2/src/prisma/prisma.service.ts new file mode 100644 index 0000000..79ea4fa --- /dev/null +++ b/apps/roi-cacl-2/src/prisma/prisma.service.ts @@ -0,0 +1,9 @@ +import { Injectable, OnModuleInit, INestApplication } from "@nestjs/common"; +import { PrismaClient } from "@prisma/client"; + +@Injectable() +export class PrismaService extends PrismaClient implements OnModuleInit { + async onModuleInit() { + await this.$connect(); + } +} diff --git a/apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.spec.ts b/apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.spec.ts new file mode 100644 index 0000000..f161172 --- /dev/null +++ b/apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.spec.ts @@ -0,0 +1,41 @@ +import { ConfigService } from "@nestjs/config"; +import { mock } from "jest-mock-extended"; +import { SecretsManagerServiceBase } from "./secretsManager.service.base"; +import { EnumSecretsNameKey } from "../secretsNameKey.enum"; + +describe("Testing the secrets manager base class", () => { + const SECRET_KEY = "SECRET_KEY"; + const SECRET_VALUE = "SECRET_VALUE"; + const configService = mock<ConfigService>(); + const secretsManagerServiceBase = new SecretsManagerServiceBase( + configService + ); + beforeEach(() => { + configService.get.mockClear(); + }); + it("should return value from env", async () => { + //ARRANGE + configService.get.mockReturnValue(SECRET_VALUE); + //ACT + const result = await secretsManagerServiceBase.getSecret( + SECRET_KEY as unknown as EnumSecretsNameKey + ); + //ASSERT + expect(result).toBe(SECRET_VALUE); + }); + it("should return null for unknown keys", async () => { + //ARRANGE + configService.get.mockReturnValue(undefined); + //ACT + const result = await secretsManagerServiceBase.getSecret( + SECRET_KEY as unknown as EnumSecretsNameKey + ); + //ASSERT + expect(result).toBeNull(); + }); + it("should throw an exception if getting null key", () => { + return expect( + secretsManagerServiceBase.getSecret(null as unknown as EnumSecretsNameKey) + ).rejects.toThrow(); + }); +}); diff --git a/apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.ts b/apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.ts new file mode 100644 index 0000000..340818c --- /dev/null +++ b/apps/roi-cacl-2/src/providers/secrets/base/secretsManager.service.base.ts @@ -0,0 +1,17 @@ +import { ConfigService } from "@nestjs/config"; +import { EnumSecretsNameKey } from "../secretsNameKey.enum"; + +export interface ISecretsManager { + getSecret: (key: EnumSecretsNameKey) => Promise<any | null>; +} + +export class SecretsManagerServiceBase implements ISecretsManager { + constructor(protected readonly configService: ConfigService) {} + async getSecret<T>(key: EnumSecretsNameKey): Promise<T | null> { + const value = this.configService.get(key.toString()); + if (value) { + return value; + } + return null; + } +} diff --git a/apps/roi-cacl-2/src/providers/secrets/secretsManager.module.ts b/apps/roi-cacl-2/src/providers/secrets/secretsManager.module.ts new file mode 100644 index 0000000..3a621e4 --- /dev/null +++ b/apps/roi-cacl-2/src/providers/secrets/secretsManager.module.ts @@ -0,0 +1,8 @@ +import { Module } from "@nestjs/common"; +import { SecretsManagerService } from "./secretsManager.service"; + +@Module({ + providers: [SecretsManagerService], + exports: [SecretsManagerService], +}) +export class SecretsManagerModule {} diff --git a/apps/roi-cacl-2/src/providers/secrets/secretsManager.service.ts b/apps/roi-cacl-2/src/providers/secrets/secretsManager.service.ts new file mode 100644 index 0000000..89907c3 --- /dev/null +++ b/apps/roi-cacl-2/src/providers/secrets/secretsManager.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { ConfigService } from "@nestjs/config"; +import { SecretsManagerServiceBase } from "./base/secretsManager.service.base"; + +@Injectable() +export class SecretsManagerService extends SecretsManagerServiceBase { + constructor(protected readonly configService: ConfigService) { + super(configService); + } +} diff --git a/apps/roi-cacl-2/src/providers/secrets/secretsNameKey.enum.ts b/apps/roi-cacl-2/src/providers/secrets/secretsNameKey.enum.ts new file mode 100644 index 0000000..e225d65 --- /dev/null +++ b/apps/roi-cacl-2/src/providers/secrets/secretsNameKey.enum.ts @@ -0,0 +1 @@ +export enum EnumSecretsNameKey {} \ No newline at end of file diff --git a/apps/roi-cacl-2/src/reminderMail/base/CreateReminderMailArgs.ts b/apps/roi-cacl-2/src/reminderMail/base/CreateReminderMailArgs.ts new file mode 100644 index 0000000..b1959f4 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/CreateReminderMailArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ReminderMailCreateInput } from "./ReminderMailCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateReminderMailArgs { + @ApiProperty({ + required: true, + type: () => ReminderMailCreateInput, + }) + @ValidateNested() + @Type(() => ReminderMailCreateInput) + @Field(() => ReminderMailCreateInput, { nullable: false }) + data!: ReminderMailCreateInput; +} + +export { CreateReminderMailArgs as CreateReminderMailArgs }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/DeleteReminderMailArgs.ts b/apps/roi-cacl-2/src/reminderMail/base/DeleteReminderMailArgs.ts new file mode 100644 index 0000000..42734b2 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/DeleteReminderMailArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ReminderMailWhereUniqueInput } from "./ReminderMailWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteReminderMailArgs { + @ApiProperty({ + required: true, + type: () => ReminderMailWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ReminderMailWhereUniqueInput) + @Field(() => ReminderMailWhereUniqueInput, { nullable: false }) + where!: ReminderMailWhereUniqueInput; +} + +export { DeleteReminderMailArgs as DeleteReminderMailArgs }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/EnumReminderMailReminderType.ts b/apps/roi-cacl-2/src/reminderMail/base/EnumReminderMailReminderType.ts new file mode 100644 index 0000000..36f9593 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/EnumReminderMailReminderType.ts @@ -0,0 +1,20 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumReminderMailReminderType { + PendingBookingConfirmation = "PENDING_BOOKING_CONFIRMATION", +} + +registerEnumType(EnumReminderMailReminderType, { + name: "EnumReminderMailReminderType", +}); diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMail.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMail.ts new file mode 100644 index 0000000..f1e8740 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMail.ts @@ -0,0 +1,63 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsEnum, IsDate } from "class-validator"; +import { EnumReminderMailReminderType } from "./EnumReminderMailReminderType"; +import { Type } from "class-transformer"; + +@ObjectType() +class ReminderMail { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + referenceId!: number; + + @ApiProperty({ + required: true, + enum: EnumReminderMailReminderType, + }) + @IsEnum(EnumReminderMailReminderType) + @Field(() => EnumReminderMailReminderType, { + nullable: true, + }) + reminderType?: "PENDING_BOOKING_CONFIRMATION"; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + elapsedMinutes!: number; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; +} + +export { ReminderMail as ReminderMail }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailCountArgs.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailCountArgs.ts new file mode 100644 index 0000000..b5317f1 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ReminderMailWhereInput } from "./ReminderMailWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class ReminderMailCountArgs { + @ApiProperty({ + required: false, + type: () => ReminderMailWhereInput, + }) + @Field(() => ReminderMailWhereInput, { nullable: true }) + @Type(() => ReminderMailWhereInput) + where?: ReminderMailWhereInput; +} + +export { ReminderMailCountArgs as ReminderMailCountArgs }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailCreateInput.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailCreateInput.ts new file mode 100644 index 0000000..d2889c0 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailCreateInput.ts @@ -0,0 +1,44 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsEnum } from "class-validator"; +import { EnumReminderMailReminderType } from "./EnumReminderMailReminderType"; + +@InputType() +class ReminderMailCreateInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + referenceId!: number; + + @ApiProperty({ + required: true, + enum: EnumReminderMailReminderType, + }) + @IsEnum(EnumReminderMailReminderType) + @Field(() => EnumReminderMailReminderType) + reminderType!: "PENDING_BOOKING_CONFIRMATION"; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + elapsedMinutes!: number; +} + +export { ReminderMailCreateInput as ReminderMailCreateInput }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindManyArgs.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindManyArgs.ts new file mode 100644 index 0000000..19cf6cb --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ReminderMailWhereInput } from "./ReminderMailWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { ReminderMailOrderByInput } from "./ReminderMailOrderByInput"; + +@ArgsType() +class ReminderMailFindManyArgs { + @ApiProperty({ + required: false, + type: () => ReminderMailWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => ReminderMailWhereInput, { nullable: true }) + @Type(() => ReminderMailWhereInput) + where?: ReminderMailWhereInput; + + @ApiProperty({ + required: false, + type: [ReminderMailOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [ReminderMailOrderByInput], { nullable: true }) + @Type(() => ReminderMailOrderByInput) + orderBy?: Array<ReminderMailOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { ReminderMailFindManyArgs as ReminderMailFindManyArgs }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindUniqueArgs.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindUniqueArgs.ts new file mode 100644 index 0000000..359e397 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ReminderMailWhereUniqueInput } from "./ReminderMailWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class ReminderMailFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => ReminderMailWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ReminderMailWhereUniqueInput) + @Field(() => ReminderMailWhereUniqueInput, { nullable: false }) + where!: ReminderMailWhereUniqueInput; +} + +export { ReminderMailFindUniqueArgs as ReminderMailFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailListRelationFilter.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailListRelationFilter.ts new file mode 100644 index 0000000..2ddb81b --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ReminderMailWhereInput } from "./ReminderMailWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ReminderMailListRelationFilter { + @ApiProperty({ + required: false, + type: () => ReminderMailWhereInput, + }) + @ValidateNested() + @Type(() => ReminderMailWhereInput) + @IsOptional() + @Field(() => ReminderMailWhereInput, { + nullable: true, + }) + every?: ReminderMailWhereInput; + + @ApiProperty({ + required: false, + type: () => ReminderMailWhereInput, + }) + @ValidateNested() + @Type(() => ReminderMailWhereInput) + @IsOptional() + @Field(() => ReminderMailWhereInput, { + nullable: true, + }) + some?: ReminderMailWhereInput; + + @ApiProperty({ + required: false, + type: () => ReminderMailWhereInput, + }) + @ValidateNested() + @Type(() => ReminderMailWhereInput) + @IsOptional() + @Field(() => ReminderMailWhereInput, { + nullable: true, + }) + none?: ReminderMailWhereInput; +} +export { ReminderMailListRelationFilter as ReminderMailListRelationFilter }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailOrderByInput.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailOrderByInput.ts new file mode 100644 index 0000000..aaa1ef5 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailOrderByInput.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class ReminderMailOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + referenceId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + reminderType?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + elapsedMinutes?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; +} + +export { ReminderMailOrderByInput as ReminderMailOrderByInput }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailUpdateInput.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailUpdateInput.ts new file mode 100644 index 0000000..ce83cfa --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailUpdateInput.ts @@ -0,0 +1,53 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsOptional, IsEnum } from "class-validator"; +import { EnumReminderMailReminderType } from "./EnumReminderMailReminderType"; + +@InputType() +class ReminderMailUpdateInput { + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + referenceId?: number; + + @ApiProperty({ + required: false, + enum: EnumReminderMailReminderType, + }) + @IsEnum(EnumReminderMailReminderType) + @IsOptional() + @Field(() => EnumReminderMailReminderType, { + nullable: true, + }) + reminderType?: "PENDING_BOOKING_CONFIRMATION"; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + elapsedMinutes?: number; +} + +export { ReminderMailUpdateInput as ReminderMailUpdateInput }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereInput.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereInput.ts new file mode 100644 index 0000000..2e7316e --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereInput.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, IsEnum } from "class-validator"; +import { EnumReminderMailReminderType } from "./EnumReminderMailReminderType"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; + +@InputType() +class ReminderMailWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + referenceId?: IntFilter; + + @ApiProperty({ + required: false, + enum: EnumReminderMailReminderType, + }) + @IsEnum(EnumReminderMailReminderType) + @IsOptional() + @Field(() => EnumReminderMailReminderType, { + nullable: true, + }) + reminderType?: "PENDING_BOOKING_CONFIRMATION"; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + elapsedMinutes?: IntFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; +} + +export { ReminderMailWhereInput as ReminderMailWhereInput }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereUniqueInput.ts b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereUniqueInput.ts new file mode 100644 index 0000000..f50b006 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/ReminderMailWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class ReminderMailWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { ReminderMailWhereUniqueInput as ReminderMailWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/UpdateReminderMailArgs.ts b/apps/roi-cacl-2/src/reminderMail/base/UpdateReminderMailArgs.ts new file mode 100644 index 0000000..ef47243 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/UpdateReminderMailArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ReminderMailWhereUniqueInput } from "./ReminderMailWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { ReminderMailUpdateInput } from "./ReminderMailUpdateInput"; + +@ArgsType() +class UpdateReminderMailArgs { + @ApiProperty({ + required: true, + type: () => ReminderMailWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ReminderMailWhereUniqueInput) + @Field(() => ReminderMailWhereUniqueInput, { nullable: false }) + where!: ReminderMailWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => ReminderMailUpdateInput, + }) + @ValidateNested() + @Type(() => ReminderMailUpdateInput) + @Field(() => ReminderMailUpdateInput, { nullable: false }) + data!: ReminderMailUpdateInput; +} + +export { UpdateReminderMailArgs as UpdateReminderMailArgs }; diff --git a/apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.spec.ts b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.spec.ts new file mode 100644 index 0000000..a744be0 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.spec.ts @@ -0,0 +1,190 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { ReminderMailController } from "../reminderMail.controller"; +import { ReminderMailService } from "../reminderMail.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + referenceId: 42, + elapsedMinutes: 42, + createdAt: new Date(), +}; +const CREATE_RESULT = { + id: 42, + referenceId: 42, + elapsedMinutes: 42, + createdAt: new Date(), +}; +const FIND_MANY_RESULT = [ + { + id: 42, + referenceId: 42, + elapsedMinutes: 42, + createdAt: new Date(), + }, +]; +const FIND_ONE_RESULT = { + id: 42, + referenceId: 42, + elapsedMinutes: 42, + createdAt: new Date(), +}; + +const service = { + createReminderMail() { + return CREATE_RESULT; + }, + reminderMails: () => FIND_MANY_RESULT, + reminderMail: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("ReminderMail", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: ReminderMailService, + useValue: service, + }, + ], + controllers: [ReminderMailController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /reminderMails", async () => { + await request(app.getHttpServer()) + .post("/reminderMails") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + }); + }); + + test("GET /reminderMails", async () => { + await request(app.getHttpServer()) + .get("/reminderMails") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + }, + ]); + }); + + test("GET /reminderMails/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/reminderMails"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /reminderMails/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/reminderMails"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + }); + }); + + test("POST /reminderMails existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/reminderMails") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + }) + .then(function () { + agent + .post("/reminderMails") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.ts b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.ts new file mode 100644 index 0000000..6c8f4c2 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.controller.base.ts @@ -0,0 +1,141 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { ReminderMailService } from "../reminderMail.service"; +import { ReminderMailCreateInput } from "./ReminderMailCreateInput"; +import { ReminderMail } from "./ReminderMail"; +import { ReminderMailFindManyArgs } from "./ReminderMailFindManyArgs"; +import { ReminderMailWhereUniqueInput } from "./ReminderMailWhereUniqueInput"; +import { ReminderMailUpdateInput } from "./ReminderMailUpdateInput"; + +export class ReminderMailControllerBase { + constructor(protected readonly service: ReminderMailService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: ReminderMail }) + async createReminderMail( + @common.Body() data: ReminderMailCreateInput + ): Promise<ReminderMail> { + return await this.service.createReminderMail({ + data: data, + select: { + id: true, + referenceId: true, + reminderType: true, + elapsedMinutes: true, + createdAt: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [ReminderMail] }) + @ApiNestedQuery(ReminderMailFindManyArgs) + async reminderMails(@common.Req() request: Request): Promise<ReminderMail[]> { + const args = plainToClass(ReminderMailFindManyArgs, request.query); + return this.service.reminderMails({ + ...args, + select: { + id: true, + referenceId: true, + reminderType: true, + elapsedMinutes: true, + createdAt: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: ReminderMail }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async reminderMail( + @common.Param() params: ReminderMailWhereUniqueInput + ): Promise<ReminderMail | null> { + const result = await this.service.reminderMail({ + where: params, + select: { + id: true, + referenceId: true, + reminderType: true, + elapsedMinutes: true, + createdAt: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: ReminderMail }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateReminderMail( + @common.Param() params: ReminderMailWhereUniqueInput, + @common.Body() data: ReminderMailUpdateInput + ): Promise<ReminderMail | null> { + try { + return await this.service.updateReminderMail({ + where: params, + data: data, + select: { + id: true, + referenceId: true, + reminderType: true, + elapsedMinutes: true, + createdAt: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: ReminderMail }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteReminderMail( + @common.Param() params: ReminderMailWhereUniqueInput + ): Promise<ReminderMail | null> { + try { + return await this.service.deleteReminderMail({ + where: params, + select: { + id: true, + referenceId: true, + reminderType: true, + elapsedMinutes: true, + createdAt: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/reminderMail/base/reminderMail.module.base.ts b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.module.base.ts new file mode 100644 index 0000000..98113e5 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class ReminderMailModuleBase {} diff --git a/apps/roi-cacl-2/src/reminderMail/base/reminderMail.resolver.base.ts b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.resolver.base.ts new file mode 100644 index 0000000..c79070f --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.resolver.base.ts @@ -0,0 +1,99 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { ReminderMail } from "./ReminderMail"; +import { ReminderMailCountArgs } from "./ReminderMailCountArgs"; +import { ReminderMailFindManyArgs } from "./ReminderMailFindManyArgs"; +import { ReminderMailFindUniqueArgs } from "./ReminderMailFindUniqueArgs"; +import { CreateReminderMailArgs } from "./CreateReminderMailArgs"; +import { UpdateReminderMailArgs } from "./UpdateReminderMailArgs"; +import { DeleteReminderMailArgs } from "./DeleteReminderMailArgs"; +import { ReminderMailService } from "../reminderMail.service"; +@graphql.Resolver(() => ReminderMail) +export class ReminderMailResolverBase { + constructor(protected readonly service: ReminderMailService) {} + + async _reminderMailsMeta( + @graphql.Args() args: ReminderMailCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [ReminderMail]) + async reminderMails( + @graphql.Args() args: ReminderMailFindManyArgs + ): Promise<ReminderMail[]> { + return this.service.reminderMails(args); + } + + @graphql.Query(() => ReminderMail, { nullable: true }) + async reminderMail( + @graphql.Args() args: ReminderMailFindUniqueArgs + ): Promise<ReminderMail | null> { + const result = await this.service.reminderMail(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => ReminderMail) + async createReminderMail( + @graphql.Args() args: CreateReminderMailArgs + ): Promise<ReminderMail> { + return await this.service.createReminderMail({ + ...args, + data: args.data, + }); + } + + @graphql.Mutation(() => ReminderMail) + async updateReminderMail( + @graphql.Args() args: UpdateReminderMailArgs + ): Promise<ReminderMail | null> { + try { + return await this.service.updateReminderMail({ + ...args, + data: args.data, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => ReminderMail) + async deleteReminderMail( + @graphql.Args() args: DeleteReminderMailArgs + ): Promise<ReminderMail | null> { + try { + return await this.service.deleteReminderMail(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/reminderMail/base/reminderMail.service.base.ts b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.service.base.ts new file mode 100644 index 0000000..f845215 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/base/reminderMail.service.base.ts @@ -0,0 +1,51 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { Prisma, ReminderMail as PrismaReminderMail } from "@prisma/client"; + +export class ReminderMailServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.ReminderMailCountArgs, "select"> + ): Promise<number> { + return this.prisma.reminderMail.count(args); + } + + async reminderMails<T extends Prisma.ReminderMailFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.ReminderMailFindManyArgs> + ): Promise<PrismaReminderMail[]> { + return this.prisma.reminderMail.findMany<Prisma.ReminderMailFindManyArgs>( + args + ); + } + async reminderMail<T extends Prisma.ReminderMailFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.ReminderMailFindUniqueArgs> + ): Promise<PrismaReminderMail | null> { + return this.prisma.reminderMail.findUnique(args); + } + async createReminderMail<T extends Prisma.ReminderMailCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.ReminderMailCreateArgs> + ): Promise<PrismaReminderMail> { + return this.prisma.reminderMail.create<T>(args); + } + async updateReminderMail<T extends Prisma.ReminderMailUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.ReminderMailUpdateArgs> + ): Promise<PrismaReminderMail> { + return this.prisma.reminderMail.update<T>(args); + } + async deleteReminderMail<T extends Prisma.ReminderMailDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.ReminderMailDeleteArgs> + ): Promise<PrismaReminderMail> { + return this.prisma.reminderMail.delete(args); + } +} diff --git a/apps/roi-cacl-2/src/reminderMail/reminderMail.controller.ts b/apps/roi-cacl-2/src/reminderMail/reminderMail.controller.ts new file mode 100644 index 0000000..cd4caac --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/reminderMail.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { ReminderMailService } from "./reminderMail.service"; +import { ReminderMailControllerBase } from "./base/reminderMail.controller.base"; + +@swagger.ApiTags("reminderMails") +@common.Controller("reminderMails") +export class ReminderMailController extends ReminderMailControllerBase { + constructor(protected readonly service: ReminderMailService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/reminderMail/reminderMail.module.ts b/apps/roi-cacl-2/src/reminderMail/reminderMail.module.ts new file mode 100644 index 0000000..a6ca772 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/reminderMail.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { ReminderMailModuleBase } from "./base/reminderMail.module.base"; +import { ReminderMailService } from "./reminderMail.service"; +import { ReminderMailController } from "./reminderMail.controller"; +import { ReminderMailResolver } from "./reminderMail.resolver"; + +@Module({ + imports: [ReminderMailModuleBase], + controllers: [ReminderMailController], + providers: [ReminderMailService, ReminderMailResolver], + exports: [ReminderMailService], +}) +export class ReminderMailModule {} diff --git a/apps/roi-cacl-2/src/reminderMail/reminderMail.resolver.ts b/apps/roi-cacl-2/src/reminderMail/reminderMail.resolver.ts new file mode 100644 index 0000000..758184b --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/reminderMail.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { ReminderMailResolverBase } from "./base/reminderMail.resolver.base"; +import { ReminderMail } from "./base/ReminderMail"; +import { ReminderMailService } from "./reminderMail.service"; + +@graphql.Resolver(() => ReminderMail) +export class ReminderMailResolver extends ReminderMailResolverBase { + constructor(protected readonly service: ReminderMailService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/reminderMail/reminderMail.service.ts b/apps/roi-cacl-2/src/reminderMail/reminderMail.service.ts new file mode 100644 index 0000000..3c93586 --- /dev/null +++ b/apps/roi-cacl-2/src/reminderMail/reminderMail.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { ReminderMailServiceBase } from "./base/reminderMail.service.base"; + +@Injectable() +export class ReminderMailService extends ReminderMailServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/CreateResetPasswordRequestArgs.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/CreateResetPasswordRequestArgs.ts new file mode 100644 index 0000000..243f2c2 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/CreateResetPasswordRequestArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ResetPasswordRequestCreateInput } from "./ResetPasswordRequestCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateResetPasswordRequestArgs { + @ApiProperty({ + required: true, + type: () => ResetPasswordRequestCreateInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestCreateInput) + @Field(() => ResetPasswordRequestCreateInput, { nullable: false }) + data!: ResetPasswordRequestCreateInput; +} + +export { CreateResetPasswordRequestArgs as CreateResetPasswordRequestArgs }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/DeleteResetPasswordRequestArgs.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/DeleteResetPasswordRequestArgs.ts new file mode 100644 index 0000000..8265696 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/DeleteResetPasswordRequestArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ResetPasswordRequestWhereUniqueInput } from "./ResetPasswordRequestWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteResetPasswordRequestArgs { + @ApiProperty({ + required: true, + type: () => ResetPasswordRequestWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestWhereUniqueInput) + @Field(() => ResetPasswordRequestWhereUniqueInput, { nullable: false }) + where!: ResetPasswordRequestWhereUniqueInput; +} + +export { DeleteResetPasswordRequestArgs as DeleteResetPasswordRequestArgs }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequest.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequest.ts new file mode 100644 index 0000000..43b5d57 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequest.ts @@ -0,0 +1,60 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsDate } from "class-validator"; +import { Type } from "class-transformer"; + +@ObjectType() +class ResetPasswordRequest { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + updatedAt!: Date; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + email!: string; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + expires!: Date; +} + +export { ResetPasswordRequest as ResetPasswordRequest }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCountArgs.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCountArgs.ts new file mode 100644 index 0000000..62c6693 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ResetPasswordRequestWhereInput } from "./ResetPasswordRequestWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class ResetPasswordRequestCountArgs { + @ApiProperty({ + required: false, + type: () => ResetPasswordRequestWhereInput, + }) + @Field(() => ResetPasswordRequestWhereInput, { nullable: true }) + @Type(() => ResetPasswordRequestWhereInput) + where?: ResetPasswordRequestWhereInput; +} + +export { ResetPasswordRequestCountArgs as ResetPasswordRequestCountArgs }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCreateInput.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCreateInput.ts new file mode 100644 index 0000000..d71d35e --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestCreateInput.ts @@ -0,0 +1,36 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsDate } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ResetPasswordRequestCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + email!: string; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + expires!: Date; +} + +export { ResetPasswordRequestCreateInput as ResetPasswordRequestCreateInput }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindManyArgs.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindManyArgs.ts new file mode 100644 index 0000000..80785d7 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ResetPasswordRequestWhereInput } from "./ResetPasswordRequestWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { ResetPasswordRequestOrderByInput } from "./ResetPasswordRequestOrderByInput"; + +@ArgsType() +class ResetPasswordRequestFindManyArgs { + @ApiProperty({ + required: false, + type: () => ResetPasswordRequestWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => ResetPasswordRequestWhereInput, { nullable: true }) + @Type(() => ResetPasswordRequestWhereInput) + where?: ResetPasswordRequestWhereInput; + + @ApiProperty({ + required: false, + type: [ResetPasswordRequestOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [ResetPasswordRequestOrderByInput], { nullable: true }) + @Type(() => ResetPasswordRequestOrderByInput) + orderBy?: Array<ResetPasswordRequestOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { ResetPasswordRequestFindManyArgs as ResetPasswordRequestFindManyArgs }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindUniqueArgs.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindUniqueArgs.ts new file mode 100644 index 0000000..551b4e4 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ResetPasswordRequestWhereUniqueInput } from "./ResetPasswordRequestWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class ResetPasswordRequestFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => ResetPasswordRequestWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestWhereUniqueInput) + @Field(() => ResetPasswordRequestWhereUniqueInput, { nullable: false }) + where!: ResetPasswordRequestWhereUniqueInput; +} + +export { ResetPasswordRequestFindUniqueArgs as ResetPasswordRequestFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestListRelationFilter.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestListRelationFilter.ts new file mode 100644 index 0000000..f9a951a --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ResetPasswordRequestWhereInput } from "./ResetPasswordRequestWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ResetPasswordRequestListRelationFilter { + @ApiProperty({ + required: false, + type: () => ResetPasswordRequestWhereInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestWhereInput) + @IsOptional() + @Field(() => ResetPasswordRequestWhereInput, { + nullable: true, + }) + every?: ResetPasswordRequestWhereInput; + + @ApiProperty({ + required: false, + type: () => ResetPasswordRequestWhereInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestWhereInput) + @IsOptional() + @Field(() => ResetPasswordRequestWhereInput, { + nullable: true, + }) + some?: ResetPasswordRequestWhereInput; + + @ApiProperty({ + required: false, + type: () => ResetPasswordRequestWhereInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestWhereInput) + @IsOptional() + @Field(() => ResetPasswordRequestWhereInput, { + nullable: true, + }) + none?: ResetPasswordRequestWhereInput; +} +export { ResetPasswordRequestListRelationFilter as ResetPasswordRequestListRelationFilter }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestOrderByInput.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestOrderByInput.ts new file mode 100644 index 0000000..4c9f67b --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestOrderByInput.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class ResetPasswordRequestOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + updatedAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + email?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + expires?: SortOrder; +} + +export { ResetPasswordRequestOrderByInput as ResetPasswordRequestOrderByInput }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestUpdateInput.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestUpdateInput.ts new file mode 100644 index 0000000..f91e578 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestUpdateInput.ts @@ -0,0 +1,42 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsDate } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ResetPasswordRequestUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + email?: string; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + expires?: Date; +} + +export { ResetPasswordRequestUpdateInput as ResetPasswordRequestUpdateInput }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereInput.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereInput.ts new file mode 100644 index 0000000..0569560 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereInput.ts @@ -0,0 +1,77 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { StringFilter } from "../../util/StringFilter"; +import { Type } from "class-transformer"; +import { IsOptional } from "class-validator"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; + +@InputType() +class ResetPasswordRequestWhereInput { + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + id?: StringFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + updatedAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + email?: StringFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + expires?: DateTimeFilter; +} + +export { ResetPasswordRequestWhereInput as ResetPasswordRequestWhereInput }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereUniqueInput.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereUniqueInput.ts new file mode 100644 index 0000000..9d53584 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/ResetPasswordRequestWhereUniqueInput.ts @@ -0,0 +1,27 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString } from "class-validator"; + +@InputType() +class ResetPasswordRequestWhereUniqueInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; +} + +export { ResetPasswordRequestWhereUniqueInput as ResetPasswordRequestWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/UpdateResetPasswordRequestArgs.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/UpdateResetPasswordRequestArgs.ts new file mode 100644 index 0000000..0a67736 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/UpdateResetPasswordRequestArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ResetPasswordRequestWhereUniqueInput } from "./ResetPasswordRequestWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { ResetPasswordRequestUpdateInput } from "./ResetPasswordRequestUpdateInput"; + +@ArgsType() +class UpdateResetPasswordRequestArgs { + @ApiProperty({ + required: true, + type: () => ResetPasswordRequestWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestWhereUniqueInput) + @Field(() => ResetPasswordRequestWhereUniqueInput, { nullable: false }) + where!: ResetPasswordRequestWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => ResetPasswordRequestUpdateInput, + }) + @ValidateNested() + @Type(() => ResetPasswordRequestUpdateInput) + @Field(() => ResetPasswordRequestUpdateInput, { nullable: false }) + data!: ResetPasswordRequestUpdateInput; +} + +export { UpdateResetPasswordRequestArgs as UpdateResetPasswordRequestArgs }; diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.spec.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.spec.ts new file mode 100644 index 0000000..9980e24 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.spec.ts @@ -0,0 +1,202 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { ResetPasswordRequestController } from "../resetPasswordRequest.controller"; +import { ResetPasswordRequestService } from "../resetPasswordRequest.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: "exampleId", + createdAt: new Date(), + updatedAt: new Date(), + email: "exampleEmail", + expires: new Date(), +}; +const CREATE_RESULT = { + id: "exampleId", + createdAt: new Date(), + updatedAt: new Date(), + email: "exampleEmail", + expires: new Date(), +}; +const FIND_MANY_RESULT = [ + { + id: "exampleId", + createdAt: new Date(), + updatedAt: new Date(), + email: "exampleEmail", + expires: new Date(), + }, +]; +const FIND_ONE_RESULT = { + id: "exampleId", + createdAt: new Date(), + updatedAt: new Date(), + email: "exampleEmail", + expires: new Date(), +}; + +const service = { + createResetPasswordRequest() { + return CREATE_RESULT; + }, + resetPasswordRequests: () => FIND_MANY_RESULT, + resetPasswordRequest: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("ResetPasswordRequest", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: ResetPasswordRequestService, + useValue: service, + }, + ], + controllers: [ResetPasswordRequestController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /resetPasswordRequests", async () => { + await request(app.getHttpServer()) + .post("/resetPasswordRequests") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + expires: CREATE_RESULT.expires.toISOString(), + }); + }); + + test("GET /resetPasswordRequests", async () => { + await request(app.getHttpServer()) + .get("/resetPasswordRequests") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(), + expires: FIND_MANY_RESULT[0].expires.toISOString(), + }, + ]); + }); + + test("GET /resetPasswordRequests/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/resetPasswordRequests"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /resetPasswordRequests/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/resetPasswordRequests"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(), + expires: FIND_ONE_RESULT.expires.toISOString(), + }); + }); + + test("POST /resetPasswordRequests existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/resetPasswordRequests") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + expires: CREATE_RESULT.expires.toISOString(), + }) + .then(function () { + agent + .post("/resetPasswordRequests") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.ts new file mode 100644 index 0000000..8dca0f4 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.controller.base.ts @@ -0,0 +1,143 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { ResetPasswordRequestService } from "../resetPasswordRequest.service"; +import { ResetPasswordRequestCreateInput } from "./ResetPasswordRequestCreateInput"; +import { ResetPasswordRequest } from "./ResetPasswordRequest"; +import { ResetPasswordRequestFindManyArgs } from "./ResetPasswordRequestFindManyArgs"; +import { ResetPasswordRequestWhereUniqueInput } from "./ResetPasswordRequestWhereUniqueInput"; +import { ResetPasswordRequestUpdateInput } from "./ResetPasswordRequestUpdateInput"; + +export class ResetPasswordRequestControllerBase { + constructor(protected readonly service: ResetPasswordRequestService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: ResetPasswordRequest }) + async createResetPasswordRequest( + @common.Body() data: ResetPasswordRequestCreateInput + ): Promise<ResetPasswordRequest> { + return await this.service.createResetPasswordRequest({ + data: data, + select: { + id: true, + createdAt: true, + updatedAt: true, + email: true, + expires: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [ResetPasswordRequest] }) + @ApiNestedQuery(ResetPasswordRequestFindManyArgs) + async resetPasswordRequests( + @common.Req() request: Request + ): Promise<ResetPasswordRequest[]> { + const args = plainToClass(ResetPasswordRequestFindManyArgs, request.query); + return this.service.resetPasswordRequests({ + ...args, + select: { + id: true, + createdAt: true, + updatedAt: true, + email: true, + expires: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: ResetPasswordRequest }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async resetPasswordRequest( + @common.Param() params: ResetPasswordRequestWhereUniqueInput + ): Promise<ResetPasswordRequest | null> { + const result = await this.service.resetPasswordRequest({ + where: params, + select: { + id: true, + createdAt: true, + updatedAt: true, + email: true, + expires: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: ResetPasswordRequest }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateResetPasswordRequest( + @common.Param() params: ResetPasswordRequestWhereUniqueInput, + @common.Body() data: ResetPasswordRequestUpdateInput + ): Promise<ResetPasswordRequest | null> { + try { + return await this.service.updateResetPasswordRequest({ + where: params, + data: data, + select: { + id: true, + createdAt: true, + updatedAt: true, + email: true, + expires: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: ResetPasswordRequest }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteResetPasswordRequest( + @common.Param() params: ResetPasswordRequestWhereUniqueInput + ): Promise<ResetPasswordRequest | null> { + try { + return await this.service.deleteResetPasswordRequest({ + where: params, + select: { + id: true, + createdAt: true, + updatedAt: true, + email: true, + expires: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.module.base.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.module.base.ts new file mode 100644 index 0000000..f8e9874 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class ResetPasswordRequestModuleBase {} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.resolver.base.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.resolver.base.ts new file mode 100644 index 0000000..2a5da6a --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.resolver.base.ts @@ -0,0 +1,99 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { ResetPasswordRequest } from "./ResetPasswordRequest"; +import { ResetPasswordRequestCountArgs } from "./ResetPasswordRequestCountArgs"; +import { ResetPasswordRequestFindManyArgs } from "./ResetPasswordRequestFindManyArgs"; +import { ResetPasswordRequestFindUniqueArgs } from "./ResetPasswordRequestFindUniqueArgs"; +import { CreateResetPasswordRequestArgs } from "./CreateResetPasswordRequestArgs"; +import { UpdateResetPasswordRequestArgs } from "./UpdateResetPasswordRequestArgs"; +import { DeleteResetPasswordRequestArgs } from "./DeleteResetPasswordRequestArgs"; +import { ResetPasswordRequestService } from "../resetPasswordRequest.service"; +@graphql.Resolver(() => ResetPasswordRequest) +export class ResetPasswordRequestResolverBase { + constructor(protected readonly service: ResetPasswordRequestService) {} + + async _resetPasswordRequestsMeta( + @graphql.Args() args: ResetPasswordRequestCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [ResetPasswordRequest]) + async resetPasswordRequests( + @graphql.Args() args: ResetPasswordRequestFindManyArgs + ): Promise<ResetPasswordRequest[]> { + return this.service.resetPasswordRequests(args); + } + + @graphql.Query(() => ResetPasswordRequest, { nullable: true }) + async resetPasswordRequest( + @graphql.Args() args: ResetPasswordRequestFindUniqueArgs + ): Promise<ResetPasswordRequest | null> { + const result = await this.service.resetPasswordRequest(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => ResetPasswordRequest) + async createResetPasswordRequest( + @graphql.Args() args: CreateResetPasswordRequestArgs + ): Promise<ResetPasswordRequest> { + return await this.service.createResetPasswordRequest({ + ...args, + data: args.data, + }); + } + + @graphql.Mutation(() => ResetPasswordRequest) + async updateResetPasswordRequest( + @graphql.Args() args: UpdateResetPasswordRequestArgs + ): Promise<ResetPasswordRequest | null> { + try { + return await this.service.updateResetPasswordRequest({ + ...args, + data: args.data, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => ResetPasswordRequest) + async deleteResetPasswordRequest( + @graphql.Args() args: DeleteResetPasswordRequestArgs + ): Promise<ResetPasswordRequest | null> { + try { + return await this.service.deleteResetPasswordRequest(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.service.base.ts b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.service.base.ts new file mode 100644 index 0000000..5f04e66 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/base/resetPasswordRequest.service.base.ts @@ -0,0 +1,64 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + ResetPasswordRequest as PrismaResetPasswordRequest, +} from "@prisma/client"; + +export class ResetPasswordRequestServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.ResetPasswordRequestCountArgs, "select"> + ): Promise<number> { + return this.prisma.resetPasswordRequest.count(args); + } + + async resetPasswordRequests< + T extends Prisma.ResetPasswordRequestFindManyArgs + >( + args: Prisma.SelectSubset<T, Prisma.ResetPasswordRequestFindManyArgs> + ): Promise<PrismaResetPasswordRequest[]> { + return this.prisma.resetPasswordRequest.findMany<Prisma.ResetPasswordRequestFindManyArgs>( + args + ); + } + async resetPasswordRequest< + T extends Prisma.ResetPasswordRequestFindUniqueArgs + >( + args: Prisma.SelectSubset<T, Prisma.ResetPasswordRequestFindUniqueArgs> + ): Promise<PrismaResetPasswordRequest | null> { + return this.prisma.resetPasswordRequest.findUnique(args); + } + async createResetPasswordRequest< + T extends Prisma.ResetPasswordRequestCreateArgs + >( + args: Prisma.SelectSubset<T, Prisma.ResetPasswordRequestCreateArgs> + ): Promise<PrismaResetPasswordRequest> { + return this.prisma.resetPasswordRequest.create<T>(args); + } + async updateResetPasswordRequest< + T extends Prisma.ResetPasswordRequestUpdateArgs + >( + args: Prisma.SelectSubset<T, Prisma.ResetPasswordRequestUpdateArgs> + ): Promise<PrismaResetPasswordRequest> { + return this.prisma.resetPasswordRequest.update<T>(args); + } + async deleteResetPasswordRequest< + T extends Prisma.ResetPasswordRequestDeleteArgs + >( + args: Prisma.SelectSubset<T, Prisma.ResetPasswordRequestDeleteArgs> + ): Promise<PrismaResetPasswordRequest> { + return this.prisma.resetPasswordRequest.delete(args); + } +} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.controller.ts b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.controller.ts new file mode 100644 index 0000000..1702b02 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { ResetPasswordRequestService } from "./resetPasswordRequest.service"; +import { ResetPasswordRequestControllerBase } from "./base/resetPasswordRequest.controller.base"; + +@swagger.ApiTags("resetPasswordRequests") +@common.Controller("resetPasswordRequests") +export class ResetPasswordRequestController extends ResetPasswordRequestControllerBase { + constructor(protected readonly service: ResetPasswordRequestService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.module.ts b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.module.ts new file mode 100644 index 0000000..3bd885d --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { ResetPasswordRequestModuleBase } from "./base/resetPasswordRequest.module.base"; +import { ResetPasswordRequestService } from "./resetPasswordRequest.service"; +import { ResetPasswordRequestController } from "./resetPasswordRequest.controller"; +import { ResetPasswordRequestResolver } from "./resetPasswordRequest.resolver"; + +@Module({ + imports: [ResetPasswordRequestModuleBase], + controllers: [ResetPasswordRequestController], + providers: [ResetPasswordRequestService, ResetPasswordRequestResolver], + exports: [ResetPasswordRequestService], +}) +export class ResetPasswordRequestModule {} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.resolver.ts b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.resolver.ts new file mode 100644 index 0000000..2740896 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { ResetPasswordRequestResolverBase } from "./base/resetPasswordRequest.resolver.base"; +import { ResetPasswordRequest } from "./base/ResetPasswordRequest"; +import { ResetPasswordRequestService } from "./resetPasswordRequest.service"; + +@graphql.Resolver(() => ResetPasswordRequest) +export class ResetPasswordRequestResolver extends ResetPasswordRequestResolverBase { + constructor(protected readonly service: ResetPasswordRequestService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.service.ts b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.service.ts new file mode 100644 index 0000000..f87a3c6 --- /dev/null +++ b/apps/roi-cacl-2/src/resetPasswordRequest/resetPasswordRequest.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { ResetPasswordRequestServiceBase } from "./base/resetPasswordRequest.service.base"; + +@Injectable() +export class ResetPasswordRequestService extends ResetPasswordRequestServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/schedule/base/AvailabilityCreateNestedManyWithoutSchedulesInput.ts b/apps/roi-cacl-2/src/schedule/base/AvailabilityCreateNestedManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..63ba413 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/AvailabilityCreateNestedManyWithoutSchedulesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AvailabilityCreateNestedManyWithoutSchedulesInput { + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + connect?: Array<AvailabilityWhereUniqueInput>; +} + +export { AvailabilityCreateNestedManyWithoutSchedulesInput as AvailabilityCreateNestedManyWithoutSchedulesInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/AvailabilityUpdateManyWithoutSchedulesInput.ts b/apps/roi-cacl-2/src/schedule/base/AvailabilityUpdateManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..1beae1c --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/AvailabilityUpdateManyWithoutSchedulesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AvailabilityUpdateManyWithoutSchedulesInput { + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + connect?: Array<AvailabilityWhereUniqueInput>; + + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + disconnect?: Array<AvailabilityWhereUniqueInput>; + + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + set?: Array<AvailabilityWhereUniqueInput>; +} + +export { AvailabilityUpdateManyWithoutSchedulesInput as AvailabilityUpdateManyWithoutSchedulesInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/CreateScheduleArgs.ts b/apps/roi-cacl-2/src/schedule/base/CreateScheduleArgs.ts new file mode 100644 index 0000000..7907187 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/CreateScheduleArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ScheduleCreateInput } from "./ScheduleCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateScheduleArgs { + @ApiProperty({ + required: true, + type: () => ScheduleCreateInput, + }) + @ValidateNested() + @Type(() => ScheduleCreateInput) + @Field(() => ScheduleCreateInput, { nullable: false }) + data!: ScheduleCreateInput; +} + +export { CreateScheduleArgs as CreateScheduleArgs }; diff --git a/apps/roi-cacl-2/src/schedule/base/DeleteScheduleArgs.ts b/apps/roi-cacl-2/src/schedule/base/DeleteScheduleArgs.ts new file mode 100644 index 0000000..93f8d6f --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/DeleteScheduleArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ScheduleWhereUniqueInput } from "./ScheduleWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteScheduleArgs { + @ApiProperty({ + required: true, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @Field(() => ScheduleWhereUniqueInput, { nullable: false }) + where!: ScheduleWhereUniqueInput; +} + +export { DeleteScheduleArgs as DeleteScheduleArgs }; diff --git a/apps/roi-cacl-2/src/schedule/base/EventTypeCreateNestedManyWithoutSchedulesInput.ts b/apps/roi-cacl-2/src/schedule/base/EventTypeCreateNestedManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..3d43342 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/EventTypeCreateNestedManyWithoutSchedulesInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeCreateNestedManyWithoutSchedulesInput { + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + connect?: Array<EventTypeWhereUniqueInput>; +} + +export { EventTypeCreateNestedManyWithoutSchedulesInput as EventTypeCreateNestedManyWithoutSchedulesInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/EventTypeUpdateManyWithoutSchedulesInput.ts b/apps/roi-cacl-2/src/schedule/base/EventTypeUpdateManyWithoutSchedulesInput.ts new file mode 100644 index 0000000..346bd96 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/EventTypeUpdateManyWithoutSchedulesInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeUpdateManyWithoutSchedulesInput { + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + connect?: Array<EventTypeWhereUniqueInput>; + + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + disconnect?: Array<EventTypeWhereUniqueInput>; + + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + set?: Array<EventTypeWhereUniqueInput>; +} + +export { EventTypeUpdateManyWithoutSchedulesInput as EventTypeUpdateManyWithoutSchedulesInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/Schedule.ts b/apps/roi-cacl-2/src/schedule/base/Schedule.ts new file mode 100644 index 0000000..f1130ae --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/Schedule.ts @@ -0,0 +1,76 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, ValidateNested, IsString, IsOptional } from "class-validator"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; +import { EventType } from "../../eventType/base/EventType"; +import { Availability } from "../../availability/base/Availability"; + +@ObjectType() +class Schedule { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + user?: User; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + name!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone!: string | null; + + @ApiProperty({ + required: false, + type: () => [EventType], + }) + @ValidateNested() + @Type(() => EventType) + @IsOptional() + eventType?: Array<EventType>; + + @ApiProperty({ + required: false, + type: () => [Availability], + }) + @ValidateNested() + @Type(() => Availability) + @IsOptional() + availability?: Array<Availability>; +} + +export { Schedule as Schedule }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleCountArgs.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleCountArgs.ts new file mode 100644 index 0000000..19ff270 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ScheduleWhereInput } from "./ScheduleWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class ScheduleCountArgs { + @ApiProperty({ + required: false, + type: () => ScheduleWhereInput, + }) + @Field(() => ScheduleWhereInput, { nullable: true }) + @Type(() => ScheduleWhereInput) + where?: ScheduleWhereInput; +} + +export { ScheduleCountArgs as ScheduleCountArgs }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleCreateInput.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleCreateInput.ts new file mode 100644 index 0000000..3db9456 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleCreateInput.ts @@ -0,0 +1,75 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested, IsString, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeCreateNestedManyWithoutSchedulesInput } from "./EventTypeCreateNestedManyWithoutSchedulesInput"; +import { AvailabilityCreateNestedManyWithoutSchedulesInput } from "./AvailabilityCreateNestedManyWithoutSchedulesInput"; + +@InputType() +class ScheduleCreateInput { + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput) + user!: UserWhereUniqueInput; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + name!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone?: string | null; + + @ApiProperty({ + required: false, + type: () => EventTypeCreateNestedManyWithoutSchedulesInput, + }) + @ValidateNested() + @Type(() => EventTypeCreateNestedManyWithoutSchedulesInput) + @IsOptional() + @Field(() => EventTypeCreateNestedManyWithoutSchedulesInput, { + nullable: true, + }) + eventType?: EventTypeCreateNestedManyWithoutSchedulesInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityCreateNestedManyWithoutSchedulesInput, + }) + @ValidateNested() + @Type(() => AvailabilityCreateNestedManyWithoutSchedulesInput) + @IsOptional() + @Field(() => AvailabilityCreateNestedManyWithoutSchedulesInput, { + nullable: true, + }) + availability?: AvailabilityCreateNestedManyWithoutSchedulesInput; +} + +export { ScheduleCreateInput as ScheduleCreateInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleFindManyArgs.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleFindManyArgs.ts new file mode 100644 index 0000000..470dbdd --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ScheduleWhereInput } from "./ScheduleWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { ScheduleOrderByInput } from "./ScheduleOrderByInput"; + +@ArgsType() +class ScheduleFindManyArgs { + @ApiProperty({ + required: false, + type: () => ScheduleWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => ScheduleWhereInput, { nullable: true }) + @Type(() => ScheduleWhereInput) + where?: ScheduleWhereInput; + + @ApiProperty({ + required: false, + type: [ScheduleOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [ScheduleOrderByInput], { nullable: true }) + @Type(() => ScheduleOrderByInput) + orderBy?: Array<ScheduleOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { ScheduleFindManyArgs as ScheduleFindManyArgs }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleFindUniqueArgs.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleFindUniqueArgs.ts new file mode 100644 index 0000000..8aea17e --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ScheduleWhereUniqueInput } from "./ScheduleWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class ScheduleFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @Field(() => ScheduleWhereUniqueInput, { nullable: false }) + where!: ScheduleWhereUniqueInput; +} + +export { ScheduleFindUniqueArgs as ScheduleFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleListRelationFilter.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleListRelationFilter.ts new file mode 100644 index 0000000..7da5399 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ScheduleWhereInput } from "./ScheduleWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class ScheduleListRelationFilter { + @ApiProperty({ + required: false, + type: () => ScheduleWhereInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereInput) + @IsOptional() + @Field(() => ScheduleWhereInput, { + nullable: true, + }) + every?: ScheduleWhereInput; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereInput) + @IsOptional() + @Field(() => ScheduleWhereInput, { + nullable: true, + }) + some?: ScheduleWhereInput; + + @ApiProperty({ + required: false, + type: () => ScheduleWhereInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereInput) + @IsOptional() + @Field(() => ScheduleWhereInput, { + nullable: true, + }) + none?: ScheduleWhereInput; +} +export { ScheduleListRelationFilter as ScheduleListRelationFilter }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleOrderByInput.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleOrderByInput.ts new file mode 100644 index 0000000..d73a92c --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleOrderByInput.ts @@ -0,0 +1,67 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class ScheduleOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + name?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + timeZone?: SortOrder; +} + +export { ScheduleOrderByInput as ScheduleOrderByInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleUpdateInput.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleUpdateInput.ts new file mode 100644 index 0000000..277cb7e --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleUpdateInput.ts @@ -0,0 +1,81 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested, IsOptional, IsString } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeUpdateManyWithoutSchedulesInput } from "./EventTypeUpdateManyWithoutSchedulesInput"; +import { AvailabilityUpdateManyWithoutSchedulesInput } from "./AvailabilityUpdateManyWithoutSchedulesInput"; + +@InputType() +class ScheduleUpdateInput { + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone?: string | null; + + @ApiProperty({ + required: false, + type: () => EventTypeUpdateManyWithoutSchedulesInput, + }) + @ValidateNested() + @Type(() => EventTypeUpdateManyWithoutSchedulesInput) + @IsOptional() + @Field(() => EventTypeUpdateManyWithoutSchedulesInput, { + nullable: true, + }) + eventType?: EventTypeUpdateManyWithoutSchedulesInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityUpdateManyWithoutSchedulesInput, + }) + @ValidateNested() + @Type(() => AvailabilityUpdateManyWithoutSchedulesInput) + @IsOptional() + @Field(() => AvailabilityUpdateManyWithoutSchedulesInput, { + nullable: true, + }) + availability?: AvailabilityUpdateManyWithoutSchedulesInput; +} + +export { ScheduleUpdateInput as ScheduleUpdateInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleWhereInput.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleWhereInput.ts new file mode 100644 index 0000000..9185ebd --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleWhereInput.ts @@ -0,0 +1,95 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { EventTypeListRelationFilter } from "../../eventType/base/EventTypeListRelationFilter"; +import { AvailabilityListRelationFilter } from "../../availability/base/AvailabilityListRelationFilter"; + +@InputType() +class ScheduleWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + name?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + timeZone?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: () => EventTypeListRelationFilter, + }) + @ValidateNested() + @Type(() => EventTypeListRelationFilter) + @IsOptional() + @Field(() => EventTypeListRelationFilter, { + nullable: true, + }) + eventType?: EventTypeListRelationFilter; + + @ApiProperty({ + required: false, + type: () => AvailabilityListRelationFilter, + }) + @ValidateNested() + @Type(() => AvailabilityListRelationFilter) + @IsOptional() + @Field(() => AvailabilityListRelationFilter, { + nullable: true, + }) + availability?: AvailabilityListRelationFilter; +} + +export { ScheduleWhereInput as ScheduleWhereInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/ScheduleWhereUniqueInput.ts b/apps/roi-cacl-2/src/schedule/base/ScheduleWhereUniqueInput.ts new file mode 100644 index 0000000..6cde7a5 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/ScheduleWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class ScheduleWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { ScheduleWhereUniqueInput as ScheduleWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/schedule/base/UpdateScheduleArgs.ts b/apps/roi-cacl-2/src/schedule/base/UpdateScheduleArgs.ts new file mode 100644 index 0000000..9eef6c2 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/UpdateScheduleArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { ScheduleWhereUniqueInput } from "./ScheduleWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { ScheduleUpdateInput } from "./ScheduleUpdateInput"; + +@ArgsType() +class UpdateScheduleArgs { + @ApiProperty({ + required: true, + type: () => ScheduleWhereUniqueInput, + }) + @ValidateNested() + @Type(() => ScheduleWhereUniqueInput) + @Field(() => ScheduleWhereUniqueInput, { nullable: false }) + where!: ScheduleWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => ScheduleUpdateInput, + }) + @ValidateNested() + @Type(() => ScheduleUpdateInput) + @Field(() => ScheduleUpdateInput, { nullable: false }) + data!: ScheduleUpdateInput; +} + +export { UpdateScheduleArgs as UpdateScheduleArgs }; diff --git a/apps/roi-cacl-2/src/schedule/base/schedule.controller.base.spec.ts b/apps/roi-cacl-2/src/schedule/base/schedule.controller.base.spec.ts new file mode 100644 index 0000000..d378dbb --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/schedule.controller.base.spec.ts @@ -0,0 +1,172 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { ScheduleController } from "../schedule.controller"; +import { ScheduleService } from "../schedule.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + name: "exampleName", + timeZone: "exampleTimeZone", +}; +const CREATE_RESULT = { + id: 42, + name: "exampleName", + timeZone: "exampleTimeZone", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + name: "exampleName", + timeZone: "exampleTimeZone", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + name: "exampleName", + timeZone: "exampleTimeZone", +}; + +const service = { + createSchedule() { + return CREATE_RESULT; + }, + schedules: () => FIND_MANY_RESULT, + schedule: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Schedule", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: ScheduleService, + useValue: service, + }, + ], + controllers: [ScheduleController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /schedules", async () => { + await request(app.getHttpServer()) + .post("/schedules") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /schedules", async () => { + await request(app.getHttpServer()) + .get("/schedules") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /schedules/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/schedules"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /schedules/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/schedules"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /schedules existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/schedules") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/schedules") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/schedule/base/schedule.controller.base.ts b/apps/roi-cacl-2/src/schedule/base/schedule.controller.base.ts new file mode 100644 index 0000000..f848ea4 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/schedule.controller.base.ts @@ -0,0 +1,406 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { ScheduleService } from "../schedule.service"; +import { ScheduleCreateInput } from "./ScheduleCreateInput"; +import { Schedule } from "./Schedule"; +import { ScheduleFindManyArgs } from "./ScheduleFindManyArgs"; +import { ScheduleWhereUniqueInput } from "./ScheduleWhereUniqueInput"; +import { ScheduleUpdateInput } from "./ScheduleUpdateInput"; +import { EventTypeFindManyArgs } from "../../eventType/base/EventTypeFindManyArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { AvailabilityFindManyArgs } from "../../availability/base/AvailabilityFindManyArgs"; +import { Availability } from "../../availability/base/Availability"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; + +export class ScheduleControllerBase { + constructor(protected readonly service: ScheduleService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Schedule }) + async createSchedule( + @common.Body() data: ScheduleCreateInput + ): Promise<Schedule> { + return await this.service.createSchedule({ + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + name: true, + timeZone: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Schedule] }) + @ApiNestedQuery(ScheduleFindManyArgs) + async schedules(@common.Req() request: Request): Promise<Schedule[]> { + const args = plainToClass(ScheduleFindManyArgs, request.query); + return this.service.schedules({ + ...args, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + name: true, + timeZone: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Schedule }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async schedule( + @common.Param() params: ScheduleWhereUniqueInput + ): Promise<Schedule | null> { + const result = await this.service.schedule({ + where: params, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + name: true, + timeZone: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Schedule }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateSchedule( + @common.Param() params: ScheduleWhereUniqueInput, + @common.Body() data: ScheduleUpdateInput + ): Promise<Schedule | null> { + try { + return await this.service.updateSchedule({ + where: params, + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + name: true, + timeZone: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Schedule }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteSchedule( + @common.Param() params: ScheduleWhereUniqueInput + ): Promise<Schedule | null> { + try { + return await this.service.deleteSchedule({ + where: params, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + name: true, + timeZone: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/eventType") + @ApiNestedQuery(EventTypeFindManyArgs) + async findEventType( + @common.Req() request: Request, + @common.Param() params: ScheduleWhereUniqueInput + ): Promise<EventType[]> { + const query = plainToClass(EventTypeFindManyArgs, request.query); + const results = await this.service.findEventType(params.id, { + ...query, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/eventType") + async connectEventType( + @common.Param() params: ScheduleWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventType: { + connect: body, + }, + }; + await this.service.updateSchedule({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/eventType") + async updateEventType( + @common.Param() params: ScheduleWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventType: { + set: body, + }, + }; + await this.service.updateSchedule({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/eventType") + async disconnectEventType( + @common.Param() params: ScheduleWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventType: { + disconnect: body, + }, + }; + await this.service.updateSchedule({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/availability") + @ApiNestedQuery(AvailabilityFindManyArgs) + async findAvailability( + @common.Req() request: Request, + @common.Param() params: ScheduleWhereUniqueInput + ): Promise<Availability[]> { + const query = plainToClass(AvailabilityFindManyArgs, request.query); + const results = await this.service.findAvailability(params.id, { + ...query, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/availability") + async connectAvailability( + @common.Param() params: ScheduleWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + connect: body, + }, + }; + await this.service.updateSchedule({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/availability") + async updateAvailability( + @common.Param() params: ScheduleWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + set: body, + }, + }; + await this.service.updateSchedule({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/availability") + async disconnectAvailability( + @common.Param() params: ScheduleWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + disconnect: body, + }, + }; + await this.service.updateSchedule({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/schedule/base/schedule.module.base.ts b/apps/roi-cacl-2/src/schedule/base/schedule.module.base.ts new file mode 100644 index 0000000..2976749 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/schedule.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class ScheduleModuleBase {} diff --git a/apps/roi-cacl-2/src/schedule/base/schedule.resolver.base.ts b/apps/roi-cacl-2/src/schedule/base/schedule.resolver.base.ts new file mode 100644 index 0000000..ed93b51 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/schedule.resolver.base.ts @@ -0,0 +1,157 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Schedule } from "./Schedule"; +import { ScheduleCountArgs } from "./ScheduleCountArgs"; +import { ScheduleFindManyArgs } from "./ScheduleFindManyArgs"; +import { ScheduleFindUniqueArgs } from "./ScheduleFindUniqueArgs"; +import { CreateScheduleArgs } from "./CreateScheduleArgs"; +import { UpdateScheduleArgs } from "./UpdateScheduleArgs"; +import { DeleteScheduleArgs } from "./DeleteScheduleArgs"; +import { EventTypeFindManyArgs } from "../../eventType/base/EventTypeFindManyArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { AvailabilityFindManyArgs } from "../../availability/base/AvailabilityFindManyArgs"; +import { Availability } from "../../availability/base/Availability"; +import { User } from "../../user/base/User"; +import { ScheduleService } from "../schedule.service"; +@graphql.Resolver(() => Schedule) +export class ScheduleResolverBase { + constructor(protected readonly service: ScheduleService) {} + + async _schedulesMeta( + @graphql.Args() args: ScheduleCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Schedule]) + async schedules( + @graphql.Args() args: ScheduleFindManyArgs + ): Promise<Schedule[]> { + return this.service.schedules(args); + } + + @graphql.Query(() => Schedule, { nullable: true }) + async schedule( + @graphql.Args() args: ScheduleFindUniqueArgs + ): Promise<Schedule | null> { + const result = await this.service.schedule(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Schedule) + async createSchedule( + @graphql.Args() args: CreateScheduleArgs + ): Promise<Schedule> { + return await this.service.createSchedule({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } + + @graphql.Mutation(() => Schedule) + async updateSchedule( + @graphql.Args() args: UpdateScheduleArgs + ): Promise<Schedule | null> { + try { + return await this.service.updateSchedule({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Schedule) + async deleteSchedule( + @graphql.Args() args: DeleteScheduleArgs + ): Promise<Schedule | null> { + try { + return await this.service.deleteSchedule(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [EventType], { name: "eventType" }) + async findEventType( + @graphql.Parent() parent: Schedule, + @graphql.Args() args: EventTypeFindManyArgs + ): Promise<EventType[]> { + const results = await this.service.findEventType(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Availability], { name: "availability" }) + async findAvailability( + @graphql.Parent() parent: Schedule, + @graphql.Args() args: AvailabilityFindManyArgs + ): Promise<Availability[]> { + const results = await this.service.findAvailability(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Schedule): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/schedule/base/schedule.service.base.ts b/apps/roi-cacl-2/src/schedule/base/schedule.service.base.ts new file mode 100644 index 0000000..a56d009 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/base/schedule.service.base.ts @@ -0,0 +1,84 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Schedule as PrismaSchedule, + EventType as PrismaEventType, + Availability as PrismaAvailability, + User as PrismaUser, +} from "@prisma/client"; + +export class ScheduleServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.ScheduleCountArgs, "select">): Promise<number> { + return this.prisma.schedule.count(args); + } + + async schedules<T extends Prisma.ScheduleFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.ScheduleFindManyArgs> + ): Promise<PrismaSchedule[]> { + return this.prisma.schedule.findMany<Prisma.ScheduleFindManyArgs>(args); + } + async schedule<T extends Prisma.ScheduleFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.ScheduleFindUniqueArgs> + ): Promise<PrismaSchedule | null> { + return this.prisma.schedule.findUnique(args); + } + async createSchedule<T extends Prisma.ScheduleCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.ScheduleCreateArgs> + ): Promise<PrismaSchedule> { + return this.prisma.schedule.create<T>(args); + } + async updateSchedule<T extends Prisma.ScheduleUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.ScheduleUpdateArgs> + ): Promise<PrismaSchedule> { + return this.prisma.schedule.update<T>(args); + } + async deleteSchedule<T extends Prisma.ScheduleDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.ScheduleDeleteArgs> + ): Promise<PrismaSchedule> { + return this.prisma.schedule.delete(args); + } + + async findEventType( + parentId: number, + args: Prisma.EventTypeFindManyArgs + ): Promise<PrismaEventType[]> { + return this.prisma.schedule + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .eventType(args); + } + + async findAvailability( + parentId: number, + args: Prisma.AvailabilityFindManyArgs + ): Promise<PrismaAvailability[]> { + return this.prisma.schedule + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .availability(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.schedule + .findUnique({ + where: { id: parentId }, + }) + .user(); + } +} diff --git a/apps/roi-cacl-2/src/schedule/schedule.controller.ts b/apps/roi-cacl-2/src/schedule/schedule.controller.ts new file mode 100644 index 0000000..daf7f6e --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/schedule.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { ScheduleService } from "./schedule.service"; +import { ScheduleControllerBase } from "./base/schedule.controller.base"; + +@swagger.ApiTags("schedules") +@common.Controller("schedules") +export class ScheduleController extends ScheduleControllerBase { + constructor(protected readonly service: ScheduleService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/schedule/schedule.module.ts b/apps/roi-cacl-2/src/schedule/schedule.module.ts new file mode 100644 index 0000000..771e6d7 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/schedule.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { ScheduleModuleBase } from "./base/schedule.module.base"; +import { ScheduleService } from "./schedule.service"; +import { ScheduleController } from "./schedule.controller"; +import { ScheduleResolver } from "./schedule.resolver"; + +@Module({ + imports: [ScheduleModuleBase], + controllers: [ScheduleController], + providers: [ScheduleService, ScheduleResolver], + exports: [ScheduleService], +}) +export class ScheduleModule {} diff --git a/apps/roi-cacl-2/src/schedule/schedule.resolver.ts b/apps/roi-cacl-2/src/schedule/schedule.resolver.ts new file mode 100644 index 0000000..a277b31 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/schedule.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { ScheduleResolverBase } from "./base/schedule.resolver.base"; +import { Schedule } from "./base/Schedule"; +import { ScheduleService } from "./schedule.service"; + +@graphql.Resolver(() => Schedule) +export class ScheduleResolver extends ScheduleResolverBase { + constructor(protected readonly service: ScheduleService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/schedule/schedule.service.ts b/apps/roi-cacl-2/src/schedule/schedule.service.ts new file mode 100644 index 0000000..fff3ca0 --- /dev/null +++ b/apps/roi-cacl-2/src/schedule/schedule.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { ScheduleServiceBase } from "./base/schedule.service.base"; + +@Injectable() +export class ScheduleService extends ScheduleServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/CreateSelectedCalendarArgs.ts b/apps/roi-cacl-2/src/selectedCalendar/base/CreateSelectedCalendarArgs.ts new file mode 100644 index 0000000..1b1e0bd --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/CreateSelectedCalendarArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SelectedCalendarCreateInput } from "./SelectedCalendarCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateSelectedCalendarArgs { + @ApiProperty({ + required: true, + type: () => SelectedCalendarCreateInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarCreateInput) + @Field(() => SelectedCalendarCreateInput, { nullable: false }) + data!: SelectedCalendarCreateInput; +} + +export { CreateSelectedCalendarArgs as CreateSelectedCalendarArgs }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/DeleteSelectedCalendarArgs.ts b/apps/roi-cacl-2/src/selectedCalendar/base/DeleteSelectedCalendarArgs.ts new file mode 100644 index 0000000..4c50172 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/DeleteSelectedCalendarArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SelectedCalendarWhereUniqueInput } from "./SelectedCalendarWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteSelectedCalendarArgs { + @ApiProperty({ + required: true, + type: () => SelectedCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarWhereUniqueInput) + @Field(() => SelectedCalendarWhereUniqueInput, { nullable: false }) + where!: SelectedCalendarWhereUniqueInput; +} + +export { DeleteSelectedCalendarArgs as DeleteSelectedCalendarArgs }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendar.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendar.ts new file mode 100644 index 0000000..cde7d7a --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendar.ts @@ -0,0 +1,53 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, ValidateNested, IsString } from "class-validator"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; + +@ObjectType() +class SelectedCalendar { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + user?: User; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + integration!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + externalId!: string; +} + +export { SelectedCalendar as SelectedCalendar }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCountArgs.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCountArgs.ts new file mode 100644 index 0000000..c8a5e4a --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SelectedCalendarWhereInput } from "./SelectedCalendarWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class SelectedCalendarCountArgs { + @ApiProperty({ + required: false, + type: () => SelectedCalendarWhereInput, + }) + @Field(() => SelectedCalendarWhereInput, { nullable: true }) + @Type(() => SelectedCalendarWhereInput) + where?: SelectedCalendarWhereInput; +} + +export { SelectedCalendarCountArgs as SelectedCalendarCountArgs }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCreateInput.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCreateInput.ts new file mode 100644 index 0000000..d0c8b81 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarCreateInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested, IsString } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class SelectedCalendarCreateInput { + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput) + user!: UserWhereUniqueInput; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + integration!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + externalId!: string; +} + +export { SelectedCalendarCreateInput as SelectedCalendarCreateInput }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindManyArgs.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindManyArgs.ts new file mode 100644 index 0000000..356a129 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SelectedCalendarWhereInput } from "./SelectedCalendarWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { SelectedCalendarOrderByInput } from "./SelectedCalendarOrderByInput"; + +@ArgsType() +class SelectedCalendarFindManyArgs { + @ApiProperty({ + required: false, + type: () => SelectedCalendarWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => SelectedCalendarWhereInput, { nullable: true }) + @Type(() => SelectedCalendarWhereInput) + where?: SelectedCalendarWhereInput; + + @ApiProperty({ + required: false, + type: [SelectedCalendarOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [SelectedCalendarOrderByInput], { nullable: true }) + @Type(() => SelectedCalendarOrderByInput) + orderBy?: Array<SelectedCalendarOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { SelectedCalendarFindManyArgs as SelectedCalendarFindManyArgs }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindUniqueArgs.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindUniqueArgs.ts new file mode 100644 index 0000000..4a7467c --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SelectedCalendarWhereUniqueInput } from "./SelectedCalendarWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class SelectedCalendarFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => SelectedCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarWhereUniqueInput) + @Field(() => SelectedCalendarWhereUniqueInput, { nullable: false }) + where!: SelectedCalendarWhereUniqueInput; +} + +export { SelectedCalendarFindUniqueArgs as SelectedCalendarFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarListRelationFilter.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarListRelationFilter.ts new file mode 100644 index 0000000..2fb3e4d --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SelectedCalendarWhereInput } from "./SelectedCalendarWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class SelectedCalendarListRelationFilter { + @ApiProperty({ + required: false, + type: () => SelectedCalendarWhereInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarWhereInput) + @IsOptional() + @Field(() => SelectedCalendarWhereInput, { + nullable: true, + }) + every?: SelectedCalendarWhereInput; + + @ApiProperty({ + required: false, + type: () => SelectedCalendarWhereInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarWhereInput) + @IsOptional() + @Field(() => SelectedCalendarWhereInput, { + nullable: true, + }) + some?: SelectedCalendarWhereInput; + + @ApiProperty({ + required: false, + type: () => SelectedCalendarWhereInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarWhereInput) + @IsOptional() + @Field(() => SelectedCalendarWhereInput, { + nullable: true, + }) + none?: SelectedCalendarWhereInput; +} +export { SelectedCalendarListRelationFilter as SelectedCalendarListRelationFilter }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarOrderByInput.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarOrderByInput.ts new file mode 100644 index 0000000..b716300 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarOrderByInput.ts @@ -0,0 +1,67 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class SelectedCalendarOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + integration?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + externalId?: SortOrder; +} + +export { SelectedCalendarOrderByInput as SelectedCalendarOrderByInput }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarUpdateInput.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarUpdateInput.ts new file mode 100644 index 0000000..04977e5 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarUpdateInput.ts @@ -0,0 +1,55 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { ValidateNested, IsOptional, IsString } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class SelectedCalendarUpdateInput { + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + integration?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + externalId?: string; +} + +export { SelectedCalendarUpdateInput as SelectedCalendarUpdateInput }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereInput.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereInput.ts new file mode 100644 index 0000000..25cbb68 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereInput.ts @@ -0,0 +1,68 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { StringFilter } from "../../util/StringFilter"; + +@InputType() +class SelectedCalendarWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + integration?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + externalId?: StringFilter; +} + +export { SelectedCalendarWhereInput as SelectedCalendarWhereInput }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereUniqueInput.ts b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereUniqueInput.ts new file mode 100644 index 0000000..6bbca78 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/SelectedCalendarWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class SelectedCalendarWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { SelectedCalendarWhereUniqueInput as SelectedCalendarWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/UpdateSelectedCalendarArgs.ts b/apps/roi-cacl-2/src/selectedCalendar/base/UpdateSelectedCalendarArgs.ts new file mode 100644 index 0000000..76f4b6d --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/UpdateSelectedCalendarArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SelectedCalendarWhereUniqueInput } from "./SelectedCalendarWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { SelectedCalendarUpdateInput } from "./SelectedCalendarUpdateInput"; + +@ArgsType() +class UpdateSelectedCalendarArgs { + @ApiProperty({ + required: true, + type: () => SelectedCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarWhereUniqueInput) + @Field(() => SelectedCalendarWhereUniqueInput, { nullable: false }) + where!: SelectedCalendarWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => SelectedCalendarUpdateInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarUpdateInput) + @Field(() => SelectedCalendarUpdateInput, { nullable: false }) + data!: SelectedCalendarUpdateInput; +} + +export { UpdateSelectedCalendarArgs as UpdateSelectedCalendarArgs }; diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.spec.ts b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.spec.ts new file mode 100644 index 0000000..3c4f8b8 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.spec.ts @@ -0,0 +1,172 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { SelectedCalendarController } from "../selectedCalendar.controller"; +import { SelectedCalendarService } from "../selectedCalendar.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", +}; +const CREATE_RESULT = { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + integration: "exampleIntegration", + externalId: "exampleExternalId", +}; + +const service = { + createSelectedCalendar() { + return CREATE_RESULT; + }, + selectedCalendars: () => FIND_MANY_RESULT, + selectedCalendar: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("SelectedCalendar", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: SelectedCalendarService, + useValue: service, + }, + ], + controllers: [SelectedCalendarController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /selectedCalendars", async () => { + await request(app.getHttpServer()) + .post("/selectedCalendars") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /selectedCalendars", async () => { + await request(app.getHttpServer()) + .get("/selectedCalendars") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /selectedCalendars/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/selectedCalendars"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /selectedCalendars/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/selectedCalendars"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /selectedCalendars existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/selectedCalendars") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/selectedCalendars") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.ts b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.ts new file mode 100644 index 0000000..aa48cac --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.controller.base.ts @@ -0,0 +1,180 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { SelectedCalendarService } from "../selectedCalendar.service"; +import { SelectedCalendarCreateInput } from "./SelectedCalendarCreateInput"; +import { SelectedCalendar } from "./SelectedCalendar"; +import { SelectedCalendarFindManyArgs } from "./SelectedCalendarFindManyArgs"; +import { SelectedCalendarWhereUniqueInput } from "./SelectedCalendarWhereUniqueInput"; +import { SelectedCalendarUpdateInput } from "./SelectedCalendarUpdateInput"; + +export class SelectedCalendarControllerBase { + constructor(protected readonly service: SelectedCalendarService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: SelectedCalendar }) + async createSelectedCalendar( + @common.Body() data: SelectedCalendarCreateInput + ): Promise<SelectedCalendar> { + return await this.service.createSelectedCalendar({ + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + integration: true, + externalId: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [SelectedCalendar] }) + @ApiNestedQuery(SelectedCalendarFindManyArgs) + async selectedCalendars( + @common.Req() request: Request + ): Promise<SelectedCalendar[]> { + const args = plainToClass(SelectedCalendarFindManyArgs, request.query); + return this.service.selectedCalendars({ + ...args, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + integration: true, + externalId: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: SelectedCalendar }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async selectedCalendar( + @common.Param() params: SelectedCalendarWhereUniqueInput + ): Promise<SelectedCalendar | null> { + const result = await this.service.selectedCalendar({ + where: params, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + integration: true, + externalId: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: SelectedCalendar }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateSelectedCalendar( + @common.Param() params: SelectedCalendarWhereUniqueInput, + @common.Body() data: SelectedCalendarUpdateInput + ): Promise<SelectedCalendar | null> { + try { + return await this.service.updateSelectedCalendar({ + where: params, + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + integration: true, + externalId: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: SelectedCalendar }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteSelectedCalendar( + @common.Param() params: SelectedCalendarWhereUniqueInput + ): Promise<SelectedCalendar | null> { + try { + return await this.service.deleteSelectedCalendar({ + where: params, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + integration: true, + externalId: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.module.base.ts b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.module.base.ts new file mode 100644 index 0000000..9717b79 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class SelectedCalendarModuleBase {} diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.resolver.base.ts b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.resolver.base.ts new file mode 100644 index 0000000..e9d2c0b --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.resolver.base.ts @@ -0,0 +1,127 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { SelectedCalendar } from "./SelectedCalendar"; +import { SelectedCalendarCountArgs } from "./SelectedCalendarCountArgs"; +import { SelectedCalendarFindManyArgs } from "./SelectedCalendarFindManyArgs"; +import { SelectedCalendarFindUniqueArgs } from "./SelectedCalendarFindUniqueArgs"; +import { CreateSelectedCalendarArgs } from "./CreateSelectedCalendarArgs"; +import { UpdateSelectedCalendarArgs } from "./UpdateSelectedCalendarArgs"; +import { DeleteSelectedCalendarArgs } from "./DeleteSelectedCalendarArgs"; +import { User } from "../../user/base/User"; +import { SelectedCalendarService } from "../selectedCalendar.service"; +@graphql.Resolver(() => SelectedCalendar) +export class SelectedCalendarResolverBase { + constructor(protected readonly service: SelectedCalendarService) {} + + async _selectedCalendarsMeta( + @graphql.Args() args: SelectedCalendarCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [SelectedCalendar]) + async selectedCalendars( + @graphql.Args() args: SelectedCalendarFindManyArgs + ): Promise<SelectedCalendar[]> { + return this.service.selectedCalendars(args); + } + + @graphql.Query(() => SelectedCalendar, { nullable: true }) + async selectedCalendar( + @graphql.Args() args: SelectedCalendarFindUniqueArgs + ): Promise<SelectedCalendar | null> { + const result = await this.service.selectedCalendar(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => SelectedCalendar) + async createSelectedCalendar( + @graphql.Args() args: CreateSelectedCalendarArgs + ): Promise<SelectedCalendar> { + return await this.service.createSelectedCalendar({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } + + @graphql.Mutation(() => SelectedCalendar) + async updateSelectedCalendar( + @graphql.Args() args: UpdateSelectedCalendarArgs + ): Promise<SelectedCalendar | null> { + try { + return await this.service.updateSelectedCalendar({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => SelectedCalendar) + async deleteSelectedCalendar( + @graphql.Args() args: DeleteSelectedCalendarArgs + ): Promise<SelectedCalendar | null> { + try { + return await this.service.deleteSelectedCalendar(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser( + @graphql.Parent() parent: SelectedCalendar + ): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.service.base.ts b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.service.base.ts new file mode 100644 index 0000000..1b09f47 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/base/selectedCalendar.service.base.ts @@ -0,0 +1,63 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + SelectedCalendar as PrismaSelectedCalendar, + User as PrismaUser, +} from "@prisma/client"; + +export class SelectedCalendarServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.SelectedCalendarCountArgs, "select"> + ): Promise<number> { + return this.prisma.selectedCalendar.count(args); + } + + async selectedCalendars<T extends Prisma.SelectedCalendarFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.SelectedCalendarFindManyArgs> + ): Promise<PrismaSelectedCalendar[]> { + return this.prisma.selectedCalendar.findMany<Prisma.SelectedCalendarFindManyArgs>( + args + ); + } + async selectedCalendar<T extends Prisma.SelectedCalendarFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.SelectedCalendarFindUniqueArgs> + ): Promise<PrismaSelectedCalendar | null> { + return this.prisma.selectedCalendar.findUnique(args); + } + async createSelectedCalendar<T extends Prisma.SelectedCalendarCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.SelectedCalendarCreateArgs> + ): Promise<PrismaSelectedCalendar> { + return this.prisma.selectedCalendar.create<T>(args); + } + async updateSelectedCalendar<T extends Prisma.SelectedCalendarUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.SelectedCalendarUpdateArgs> + ): Promise<PrismaSelectedCalendar> { + return this.prisma.selectedCalendar.update<T>(args); + } + async deleteSelectedCalendar<T extends Prisma.SelectedCalendarDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.SelectedCalendarDeleteArgs> + ): Promise<PrismaSelectedCalendar> { + return this.prisma.selectedCalendar.delete(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.selectedCalendar + .findUnique({ + where: { id: parentId }, + }) + .user(); + } +} diff --git a/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.controller.ts b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.controller.ts new file mode 100644 index 0000000..ff741e7 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { SelectedCalendarService } from "./selectedCalendar.service"; +import { SelectedCalendarControllerBase } from "./base/selectedCalendar.controller.base"; + +@swagger.ApiTags("selectedCalendars") +@common.Controller("selectedCalendars") +export class SelectedCalendarController extends SelectedCalendarControllerBase { + constructor(protected readonly service: SelectedCalendarService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.module.ts b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.module.ts new file mode 100644 index 0000000..aa990df --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { SelectedCalendarModuleBase } from "./base/selectedCalendar.module.base"; +import { SelectedCalendarService } from "./selectedCalendar.service"; +import { SelectedCalendarController } from "./selectedCalendar.controller"; +import { SelectedCalendarResolver } from "./selectedCalendar.resolver"; + +@Module({ + imports: [SelectedCalendarModuleBase], + controllers: [SelectedCalendarController], + providers: [SelectedCalendarService, SelectedCalendarResolver], + exports: [SelectedCalendarService], +}) +export class SelectedCalendarModule {} diff --git a/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.resolver.ts b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.resolver.ts new file mode 100644 index 0000000..9cdb292 --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { SelectedCalendarResolverBase } from "./base/selectedCalendar.resolver.base"; +import { SelectedCalendar } from "./base/SelectedCalendar"; +import { SelectedCalendarService } from "./selectedCalendar.service"; + +@graphql.Resolver(() => SelectedCalendar) +export class SelectedCalendarResolver extends SelectedCalendarResolverBase { + constructor(protected readonly service: SelectedCalendarService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.service.ts b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.service.ts new file mode 100644 index 0000000..3c049ad --- /dev/null +++ b/apps/roi-cacl-2/src/selectedCalendar/selectedCalendar.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { SelectedCalendarServiceBase } from "./base/selectedCalendar.service.base"; + +@Injectable() +export class SelectedCalendarService extends SelectedCalendarServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/serveStaticOptions.service.ts b/apps/roi-cacl-2/src/serveStaticOptions.service.ts new file mode 100644 index 0000000..390248b --- /dev/null +++ b/apps/roi-cacl-2/src/serveStaticOptions.service.ts @@ -0,0 +1,39 @@ +import * as path from "path"; +import { Injectable, Logger } from "@nestjs/common"; +import { ConfigService } from "@nestjs/config"; +import { + ServeStaticModuleOptions, + ServeStaticModuleOptionsFactory, +} from "@nestjs/serve-static"; + +const SERVE_STATIC_ROOT_PATH_VAR = "SERVE_STATIC_ROOT_PATH"; +const DEFAULT_STATIC_MODULE_OPTIONS_LIST: ServeStaticModuleOptions[] = [ + { + serveRoot: "/swagger", + rootPath: path.join(__dirname, "swagger"), + }, +]; + +@Injectable() +export class ServeStaticOptionsService + implements ServeStaticModuleOptionsFactory +{ + private readonly logger = new Logger(ServeStaticOptionsService.name); + + constructor(private readonly configService: ConfigService) {} + + createLoggerOptions(): ServeStaticModuleOptions[] { + const serveStaticRootPath = this.configService.get( + SERVE_STATIC_ROOT_PATH_VAR + ); + if (serveStaticRootPath) { + const resolvedPath = path.resolve(serveStaticRootPath); + this.logger.log(`Serving static files from ${resolvedPath}`); + return [ + ...DEFAULT_STATIC_MODULE_OPTIONS_LIST, + { rootPath: resolvedPath, exclude: ["/api*", "/graphql"] }, + ]; + } + return DEFAULT_STATIC_MODULE_OPTIONS_LIST; + } +} diff --git a/apps/roi-cacl-2/src/session/base/CreateSessionArgs.ts b/apps/roi-cacl-2/src/session/base/CreateSessionArgs.ts new file mode 100644 index 0000000..56a89b6 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/CreateSessionArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SessionCreateInput } from "./SessionCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateSessionArgs { + @ApiProperty({ + required: true, + type: () => SessionCreateInput, + }) + @ValidateNested() + @Type(() => SessionCreateInput) + @Field(() => SessionCreateInput, { nullable: false }) + data!: SessionCreateInput; +} + +export { CreateSessionArgs as CreateSessionArgs }; diff --git a/apps/roi-cacl-2/src/session/base/DeleteSessionArgs.ts b/apps/roi-cacl-2/src/session/base/DeleteSessionArgs.ts new file mode 100644 index 0000000..8df4827 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/DeleteSessionArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SessionWhereUniqueInput } from "./SessionWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteSessionArgs { + @ApiProperty({ + required: true, + type: () => SessionWhereUniqueInput, + }) + @ValidateNested() + @Type(() => SessionWhereUniqueInput) + @Field(() => SessionWhereUniqueInput, { nullable: false }) + where!: SessionWhereUniqueInput; +} + +export { DeleteSessionArgs as DeleteSessionArgs }; diff --git a/apps/roi-cacl-2/src/session/base/Session.ts b/apps/roi-cacl-2/src/session/base/Session.ts new file mode 100644 index 0000000..abf1da2 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/Session.ts @@ -0,0 +1,54 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsDate, ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +import { User } from "../../user/base/User"; + +@ObjectType() +class Session { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + sessionToken!: string; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + expires!: Date; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; +} + +export { Session as Session }; diff --git a/apps/roi-cacl-2/src/session/base/SessionCountArgs.ts b/apps/roi-cacl-2/src/session/base/SessionCountArgs.ts new file mode 100644 index 0000000..14df59b --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SessionWhereInput } from "./SessionWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class SessionCountArgs { + @ApiProperty({ + required: false, + type: () => SessionWhereInput, + }) + @Field(() => SessionWhereInput, { nullable: true }) + @Type(() => SessionWhereInput) + where?: SessionWhereInput; +} + +export { SessionCountArgs as SessionCountArgs }; diff --git a/apps/roi-cacl-2/src/session/base/SessionCreateInput.ts b/apps/roi-cacl-2/src/session/base/SessionCreateInput.ts new file mode 100644 index 0000000..47bc01e --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionCreateInput.ts @@ -0,0 +1,49 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsDate, ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class SessionCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + sessionToken!: string; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + expires!: Date; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; +} + +export { SessionCreateInput as SessionCreateInput }; diff --git a/apps/roi-cacl-2/src/session/base/SessionFindManyArgs.ts b/apps/roi-cacl-2/src/session/base/SessionFindManyArgs.ts new file mode 100644 index 0000000..eb36f8a --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SessionWhereInput } from "./SessionWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { SessionOrderByInput } from "./SessionOrderByInput"; + +@ArgsType() +class SessionFindManyArgs { + @ApiProperty({ + required: false, + type: () => SessionWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => SessionWhereInput, { nullable: true }) + @Type(() => SessionWhereInput) + where?: SessionWhereInput; + + @ApiProperty({ + required: false, + type: [SessionOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [SessionOrderByInput], { nullable: true }) + @Type(() => SessionOrderByInput) + orderBy?: Array<SessionOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { SessionFindManyArgs as SessionFindManyArgs }; diff --git a/apps/roi-cacl-2/src/session/base/SessionFindUniqueArgs.ts b/apps/roi-cacl-2/src/session/base/SessionFindUniqueArgs.ts new file mode 100644 index 0000000..ce7071a --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SessionWhereUniqueInput } from "./SessionWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class SessionFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => SessionWhereUniqueInput, + }) + @ValidateNested() + @Type(() => SessionWhereUniqueInput) + @Field(() => SessionWhereUniqueInput, { nullable: false }) + where!: SessionWhereUniqueInput; +} + +export { SessionFindUniqueArgs as SessionFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/session/base/SessionListRelationFilter.ts b/apps/roi-cacl-2/src/session/base/SessionListRelationFilter.ts new file mode 100644 index 0000000..64dbed8 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SessionWhereInput } from "./SessionWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class SessionListRelationFilter { + @ApiProperty({ + required: false, + type: () => SessionWhereInput, + }) + @ValidateNested() + @Type(() => SessionWhereInput) + @IsOptional() + @Field(() => SessionWhereInput, { + nullable: true, + }) + every?: SessionWhereInput; + + @ApiProperty({ + required: false, + type: () => SessionWhereInput, + }) + @ValidateNested() + @Type(() => SessionWhereInput) + @IsOptional() + @Field(() => SessionWhereInput, { + nullable: true, + }) + some?: SessionWhereInput; + + @ApiProperty({ + required: false, + type: () => SessionWhereInput, + }) + @ValidateNested() + @Type(() => SessionWhereInput) + @IsOptional() + @Field(() => SessionWhereInput, { + nullable: true, + }) + none?: SessionWhereInput; +} +export { SessionListRelationFilter as SessionListRelationFilter }; diff --git a/apps/roi-cacl-2/src/session/base/SessionOrderByInput.ts b/apps/roi-cacl-2/src/session/base/SessionOrderByInput.ts new file mode 100644 index 0000000..2d0afd6 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionOrderByInput.ts @@ -0,0 +1,67 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class SessionOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + sessionToken?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + expires?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; +} + +export { SessionOrderByInput as SessionOrderByInput }; diff --git a/apps/roi-cacl-2/src/session/base/SessionUpdateInput.ts b/apps/roi-cacl-2/src/session/base/SessionUpdateInput.ts new file mode 100644 index 0000000..1da5d52 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionUpdateInput.ts @@ -0,0 +1,55 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsDate, ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class SessionUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + sessionToken?: string; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + expires?: Date; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; +} + +export { SessionUpdateInput as SessionUpdateInput }; diff --git a/apps/roi-cacl-2/src/session/base/SessionWhereInput.ts b/apps/roi-cacl-2/src/session/base/SessionWhereInput.ts new file mode 100644 index 0000000..3ef203b --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionWhereInput.ts @@ -0,0 +1,68 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { StringFilter } from "../../util/StringFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; + +@InputType() +class SessionWhereInput { + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + id?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + sessionToken?: StringFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + expires?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; +} + +export { SessionWhereInput as SessionWhereInput }; diff --git a/apps/roi-cacl-2/src/session/base/SessionWhereUniqueInput.ts b/apps/roi-cacl-2/src/session/base/SessionWhereUniqueInput.ts new file mode 100644 index 0000000..b462221 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/SessionWhereUniqueInput.ts @@ -0,0 +1,27 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString } from "class-validator"; + +@InputType() +class SessionWhereUniqueInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; +} + +export { SessionWhereUniqueInput as SessionWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/session/base/UpdateSessionArgs.ts b/apps/roi-cacl-2/src/session/base/UpdateSessionArgs.ts new file mode 100644 index 0000000..f79b38d --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/UpdateSessionArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { SessionWhereUniqueInput } from "./SessionWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { SessionUpdateInput } from "./SessionUpdateInput"; + +@ArgsType() +class UpdateSessionArgs { + @ApiProperty({ + required: true, + type: () => SessionWhereUniqueInput, + }) + @ValidateNested() + @Type(() => SessionWhereUniqueInput) + @Field(() => SessionWhereUniqueInput, { nullable: false }) + where!: SessionWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => SessionUpdateInput, + }) + @ValidateNested() + @Type(() => SessionUpdateInput) + @Field(() => SessionUpdateInput, { nullable: false }) + data!: SessionUpdateInput; +} + +export { UpdateSessionArgs as UpdateSessionArgs }; diff --git a/apps/roi-cacl-2/src/session/base/session.controller.base.spec.ts b/apps/roi-cacl-2/src/session/base/session.controller.base.spec.ts new file mode 100644 index 0000000..3c32324 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/session.controller.base.spec.ts @@ -0,0 +1,186 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { SessionController } from "../session.controller"; +import { SessionService } from "../session.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: "exampleId", + sessionToken: "exampleSessionToken", + expires: new Date(), +}; +const CREATE_RESULT = { + id: "exampleId", + sessionToken: "exampleSessionToken", + expires: new Date(), +}; +const FIND_MANY_RESULT = [ + { + id: "exampleId", + sessionToken: "exampleSessionToken", + expires: new Date(), + }, +]; +const FIND_ONE_RESULT = { + id: "exampleId", + sessionToken: "exampleSessionToken", + expires: new Date(), +}; + +const service = { + createSession() { + return CREATE_RESULT; + }, + sessions: () => FIND_MANY_RESULT, + session: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Session", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: SessionService, + useValue: service, + }, + ], + controllers: [SessionController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /sessions", async () => { + await request(app.getHttpServer()) + .post("/sessions") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + expires: CREATE_RESULT.expires.toISOString(), + }); + }); + + test("GET /sessions", async () => { + await request(app.getHttpServer()) + .get("/sessions") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + expires: FIND_MANY_RESULT[0].expires.toISOString(), + }, + ]); + }); + + test("GET /sessions/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/sessions"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /sessions/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/sessions"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + expires: FIND_ONE_RESULT.expires.toISOString(), + }); + }); + + test("POST /sessions existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/sessions") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + expires: CREATE_RESULT.expires.toISOString(), + }) + .then(function () { + agent + .post("/sessions") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/session/base/session.controller.base.ts b/apps/roi-cacl-2/src/session/base/session.controller.base.ts new file mode 100644 index 0000000..f52b0af --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/session.controller.base.ts @@ -0,0 +1,177 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { SessionService } from "../session.service"; +import { SessionCreateInput } from "./SessionCreateInput"; +import { Session } from "./Session"; +import { SessionFindManyArgs } from "./SessionFindManyArgs"; +import { SessionWhereUniqueInput } from "./SessionWhereUniqueInput"; +import { SessionUpdateInput } from "./SessionUpdateInput"; + +export class SessionControllerBase { + constructor(protected readonly service: SessionService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Session }) + async createSession( + @common.Body() data: SessionCreateInput + ): Promise<Session> { + return await this.service.createSession({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + }, + select: { + id: true, + sessionToken: true, + expires: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Session] }) + @ApiNestedQuery(SessionFindManyArgs) + async sessions(@common.Req() request: Request): Promise<Session[]> { + const args = plainToClass(SessionFindManyArgs, request.query); + return this.service.sessions({ + ...args, + select: { + id: true, + sessionToken: true, + expires: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Session }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async session( + @common.Param() params: SessionWhereUniqueInput + ): Promise<Session | null> { + const result = await this.service.session({ + where: params, + select: { + id: true, + sessionToken: true, + expires: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Session }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateSession( + @common.Param() params: SessionWhereUniqueInput, + @common.Body() data: SessionUpdateInput + ): Promise<Session | null> { + try { + return await this.service.updateSession({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + }, + select: { + id: true, + sessionToken: true, + expires: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Session }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteSession( + @common.Param() params: SessionWhereUniqueInput + ): Promise<Session | null> { + try { + return await this.service.deleteSession({ + where: params, + select: { + id: true, + sessionToken: true, + expires: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/session/base/session.module.base.ts b/apps/roi-cacl-2/src/session/base/session.module.base.ts new file mode 100644 index 0000000..1801ea5 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/session.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class SessionModuleBase {} diff --git a/apps/roi-cacl-2/src/session/base/session.resolver.base.ts b/apps/roi-cacl-2/src/session/base/session.resolver.base.ts new file mode 100644 index 0000000..c5d8c69 --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/session.resolver.base.ts @@ -0,0 +1,129 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Session } from "./Session"; +import { SessionCountArgs } from "./SessionCountArgs"; +import { SessionFindManyArgs } from "./SessionFindManyArgs"; +import { SessionFindUniqueArgs } from "./SessionFindUniqueArgs"; +import { CreateSessionArgs } from "./CreateSessionArgs"; +import { UpdateSessionArgs } from "./UpdateSessionArgs"; +import { DeleteSessionArgs } from "./DeleteSessionArgs"; +import { User } from "../../user/base/User"; +import { SessionService } from "../session.service"; +@graphql.Resolver(() => Session) +export class SessionResolverBase { + constructor(protected readonly service: SessionService) {} + + async _sessionsMeta( + @graphql.Args() args: SessionCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Session]) + async sessions( + @graphql.Args() args: SessionFindManyArgs + ): Promise<Session[]> { + return this.service.sessions(args); + } + + @graphql.Query(() => Session, { nullable: true }) + async session( + @graphql.Args() args: SessionFindUniqueArgs + ): Promise<Session | null> { + const result = await this.service.session(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Session) + async createSession( + @graphql.Args() args: CreateSessionArgs + ): Promise<Session> { + return await this.service.createSession({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Session) + async updateSession( + @graphql.Args() args: UpdateSessionArgs + ): Promise<Session | null> { + try { + return await this.service.updateSession({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Session) + async deleteSession( + @graphql.Args() args: DeleteSessionArgs + ): Promise<Session | null> { + try { + return await this.service.deleteSession(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Session): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/session/base/session.service.base.ts b/apps/roi-cacl-2/src/session/base/session.service.base.ts new file mode 100644 index 0000000..ee6e29d --- /dev/null +++ b/apps/roi-cacl-2/src/session/base/session.service.base.ts @@ -0,0 +1,59 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + Session as PrismaSession, + User as PrismaUser, +} from "@prisma/client"; + +export class SessionServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.SessionCountArgs, "select">): Promise<number> { + return this.prisma.session.count(args); + } + + async sessions<T extends Prisma.SessionFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.SessionFindManyArgs> + ): Promise<PrismaSession[]> { + return this.prisma.session.findMany<Prisma.SessionFindManyArgs>(args); + } + async session<T extends Prisma.SessionFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.SessionFindUniqueArgs> + ): Promise<PrismaSession | null> { + return this.prisma.session.findUnique(args); + } + async createSession<T extends Prisma.SessionCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.SessionCreateArgs> + ): Promise<PrismaSession> { + return this.prisma.session.create<T>(args); + } + async updateSession<T extends Prisma.SessionUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.SessionUpdateArgs> + ): Promise<PrismaSession> { + return this.prisma.session.update<T>(args); + } + async deleteSession<T extends Prisma.SessionDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.SessionDeleteArgs> + ): Promise<PrismaSession> { + return this.prisma.session.delete(args); + } + + async getUser(parentId: string): Promise<PrismaUser | null> { + return this.prisma.session + .findUnique({ + where: { id: parentId }, + }) + .user(); + } +} diff --git a/apps/roi-cacl-2/src/session/session.controller.ts b/apps/roi-cacl-2/src/session/session.controller.ts new file mode 100644 index 0000000..83ffd9f --- /dev/null +++ b/apps/roi-cacl-2/src/session/session.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { SessionService } from "./session.service"; +import { SessionControllerBase } from "./base/session.controller.base"; + +@swagger.ApiTags("sessions") +@common.Controller("sessions") +export class SessionController extends SessionControllerBase { + constructor(protected readonly service: SessionService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/session/session.module.ts b/apps/roi-cacl-2/src/session/session.module.ts new file mode 100644 index 0000000..27828de --- /dev/null +++ b/apps/roi-cacl-2/src/session/session.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { SessionModuleBase } from "./base/session.module.base"; +import { SessionService } from "./session.service"; +import { SessionController } from "./session.controller"; +import { SessionResolver } from "./session.resolver"; + +@Module({ + imports: [SessionModuleBase], + controllers: [SessionController], + providers: [SessionService, SessionResolver], + exports: [SessionService], +}) +export class SessionModule {} diff --git a/apps/roi-cacl-2/src/session/session.resolver.ts b/apps/roi-cacl-2/src/session/session.resolver.ts new file mode 100644 index 0000000..8d37df5 --- /dev/null +++ b/apps/roi-cacl-2/src/session/session.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { SessionResolverBase } from "./base/session.resolver.base"; +import { Session } from "./base/Session"; +import { SessionService } from "./session.service"; + +@graphql.Resolver(() => Session) +export class SessionResolver extends SessionResolverBase { + constructor(protected readonly service: SessionService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/session/session.service.ts b/apps/roi-cacl-2/src/session/session.service.ts new file mode 100644 index 0000000..a3e38fc --- /dev/null +++ b/apps/roi-cacl-2/src/session/session.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { SessionServiceBase } from "./base/session.service.base"; + +@Injectable() +export class SessionService extends SessionServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/swagger.ts b/apps/roi-cacl-2/src/swagger.ts new file mode 100644 index 0000000..75efffc --- /dev/null +++ b/apps/roi-cacl-2/src/swagger.ts @@ -0,0 +1,20 @@ +import { DocumentBuilder, SwaggerCustomOptions } from "@nestjs/swagger"; + +export const swaggerPath = "api"; + +export const swaggerDocumentOptions = new DocumentBuilder() + .setTitle("ROICacl-2") + .setDescription( + '\n\n## Congratulations! Your service resource is ready.\n \nPlease note that all endpoints are secured with JWT Bearer authentication.\nBy default, your service resource comes with one user with the username "admin" and password "admin".\nLearn more in [our docs](https://docs.amplication.com)' + ) + .addBearerAuth() + .build(); + +export const swaggerSetupOptions: SwaggerCustomOptions = { + swaggerOptions: { + persistAuthorization: true, + }, + customCssUrl: "../swagger/swagger.css", + customfavIcon: "../swagger/favicon.png", + customSiteTitle: "ROICacl-2", +}; diff --git a/apps/roi-cacl-2/src/swagger/favicon.png b/apps/roi-cacl-2/src/swagger/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..a79882d55bdcd1d04939ed7a42257c20ac32f17c GIT binary patch literal 2498 zcmZ`*>rdNd6#kVvl#bgdw{@jJ2c2M{$hfWC29(Qyav88OF5?my1-7meXrU!j6F<&G z-ABd5FD8azVwPxROPCY=pqU9IVsw7-<C6UgK9A>3sY^_r^PK0L_t)QhIp_Dnt0#Nz zUY8*$H%ZepLuW_p0DL|zAr9;d1YSMa)3n&PI$N8EMqLPi?xpdO9FbuTLR}6=B34ZB zy#t_5cb?U4GfMi3xYNne*$y3abW!UWxa^9V{q33d1Q|_*bMr~9z|sXrD};qn7-fYX zJ9r$<JpV?duM@t+3o3Tig-1P5eN4{vNX{J|65&lTytof(;d_g?Zy-06DWbGYd^4O~ zr0{<>ZL*gj`_q@8O&Pu=ZcALiC%(#YrvYl=><YNs>*7ZL+_u<We*AS7<g+h8fYllj zG2+o6g0PNU$ux<(2xm@HJAzKOOvu3hv0<qBri>Z1LLR8y1ma@<cqI7&Rv<YZbeBiO zN$cGU;1!2j4K$Fe=bHE&Fw$02QadFYTmfUnxG+5f#uq^8S=?WU+wO9L1T24P+1=Sv z38#N!9ayWU+d3XNkR}f7H;8Q6yedMkWk8&R8Gn9<Yg&ToCplfuDb{M9bB@7)+Dg6` z$Weuhnwdcq)Q^ByxGoR(U%{>|zuo%${e}1{$Q(P*)dWk2g>f3H@$e(CwZ3uE+aLqK z?07P=SW=y8g0XIce%v;Tj76T%H!`q$&8i7QLkLwB>*hDih!$ad2k`gKV+Pkitia~M zciiE|BnaTf0h>7ReDWpmD!&3CPh79gG4=X4tM|)TnEm_>i}Abag~Lx}tm`7YKN~bC z2{6lGV;gQrDqkGf&e8+xJ?wsU@KBR)f`SwY&8}tmC>XE`v$1gL<sfcTz}M7;qeM}e za7D24;d(F+I0iOu(|Dp?`ybv}hX*oqx28qe*15F7AKz{7xu$wY24eZK0&}oR*jBH^ zbsGT)c6Pwp*pjx&6V5wxOI<%|(cMTIw+=pm6TG~CZ`=`%%EAib)YIJwxY)=XG_O<L z+O$C(7kh&T#%>l&@O}9~kZ&FoBJm70?rd0NJ!Xul;7G7}#yNDdgkg_Qo+ur=9{H$f ze=%oW^lx>uo#SAYe4KT#cr^dPgEz_>PRfAnQcB_5%T5S^nd|4zfPjJ11J(BA>a!xj zd>>m~WlmZJx$`IcjVorK2~<D3-F4Bq$Q<r~I0+9@5TD%$aq<gug2kCwcOJR;U%#5u z`kcH0`d2{Fe9pND1|0D`7;BqEW<F%(_mt59;@eCxz!ww`X6vcz0*a?~p)rk(_!@Xi z0=Fa6?3!^&6tQeAk%Lu{0ngZ;VeC8C&LS;G4naq&s{_)J!rSoX@%Hz7{Sa{#phy%P z-DCaL4}wi=2u5KAjxO$6bvYEEU%8~ScX`xo4Si1Jh6hi+S)M(>>kx1SKnXpd5bWTC z`X(#<zgIdxVnLw}-UvJT_IOu)Vu&g$If(%VT;<L)+-aHW@<8<LJrKLw1QT#pF5Fw& zcl24zBvchE#ZpwmM%Ai9>^Yv^;X_dI6bMM&fAqrxc-3ApTslzP0rD-r_&kecO5$Gw z)fhF90)A5MFm65xcD&1q@Gry-n6-b6S5E#+4flMxno9we)N5k?ddS}oaJLCE1m<PM t<*K%ZYUNV^ClYWAo*T1?*DFfZWvA{M8D=Njui(Ejt+TDS6+sJk`VZG>JHG$` literal 0 HcmV?d00001 diff --git a/apps/roi-cacl-2/src/swagger/logo-amplication-white.svg b/apps/roi-cacl-2/src/swagger/logo-amplication-white.svg new file mode 100644 index 0000000..0054cd4 --- /dev/null +++ b/apps/roi-cacl-2/src/swagger/logo-amplication-white.svg @@ -0,0 +1,15 @@ +<svg width="206" height="45" viewBox="0 0 206 45" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M0 22.472C0 34.0994 8.90877 43.6025 20.3874 44.9441V0C8.90877 1.34161 0 10.9006 0 22.472Z" fill="white"/> +<path d="M46.2574 22.472C46.2574 10.8447 37.2344 1.22981 25.6987 0V45H46.2574V23.1429C46.2574 22.9193 46.2574 22.6957 46.2574 22.472Z" fill="white"/> +<path d="M70.8698 26.2732V38.8508H67.6718V37.1738C66.8152 38.5154 64.9877 39.1303 63.3887 39.1303C60.0194 39.1303 57.0498 36.5589 57.0498 32.534C57.0498 28.5092 59.9623 25.9937 63.3887 25.9937C64.9877 25.9937 66.8152 26.6086 67.6718 27.9502V26.2732H70.8698ZM67.6147 32.534C67.6147 30.298 65.7301 28.9005 63.9027 28.9005C61.9039 28.9005 60.3049 30.4098 60.3049 32.534C60.3049 34.6583 61.9039 36.2235 63.9027 36.2235C65.8444 36.2235 67.6147 34.7701 67.6147 32.534Z" fill="white"/> +<path d="M95.14 31.8074V38.8509H91.942V32.031C91.942 30.0186 90.857 29.0124 89.3722 29.0124C87.5447 29.0124 86.3455 30.354 86.5168 32.6459V32.5341V38.8509H83.3188V32.031C83.3188 30.0186 82.2337 29.0124 80.8632 29.0124C79.3784 29.0124 77.8936 29.795 77.8936 32.1987V38.8509H74.6956V26.2733H77.8936V28.4534C78.3504 26.8882 80.1208 26.0497 81.7198 26.0497C83.6043 26.0497 85.1462 26.8882 85.8886 28.5093C86.9166 26.4969 88.9153 26.0497 90.2288 26.0497C93.4268 25.9938 95.14 28.118 95.14 31.8074Z" fill="white"/> +<path d="M112.614 32.534C112.614 36.5589 109.702 39.0744 106.276 39.0744C104.677 39.0744 102.849 38.4595 101.992 37.1179V44.944H98.7944V26.2732H101.992V27.9502C102.849 26.6086 104.734 25.9937 106.276 25.9937C109.645 25.9937 112.614 28.5651 112.614 32.534ZM109.416 32.5899C109.416 30.4657 107.76 28.9005 105.762 28.9005C103.82 28.9005 102.05 30.3539 102.05 32.5899C102.05 34.8259 103.934 36.2235 105.762 36.2235C107.76 36.2235 109.416 34.7141 109.416 32.5899Z" fill="white"/> +<path d="M115.642 19.5092H118.84V38.8508H115.642V19.5092Z" fill="white"/> +<path d="M122.152 21.8006C122.152 20.6826 123.123 19.9 124.265 19.9C125.407 19.9 126.321 20.6826 126.321 21.8006C126.321 22.8628 125.407 23.7013 124.265 23.7013C123.123 23.7572 122.152 22.9187 122.152 21.8006ZM122.609 26.2727H125.807V38.8503H122.609V26.2727Z" fill="white"/> +<path d="M128.834 32.534C128.834 28.5651 132.09 25.9937 135.859 25.9937C138.086 25.9937 139.913 26.944 141.113 28.3974L138.828 30.1303C138.143 29.3477 137.058 28.8446 135.916 28.8446C133.689 28.8446 132.09 30.3539 132.09 32.4781C132.09 34.6024 133.689 36.1117 135.916 36.1117C137.058 36.1117 138.143 35.6086 138.828 34.826L141.113 36.5589C139.913 38.0123 138.086 38.9626 135.859 38.9626C132.09 39.1303 128.834 36.5589 128.834 32.534Z" fill="white"/> +<path d="M156.589 26.2732V38.8508H153.391V37.1738C152.534 38.5154 150.707 39.1303 149.107 39.1303C145.738 39.1303 142.769 36.5589 142.769 32.534C142.769 28.5092 145.681 25.9937 149.107 25.9937C150.707 25.9937 152.534 26.6086 153.391 27.9502V26.2732H156.589ZM153.333 32.534C153.333 30.298 151.449 28.9005 149.621 28.9005C147.623 28.9005 146.024 30.4098 146.024 32.534C146.024 34.6583 147.623 36.2235 149.621 36.2235C151.563 36.2235 153.333 34.7701 153.333 32.534Z" fill="white"/> +<path d="M167.496 28.7891H164.755V38.9071H161.556V28.7891H159.215V26.2735H161.556V21.6338H164.755V26.2735H167.496V28.7891Z" fill="white"/> +<path d="M169.438 21.8006C169.438 20.6826 170.409 19.9 171.551 19.9C172.693 19.9 173.607 20.6826 173.607 21.8006C173.607 22.8628 172.693 23.7013 171.551 23.7013C170.409 23.7572 169.438 22.9187 169.438 21.8006ZM169.952 26.2727H173.15V38.8503H169.952V26.2727Z" fill="white"/> +<path d="M176.12 32.534C176.12 28.5651 179.318 25.9937 182.973 25.9937C186.627 25.9937 189.825 28.5092 189.825 32.534C189.825 36.503 186.627 39.1303 182.973 39.1303C179.318 39.1303 176.12 36.503 176.12 32.534ZM186.627 32.534C186.627 30.3539 184.971 28.9005 182.973 28.9005C180.974 28.9005 179.375 30.3539 179.375 32.534C179.375 34.7701 180.974 36.2235 182.973 36.2235C184.971 36.2235 186.627 34.7701 186.627 32.534Z" fill="white"/> +<path d="M205.187 31.8073V38.8508H201.989V32.0868C201.989 30.0744 200.733 29.0682 199.305 29.0682C197.82 29.0682 196.05 29.8508 196.05 32.2545V38.8508H192.852V26.2732H196.05V28.2856C196.735 26.7204 198.734 25.9937 200.047 25.9937C203.36 25.9937 205.187 28.1179 205.187 31.8073Z" fill="white"/> +</svg> diff --git a/apps/roi-cacl-2/src/swagger/swagger.css b/apps/roi-cacl-2/src/swagger/swagger.css new file mode 100644 index 0000000..b7c4037 --- /dev/null +++ b/apps/roi-cacl-2/src/swagger/swagger.css @@ -0,0 +1,321 @@ +html, +body { + background-color: #f4f4f7; +} + +body { + margin: auto; + line-height: 1.6; + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + color: #121242; +} + +.swagger-ui { + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; +} + +.swagger-ui button, +.swagger-ui input, +.swagger-ui optgroup, +.swagger-ui select, +.swagger-ui textarea, +.swagger-ui .parameter__name, +.swagger-ui .parameters-col_name > *, +.swagger-ui label { + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + font-weight: normal; + font-size: 12px; + outline: none; +} + +.swagger-ui textarea { + border: 1px solid #d0d0d9; + min-height: 100px; +} + +.swagger-ui input[type="email"], +.swagger-ui input[type="file"], +.swagger-ui input[type="password"], +.swagger-ui input[type="search"], +.swagger-ui input[type="text"], +.swagger-ui textarea { + border-radius: 3px; +} + +.swagger-ui input[disabled], +.swagger-ui select[disabled], +.swagger-ui textarea[disabled] { + background: #f4f4f7; + color: #b8b8c6; +} + +.swagger-ui .btn { + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + font-weight: 500; + box-shadow: none; + border: 1px solid #d0d0d9; + height: 28px; + border-radius: 14px; + background-color: #fff; + color: #7950ed; +} + +.swagger-ui .btn:hover { + box-shadow: none; +} + +/* topbar */ + +.swagger-ui .topbar { + background-color: #7950ed; + height: 80px; + padding: 0; + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; +} + +.swagger-ui .topbar-wrapper a { + display: block; + width: 206px; + height: 35px; + background-image: url("logo-amplication-white.svg"); + background-repeat: no-repeat; + background-size: contain; +} + +.swagger-ui .topbar-wrapper svg, +.swagger-ui .topbar-wrapper img { + display: none; +} + +/* title */ +.swagger-ui .info { + margin: 0; +} + +.swagger-ui .info .title { + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + font-size: 32px; + font-weight: 600; +} + +.swagger-ui .information-container { + padding-top: 50px; + padding-bottom: 20px; + position: relative; +} + +.swagger-ui .info .title small.version-stamp { + display: none; +} + +.swagger-ui .info .title small { + background-color: #a787ff; +} + +.swagger-ui .info .description p { + max-width: 1000px; + margin: 0; +} + +.swagger-ui .info .description p, +.swagger-ui .info .description a { + font-size: 1rem; +} + +.swagger-ui .information-container section { + position: relative; +} + +.swagger-ui .scheme-container { + box-shadow: none; + background-color: transparent; + position: relative; + margin: 0; + margin-top: 20px; + margin-bottom: 20px; + padding: 0; +} + +.swagger-ui .scheme-container .auth-wrapper { + justify-content: flex-start; +} + +.swagger-ui .btn.authorize { + box-shadow: none; + border: 1px solid #d0d0d9; + height: 40px; + border-radius: 20px; + background-color: #fff; + color: #7950ed; +} + +.swagger-ui .btn.authorize svg { + fill: #7950ed; +} + +/* content */ + +.swagger-ui .opblock-tag { + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + font-size: 28px; + font-weight: 600; +} + +.swagger-ui .opblock.is-open .opblock-summary { + border-color: #e7e7ec !important; + border-bottom: none; +} + +.swagger-ui .opblock .opblock-section-header { + background-color: #fff; + border: none; + border-top: 1px solid #e7e7ec; + border-bottom: 1px solid #e7e7ec; + box-shadow: none; +} + +.swagger-ui .opblock .tab-header .tab-item.active h4 span:after { + display: none; +} + +.swagger-ui .opblock.opblock-post { + border: 1px solid #e7e7ec; + background: #f9f9fa; + box-shadow: none; + color: #fff; +} + +.swagger-ui .opblock.opblock-post:hover, +.swagger-ui .opblock.opblock-post.is-open { + border-color: #31c587; +} + +.swagger-ui .opblock.opblock-post .opblock-summary-method { + background-color: #31c587; +} + +.swagger-ui .opblock.opblock-get { + border: 1px solid #e7e7ec; + background: #f9f9fa; + box-shadow: none; +} +.swagger-ui .opblock.opblock-get:hover, +.swagger-ui .opblock.opblock-get.is-open { + border-color: #20a4f3; +} +.swagger-ui .opblock.opblock-get .opblock-summary-method { + background-color: #20a4f3; +} + +.swagger-ui .opblock.opblock-delete { + border: 1px solid #e7e7ec; + background: #f9f9fa; + box-shadow: none; +} +.swagger-ui .opblock.opblock-delete:hover, +.swagger-ui .opblock.opblock-delete.is-open { + border-color: #e93c51; +} +.swagger-ui .opblock.opblock-delete .opblock-summary-method { + background-color: #e93c51; +} + +.swagger-ui .opblock.opblock-patch { + border: 1px solid #e7e7ec; + background: #f9f9fa; + box-shadow: none; +} +.swagger-ui .opblock.opblock-patch:hover, +.swagger-ui .opblock.opblock-patch.is-open { + border-color: #41cadd; +} +.swagger-ui .opblock.opblock-patch .opblock-summary-method { + background-color: #41cadd; +} + +.swagger-ui .opblock-body pre { + background-color: #121242 !important; +} + +.swagger-ui select, +.swagger-ui .response-control-media-type--accept-controller select { + border: 1px solid #d0d0d9; + box-shadow: none; + outline: none; +} + +/* models */ + +.swagger-ui section.models { + background-color: #fff; + border: 1px solid #e7e7ec; +} + +.swagger-ui section.models.is-open h4 { + border-bottom: 1px solid #e7e7ec; +} + +.swagger-ui section.models .model-container, +.swagger-ui section.models .model-container:hover { + background-color: #f4f4f7; + color: #121242; +} + +.swagger-ui .model-title { + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + font-weight: normal; + font-size: 15px; + color: #121242; +} + +/* modal */ + +.swagger-ui .dialog-ux .modal-ux-header h3, +.swagger-ui .dialog-ux .modal-ux-content h4, +.swagger-ui .dialog-ux .modal-ux-content h4 code { + font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", + "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + font-weight: normal; + font-size: 15px; + color: #121242; +} + +.swagger-ui .dialog-ux .modal-ux-content .btn.authorize { + height: 28px; + border-radius: 14px; +} + +.swagger-ui .auth-btn-wrapper { + display: flex; + flex-direction: row-reverse; + align-items: center; + justify-content: flex-start; +} + +.swagger-ui .auth-btn-wrapper .btn-done { + border: none; + color: #121242; + margin-right: 0; +} + +.swagger-ui .authorization__btn { + fill: #414168; +} diff --git a/apps/roi-cacl-2/src/team/base/CreateTeamArgs.ts b/apps/roi-cacl-2/src/team/base/CreateTeamArgs.ts new file mode 100644 index 0000000..6902144 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/CreateTeamArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { TeamCreateInput } from "./TeamCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateTeamArgs { + @ApiProperty({ + required: true, + type: () => TeamCreateInput, + }) + @ValidateNested() + @Type(() => TeamCreateInput) + @Field(() => TeamCreateInput, { nullable: false }) + data!: TeamCreateInput; +} + +export { CreateTeamArgs as CreateTeamArgs }; diff --git a/apps/roi-cacl-2/src/team/base/DeleteTeamArgs.ts b/apps/roi-cacl-2/src/team/base/DeleteTeamArgs.ts new file mode 100644 index 0000000..92997a0 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/DeleteTeamArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { TeamWhereUniqueInput } from "./TeamWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteTeamArgs { + @ApiProperty({ + required: true, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @Field(() => TeamWhereUniqueInput, { nullable: false }) + where!: TeamWhereUniqueInput; +} + +export { DeleteTeamArgs as DeleteTeamArgs }; diff --git a/apps/roi-cacl-2/src/team/base/EventTypeCreateNestedManyWithoutTeamsInput.ts b/apps/roi-cacl-2/src/team/base/EventTypeCreateNestedManyWithoutTeamsInput.ts new file mode 100644 index 0000000..8ac73e4 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/EventTypeCreateNestedManyWithoutTeamsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeCreateNestedManyWithoutTeamsInput { + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + connect?: Array<EventTypeWhereUniqueInput>; +} + +export { EventTypeCreateNestedManyWithoutTeamsInput as EventTypeCreateNestedManyWithoutTeamsInput }; diff --git a/apps/roi-cacl-2/src/team/base/EventTypeUpdateManyWithoutTeamsInput.ts b/apps/roi-cacl-2/src/team/base/EventTypeUpdateManyWithoutTeamsInput.ts new file mode 100644 index 0000000..0e83c92 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/EventTypeUpdateManyWithoutTeamsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeUpdateManyWithoutTeamsInput { + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + connect?: Array<EventTypeWhereUniqueInput>; + + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + disconnect?: Array<EventTypeWhereUniqueInput>; + + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + set?: Array<EventTypeWhereUniqueInput>; +} + +export { EventTypeUpdateManyWithoutTeamsInput as EventTypeUpdateManyWithoutTeamsInput }; diff --git a/apps/roi-cacl-2/src/team/base/MembershipCreateNestedManyWithoutTeamsInput.ts b/apps/roi-cacl-2/src/team/base/MembershipCreateNestedManyWithoutTeamsInput.ts new file mode 100644 index 0000000..0f3e3e6 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/MembershipCreateNestedManyWithoutTeamsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { MembershipWhereUniqueInput } from "../../membership/base/MembershipWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class MembershipCreateNestedManyWithoutTeamsInput { + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + connect?: Array<MembershipWhereUniqueInput>; +} + +export { MembershipCreateNestedManyWithoutTeamsInput as MembershipCreateNestedManyWithoutTeamsInput }; diff --git a/apps/roi-cacl-2/src/team/base/MembershipUpdateManyWithoutTeamsInput.ts b/apps/roi-cacl-2/src/team/base/MembershipUpdateManyWithoutTeamsInput.ts new file mode 100644 index 0000000..305ed18 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/MembershipUpdateManyWithoutTeamsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { MembershipWhereUniqueInput } from "../../membership/base/MembershipWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class MembershipUpdateManyWithoutTeamsInput { + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + connect?: Array<MembershipWhereUniqueInput>; + + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + disconnect?: Array<MembershipWhereUniqueInput>; + + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + set?: Array<MembershipWhereUniqueInput>; +} + +export { MembershipUpdateManyWithoutTeamsInput as MembershipUpdateManyWithoutTeamsInput }; diff --git a/apps/roi-cacl-2/src/team/base/Team.ts b/apps/roi-cacl-2/src/team/base/Team.ts new file mode 100644 index 0000000..1aadeb8 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/Team.ts @@ -0,0 +1,106 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsString, + IsOptional, + IsBoolean, + ValidateNested, +} from "class-validator"; +import { EventType } from "../../eventType/base/EventType"; +import { Type } from "class-transformer"; +import { Membership } from "../../membership/base/Membership"; + +@ObjectType() +class Team { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + slug!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + logo!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + bio!: string | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hideBranding!: boolean; + + @ApiProperty({ + required: false, + type: () => [EventType], + }) + @ValidateNested() + @Type(() => EventType) + @IsOptional() + eventTypes?: Array<EventType>; + + @ApiProperty({ + required: false, + type: () => [Membership], + }) + @ValidateNested() + @Type(() => Membership) + @IsOptional() + members?: Array<Membership>; +} + +export { Team as Team }; diff --git a/apps/roi-cacl-2/src/team/base/TeamCountArgs.ts b/apps/roi-cacl-2/src/team/base/TeamCountArgs.ts new file mode 100644 index 0000000..67dd572 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { TeamWhereInput } from "./TeamWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class TeamCountArgs { + @ApiProperty({ + required: false, + type: () => TeamWhereInput, + }) + @Field(() => TeamWhereInput, { nullable: true }) + @Type(() => TeamWhereInput) + where?: TeamWhereInput; +} + +export { TeamCountArgs as TeamCountArgs }; diff --git a/apps/roi-cacl-2/src/team/base/TeamCreateInput.ts b/apps/roi-cacl-2/src/team/base/TeamCreateInput.ts new file mode 100644 index 0000000..bb1e079 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamCreateInput.ts @@ -0,0 +1,103 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsBoolean, + ValidateNested, +} from "class-validator"; +import { EventTypeCreateNestedManyWithoutTeamsInput } from "./EventTypeCreateNestedManyWithoutTeamsInput"; +import { Type } from "class-transformer"; +import { MembershipCreateNestedManyWithoutTeamsInput } from "./MembershipCreateNestedManyWithoutTeamsInput"; + +@InputType() +class TeamCreateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + slug?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + logo?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + bio?: string | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hideBranding!: boolean; + + @ApiProperty({ + required: false, + type: () => EventTypeCreateNestedManyWithoutTeamsInput, + }) + @ValidateNested() + @Type(() => EventTypeCreateNestedManyWithoutTeamsInput) + @IsOptional() + @Field(() => EventTypeCreateNestedManyWithoutTeamsInput, { + nullable: true, + }) + eventTypes?: EventTypeCreateNestedManyWithoutTeamsInput; + + @ApiProperty({ + required: false, + type: () => MembershipCreateNestedManyWithoutTeamsInput, + }) + @ValidateNested() + @Type(() => MembershipCreateNestedManyWithoutTeamsInput) + @IsOptional() + @Field(() => MembershipCreateNestedManyWithoutTeamsInput, { + nullable: true, + }) + members?: MembershipCreateNestedManyWithoutTeamsInput; +} + +export { TeamCreateInput as TeamCreateInput }; diff --git a/apps/roi-cacl-2/src/team/base/TeamFindManyArgs.ts b/apps/roi-cacl-2/src/team/base/TeamFindManyArgs.ts new file mode 100644 index 0000000..5058344 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { TeamWhereInput } from "./TeamWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { TeamOrderByInput } from "./TeamOrderByInput"; + +@ArgsType() +class TeamFindManyArgs { + @ApiProperty({ + required: false, + type: () => TeamWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => TeamWhereInput, { nullable: true }) + @Type(() => TeamWhereInput) + where?: TeamWhereInput; + + @ApiProperty({ + required: false, + type: [TeamOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [TeamOrderByInput], { nullable: true }) + @Type(() => TeamOrderByInput) + orderBy?: Array<TeamOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { TeamFindManyArgs as TeamFindManyArgs }; diff --git a/apps/roi-cacl-2/src/team/base/TeamFindUniqueArgs.ts b/apps/roi-cacl-2/src/team/base/TeamFindUniqueArgs.ts new file mode 100644 index 0000000..042f3d7 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { TeamWhereUniqueInput } from "./TeamWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class TeamFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @Field(() => TeamWhereUniqueInput, { nullable: false }) + where!: TeamWhereUniqueInput; +} + +export { TeamFindUniqueArgs as TeamFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/team/base/TeamListRelationFilter.ts b/apps/roi-cacl-2/src/team/base/TeamListRelationFilter.ts new file mode 100644 index 0000000..8ea41ce --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { TeamWhereInput } from "./TeamWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class TeamListRelationFilter { + @ApiProperty({ + required: false, + type: () => TeamWhereInput, + }) + @ValidateNested() + @Type(() => TeamWhereInput) + @IsOptional() + @Field(() => TeamWhereInput, { + nullable: true, + }) + every?: TeamWhereInput; + + @ApiProperty({ + required: false, + type: () => TeamWhereInput, + }) + @ValidateNested() + @Type(() => TeamWhereInput) + @IsOptional() + @Field(() => TeamWhereInput, { + nullable: true, + }) + some?: TeamWhereInput; + + @ApiProperty({ + required: false, + type: () => TeamWhereInput, + }) + @ValidateNested() + @Type(() => TeamWhereInput) + @IsOptional() + @Field(() => TeamWhereInput, { + nullable: true, + }) + none?: TeamWhereInput; +} +export { TeamListRelationFilter as TeamListRelationFilter }; diff --git a/apps/roi-cacl-2/src/team/base/TeamOrderByInput.ts b/apps/roi-cacl-2/src/team/base/TeamOrderByInput.ts new file mode 100644 index 0000000..86fb41f --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamOrderByInput.ts @@ -0,0 +1,89 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class TeamOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + name?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + slug?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + logo?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bio?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + hideBranding?: SortOrder; +} + +export { TeamOrderByInput as TeamOrderByInput }; diff --git a/apps/roi-cacl-2/src/team/base/TeamUpdateInput.ts b/apps/roi-cacl-2/src/team/base/TeamUpdateInput.ts new file mode 100644 index 0000000..fbf43b2 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamUpdateInput.ts @@ -0,0 +1,106 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsBoolean, + ValidateNested, +} from "class-validator"; +import { EventTypeUpdateManyWithoutTeamsInput } from "./EventTypeUpdateManyWithoutTeamsInput"; +import { Type } from "class-transformer"; +import { MembershipUpdateManyWithoutTeamsInput } from "./MembershipUpdateManyWithoutTeamsInput"; + +@InputType() +class TeamUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + slug?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + logo?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + bio?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + hideBranding?: boolean; + + @ApiProperty({ + required: false, + type: () => EventTypeUpdateManyWithoutTeamsInput, + }) + @ValidateNested() + @Type(() => EventTypeUpdateManyWithoutTeamsInput) + @IsOptional() + @Field(() => EventTypeUpdateManyWithoutTeamsInput, { + nullable: true, + }) + eventTypes?: EventTypeUpdateManyWithoutTeamsInput; + + @ApiProperty({ + required: false, + type: () => MembershipUpdateManyWithoutTeamsInput, + }) + @ValidateNested() + @Type(() => MembershipUpdateManyWithoutTeamsInput) + @IsOptional() + @Field(() => MembershipUpdateManyWithoutTeamsInput, { + nullable: true, + }) + members?: MembershipUpdateManyWithoutTeamsInput; +} + +export { TeamUpdateInput as TeamUpdateInput }; diff --git a/apps/roi-cacl-2/src/team/base/TeamWhereInput.ts b/apps/roi-cacl-2/src/team/base/TeamWhereInput.ts new file mode 100644 index 0000000..68a5553 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamWhereInput.ts @@ -0,0 +1,115 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { EventTypeListRelationFilter } from "../../eventType/base/EventTypeListRelationFilter"; +import { MembershipListRelationFilter } from "../../membership/base/MembershipListRelationFilter"; + +@InputType() +class TeamWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + name?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + slug?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + logo?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + bio?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + hideBranding?: BooleanFilter; + + @ApiProperty({ + required: false, + type: () => EventTypeListRelationFilter, + }) + @ValidateNested() + @Type(() => EventTypeListRelationFilter) + @IsOptional() + @Field(() => EventTypeListRelationFilter, { + nullable: true, + }) + eventTypes?: EventTypeListRelationFilter; + + @ApiProperty({ + required: false, + type: () => MembershipListRelationFilter, + }) + @ValidateNested() + @Type(() => MembershipListRelationFilter) + @IsOptional() + @Field(() => MembershipListRelationFilter, { + nullable: true, + }) + members?: MembershipListRelationFilter; +} + +export { TeamWhereInput as TeamWhereInput }; diff --git a/apps/roi-cacl-2/src/team/base/TeamWhereUniqueInput.ts b/apps/roi-cacl-2/src/team/base/TeamWhereUniqueInput.ts new file mode 100644 index 0000000..f400535 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/TeamWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class TeamWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { TeamWhereUniqueInput as TeamWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/team/base/UpdateTeamArgs.ts b/apps/roi-cacl-2/src/team/base/UpdateTeamArgs.ts new file mode 100644 index 0000000..34ccee8 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/UpdateTeamArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { TeamWhereUniqueInput } from "./TeamWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { TeamUpdateInput } from "./TeamUpdateInput"; + +@ArgsType() +class UpdateTeamArgs { + @ApiProperty({ + required: true, + type: () => TeamWhereUniqueInput, + }) + @ValidateNested() + @Type(() => TeamWhereUniqueInput) + @Field(() => TeamWhereUniqueInput, { nullable: false }) + where!: TeamWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => TeamUpdateInput, + }) + @ValidateNested() + @Type(() => TeamUpdateInput) + @Field(() => TeamUpdateInput, { nullable: false }) + data!: TeamUpdateInput; +} + +export { UpdateTeamArgs as UpdateTeamArgs }; diff --git a/apps/roi-cacl-2/src/team/base/team.controller.base.spec.ts b/apps/roi-cacl-2/src/team/base/team.controller.base.spec.ts new file mode 100644 index 0000000..a1537ef --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/team.controller.base.spec.ts @@ -0,0 +1,184 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { TeamController } from "../team.controller"; +import { TeamService } from "../team.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + name: "exampleName", + slug: "exampleSlug", + logo: "exampleLogo", + bio: "exampleBio", + hideBranding: "true", +}; +const CREATE_RESULT = { + id: 42, + name: "exampleName", + slug: "exampleSlug", + logo: "exampleLogo", + bio: "exampleBio", + hideBranding: "true", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + name: "exampleName", + slug: "exampleSlug", + logo: "exampleLogo", + bio: "exampleBio", + hideBranding: "true", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + name: "exampleName", + slug: "exampleSlug", + logo: "exampleLogo", + bio: "exampleBio", + hideBranding: "true", +}; + +const service = { + createTeam() { + return CREATE_RESULT; + }, + teams: () => FIND_MANY_RESULT, + team: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Team", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: TeamService, + useValue: service, + }, + ], + controllers: [TeamController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /teams", async () => { + await request(app.getHttpServer()) + .post("/teams") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /teams", async () => { + await request(app.getHttpServer()) + .get("/teams") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /teams/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/teams"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /teams/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/teams"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /teams existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/teams") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/teams") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/team/base/team.controller.base.ts b/apps/roi-cacl-2/src/team/base/team.controller.base.ts new file mode 100644 index 0000000..e05a19f --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/team.controller.base.ts @@ -0,0 +1,363 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { TeamService } from "../team.service"; +import { TeamCreateInput } from "./TeamCreateInput"; +import { Team } from "./Team"; +import { TeamFindManyArgs } from "./TeamFindManyArgs"; +import { TeamWhereUniqueInput } from "./TeamWhereUniqueInput"; +import { TeamUpdateInput } from "./TeamUpdateInput"; +import { EventTypeFindManyArgs } from "../../eventType/base/EventTypeFindManyArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { MembershipFindManyArgs } from "../../membership/base/MembershipFindManyArgs"; +import { Membership } from "../../membership/base/Membership"; +import { MembershipWhereUniqueInput } from "../../membership/base/MembershipWhereUniqueInput"; + +export class TeamControllerBase { + constructor(protected readonly service: TeamService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Team }) + async createTeam(@common.Body() data: TeamCreateInput): Promise<Team> { + return await this.service.createTeam({ + data: data, + select: { + id: true, + name: true, + slug: true, + logo: true, + bio: true, + hideBranding: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Team] }) + @ApiNestedQuery(TeamFindManyArgs) + async teams(@common.Req() request: Request): Promise<Team[]> { + const args = plainToClass(TeamFindManyArgs, request.query); + return this.service.teams({ + ...args, + select: { + id: true, + name: true, + slug: true, + logo: true, + bio: true, + hideBranding: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Team }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async team( + @common.Param() params: TeamWhereUniqueInput + ): Promise<Team | null> { + const result = await this.service.team({ + where: params, + select: { + id: true, + name: true, + slug: true, + logo: true, + bio: true, + hideBranding: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Team }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateTeam( + @common.Param() params: TeamWhereUniqueInput, + @common.Body() data: TeamUpdateInput + ): Promise<Team | null> { + try { + return await this.service.updateTeam({ + where: params, + data: data, + select: { + id: true, + name: true, + slug: true, + logo: true, + bio: true, + hideBranding: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Team }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteTeam( + @common.Param() params: TeamWhereUniqueInput + ): Promise<Team | null> { + try { + return await this.service.deleteTeam({ + where: params, + select: { + id: true, + name: true, + slug: true, + logo: true, + bio: true, + hideBranding: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/eventTypes") + @ApiNestedQuery(EventTypeFindManyArgs) + async findEventTypes( + @common.Req() request: Request, + @common.Param() params: TeamWhereUniqueInput + ): Promise<EventType[]> { + const query = plainToClass(EventTypeFindManyArgs, request.query); + const results = await this.service.findEventTypes(params.id, { + ...query, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/eventTypes") + async connectEventTypes( + @common.Param() params: TeamWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventTypes: { + connect: body, + }, + }; + await this.service.updateTeam({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/eventTypes") + async updateEventTypes( + @common.Param() params: TeamWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventTypes: { + set: body, + }, + }; + await this.service.updateTeam({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/eventTypes") + async disconnectEventTypes( + @common.Param() params: TeamWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventTypes: { + disconnect: body, + }, + }; + await this.service.updateTeam({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/members") + @ApiNestedQuery(MembershipFindManyArgs) + async findMembers( + @common.Req() request: Request, + @common.Param() params: TeamWhereUniqueInput + ): Promise<Membership[]> { + const query = plainToClass(MembershipFindManyArgs, request.query); + const results = await this.service.findMembers(params.id, { + ...query, + select: { + id: true, + accepted: true, + role: true, + + team: { + select: { + id: true, + }, + }, + + user: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/members") + async connectMembers( + @common.Param() params: TeamWhereUniqueInput, + @common.Body() body: MembershipWhereUniqueInput[] + ): Promise<void> { + const data = { + members: { + connect: body, + }, + }; + await this.service.updateTeam({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/members") + async updateMembers( + @common.Param() params: TeamWhereUniqueInput, + @common.Body() body: MembershipWhereUniqueInput[] + ): Promise<void> { + const data = { + members: { + set: body, + }, + }; + await this.service.updateTeam({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/members") + async disconnectMembers( + @common.Param() params: TeamWhereUniqueInput, + @common.Body() body: MembershipWhereUniqueInput[] + ): Promise<void> { + const data = { + members: { + disconnect: body, + }, + }; + await this.service.updateTeam({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/team/base/team.module.base.ts b/apps/roi-cacl-2/src/team/base/team.module.base.ts new file mode 100644 index 0000000..a35c690 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/team.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class TeamModuleBase {} diff --git a/apps/roi-cacl-2/src/team/base/team.resolver.base.ts b/apps/roi-cacl-2/src/team/base/team.resolver.base.ts new file mode 100644 index 0000000..2a682d4 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/team.resolver.base.ts @@ -0,0 +1,121 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Team } from "./Team"; +import { TeamCountArgs } from "./TeamCountArgs"; +import { TeamFindManyArgs } from "./TeamFindManyArgs"; +import { TeamFindUniqueArgs } from "./TeamFindUniqueArgs"; +import { CreateTeamArgs } from "./CreateTeamArgs"; +import { UpdateTeamArgs } from "./UpdateTeamArgs"; +import { DeleteTeamArgs } from "./DeleteTeamArgs"; +import { EventTypeFindManyArgs } from "../../eventType/base/EventTypeFindManyArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { MembershipFindManyArgs } from "../../membership/base/MembershipFindManyArgs"; +import { Membership } from "../../membership/base/Membership"; +import { TeamService } from "../team.service"; +@graphql.Resolver(() => Team) +export class TeamResolverBase { + constructor(protected readonly service: TeamService) {} + + async _teamsMeta( + @graphql.Args() args: TeamCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Team]) + async teams(@graphql.Args() args: TeamFindManyArgs): Promise<Team[]> { + return this.service.teams(args); + } + + @graphql.Query(() => Team, { nullable: true }) + async team(@graphql.Args() args: TeamFindUniqueArgs): Promise<Team | null> { + const result = await this.service.team(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Team) + async createTeam(@graphql.Args() args: CreateTeamArgs): Promise<Team> { + return await this.service.createTeam({ + ...args, + data: args.data, + }); + } + + @graphql.Mutation(() => Team) + async updateTeam(@graphql.Args() args: UpdateTeamArgs): Promise<Team | null> { + try { + return await this.service.updateTeam({ + ...args, + data: args.data, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Team) + async deleteTeam(@graphql.Args() args: DeleteTeamArgs): Promise<Team | null> { + try { + return await this.service.deleteTeam(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [EventType], { name: "eventTypes" }) + async findEventTypes( + @graphql.Parent() parent: Team, + @graphql.Args() args: EventTypeFindManyArgs + ): Promise<EventType[]> { + const results = await this.service.findEventTypes(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Membership], { name: "members" }) + async findMembers( + @graphql.Parent() parent: Team, + @graphql.Args() args: MembershipFindManyArgs + ): Promise<Membership[]> { + const results = await this.service.findMembers(parent.id, args); + + if (!results) { + return []; + } + + return results; + } +} diff --git a/apps/roi-cacl-2/src/team/base/team.service.base.ts b/apps/roi-cacl-2/src/team/base/team.service.base.ts new file mode 100644 index 0000000..4e42c95 --- /dev/null +++ b/apps/roi-cacl-2/src/team/base/team.service.base.ts @@ -0,0 +1,75 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Team as PrismaTeam, + EventType as PrismaEventType, + Membership as PrismaMembership, +} from "@prisma/client"; + +export class TeamServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.TeamCountArgs, "select">): Promise<number> { + return this.prisma.team.count(args); + } + + async teams<T extends Prisma.TeamFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.TeamFindManyArgs> + ): Promise<PrismaTeam[]> { + return this.prisma.team.findMany<Prisma.TeamFindManyArgs>(args); + } + async team<T extends Prisma.TeamFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.TeamFindUniqueArgs> + ): Promise<PrismaTeam | null> { + return this.prisma.team.findUnique(args); + } + async createTeam<T extends Prisma.TeamCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.TeamCreateArgs> + ): Promise<PrismaTeam> { + return this.prisma.team.create<T>(args); + } + async updateTeam<T extends Prisma.TeamUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.TeamUpdateArgs> + ): Promise<PrismaTeam> { + return this.prisma.team.update<T>(args); + } + async deleteTeam<T extends Prisma.TeamDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.TeamDeleteArgs> + ): Promise<PrismaTeam> { + return this.prisma.team.delete(args); + } + + async findEventTypes( + parentId: number, + args: Prisma.EventTypeFindManyArgs + ): Promise<PrismaEventType[]> { + return this.prisma.team + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .eventTypes(args); + } + + async findMembers( + parentId: number, + args: Prisma.MembershipFindManyArgs + ): Promise<PrismaMembership[]> { + return this.prisma.team + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .members(args); + } +} diff --git a/apps/roi-cacl-2/src/team/team.controller.ts b/apps/roi-cacl-2/src/team/team.controller.ts new file mode 100644 index 0000000..2c4f84f --- /dev/null +++ b/apps/roi-cacl-2/src/team/team.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { TeamService } from "./team.service"; +import { TeamControllerBase } from "./base/team.controller.base"; + +@swagger.ApiTags("teams") +@common.Controller("teams") +export class TeamController extends TeamControllerBase { + constructor(protected readonly service: TeamService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/team/team.module.ts b/apps/roi-cacl-2/src/team/team.module.ts new file mode 100644 index 0000000..bff75c3 --- /dev/null +++ b/apps/roi-cacl-2/src/team/team.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { TeamModuleBase } from "./base/team.module.base"; +import { TeamService } from "./team.service"; +import { TeamController } from "./team.controller"; +import { TeamResolver } from "./team.resolver"; + +@Module({ + imports: [TeamModuleBase], + controllers: [TeamController], + providers: [TeamService, TeamResolver], + exports: [TeamService], +}) +export class TeamModule {} diff --git a/apps/roi-cacl-2/src/team/team.resolver.ts b/apps/roi-cacl-2/src/team/team.resolver.ts new file mode 100644 index 0000000..aa3445d --- /dev/null +++ b/apps/roi-cacl-2/src/team/team.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { TeamResolverBase } from "./base/team.resolver.base"; +import { Team } from "./base/Team"; +import { TeamService } from "./team.service"; + +@graphql.Resolver(() => Team) +export class TeamResolver extends TeamResolverBase { + constructor(protected readonly service: TeamService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/team/team.service.ts b/apps/roi-cacl-2/src/team/team.service.ts new file mode 100644 index 0000000..e8910d0 --- /dev/null +++ b/apps/roi-cacl-2/src/team/team.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { TeamServiceBase } from "./base/team.service.base"; + +@Injectable() +export class TeamService extends TeamServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/tests/health/health.service.spec.ts b/apps/roi-cacl-2/src/tests/health/health.service.spec.ts new file mode 100644 index 0000000..4b191f1 --- /dev/null +++ b/apps/roi-cacl-2/src/tests/health/health.service.spec.ts @@ -0,0 +1,36 @@ +import { mock } from "jest-mock-extended"; +import { PrismaService } from "../../prisma/prisma.service"; +import { HealthServiceBase } from "../../health/base/health.service.base"; + +describe("Testing the HealthServiceBase", () => { + //ARRANGE + let prismaService: PrismaService; + let healthServiceBase: HealthServiceBase; + + describe("Testing the isDbReady function in HealthServiceBase class", () => { + beforeEach(() => { + prismaService = mock<PrismaService>(); + healthServiceBase = new HealthServiceBase(prismaService); + }); + it("should return true if allow connection to db", async () => { + //ARRANGE + (prismaService.$queryRaw as jest.Mock).mockReturnValue( + Promise.resolve(true) + ); + //ACT + const response = await healthServiceBase.isDbReady(); + //ASSERT + expect(response).toBe(true); + }); + it("should return false if db is not available", async () => { + //ARRANGE + (prismaService.$queryRaw as jest.Mock).mockReturnValue( + Promise.reject(false) + ); + //ACT + const response = await healthServiceBase.isDbReady(); + //ASSERT + expect(response).toBe(false); + }); + }); +}); diff --git a/apps/roi-cacl-2/src/types.ts b/apps/roi-cacl-2/src/types.ts new file mode 100644 index 0000000..f762a5d --- /dev/null +++ b/apps/roi-cacl-2/src/types.ts @@ -0,0 +1,3 @@ +import type { JsonValue } from "type-fest"; + +export type InputJsonValue = Omit<JsonValue, "null">; diff --git a/apps/roi-cacl-2/src/user/base/AccountCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/AccountCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..26be0e8 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/AccountCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AccountWhereUniqueInput } from "../../account/base/AccountWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AccountCreateNestedManyWithoutUsersInput { + @Field(() => [AccountWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AccountWhereUniqueInput], + }) + connect?: Array<AccountWhereUniqueInput>; +} + +export { AccountCreateNestedManyWithoutUsersInput as AccountCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/AccountUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/AccountUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..727b004 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/AccountUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AccountWhereUniqueInput } from "../../account/base/AccountWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AccountUpdateManyWithoutUsersInput { + @Field(() => [AccountWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AccountWhereUniqueInput], + }) + connect?: Array<AccountWhereUniqueInput>; + + @Field(() => [AccountWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AccountWhereUniqueInput], + }) + disconnect?: Array<AccountWhereUniqueInput>; + + @Field(() => [AccountWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AccountWhereUniqueInput], + }) + set?: Array<AccountWhereUniqueInput>; +} + +export { AccountUpdateManyWithoutUsersInput as AccountUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/ApiKeyCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/ApiKeyCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..6e7c000 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/ApiKeyCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiKeyWhereUniqueInput } from "../../apiKey/base/ApiKeyWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ApiKeyCreateNestedManyWithoutUsersInput { + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + connect?: Array<ApiKeyWhereUniqueInput>; +} + +export { ApiKeyCreateNestedManyWithoutUsersInput as ApiKeyCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/ApiKeyUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/ApiKeyUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..332f7f0 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/ApiKeyUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiKeyWhereUniqueInput } from "../../apiKey/base/ApiKeyWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ApiKeyUpdateManyWithoutUsersInput { + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + connect?: Array<ApiKeyWhereUniqueInput>; + + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + disconnect?: Array<ApiKeyWhereUniqueInput>; + + @Field(() => [ApiKeyWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ApiKeyWhereUniqueInput], + }) + set?: Array<ApiKeyWhereUniqueInput>; +} + +export { ApiKeyUpdateManyWithoutUsersInput as ApiKeyUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/AvailabilityCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/AvailabilityCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..c4e054c --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/AvailabilityCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AvailabilityCreateNestedManyWithoutUsersInput { + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + connect?: Array<AvailabilityWhereUniqueInput>; +} + +export { AvailabilityCreateNestedManyWithoutUsersInput as AvailabilityCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/AvailabilityUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/AvailabilityUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..c610d8f --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/AvailabilityUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class AvailabilityUpdateManyWithoutUsersInput { + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + connect?: Array<AvailabilityWhereUniqueInput>; + + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + disconnect?: Array<AvailabilityWhereUniqueInput>; + + @Field(() => [AvailabilityWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [AvailabilityWhereUniqueInput], + }) + set?: Array<AvailabilityWhereUniqueInput>; +} + +export { AvailabilityUpdateManyWithoutUsersInput as AvailabilityUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/BookingCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/BookingCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..41e2a25 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/BookingCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class BookingCreateNestedManyWithoutUsersInput { + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + connect?: Array<BookingWhereUniqueInput>; +} + +export { BookingCreateNestedManyWithoutUsersInput as BookingCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/BookingUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/BookingUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..e3f8a1f --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/BookingUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class BookingUpdateManyWithoutUsersInput { + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + connect?: Array<BookingWhereUniqueInput>; + + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + disconnect?: Array<BookingWhereUniqueInput>; + + @Field(() => [BookingWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [BookingWhereUniqueInput], + }) + set?: Array<BookingWhereUniqueInput>; +} + +export { BookingUpdateManyWithoutUsersInput as BookingUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/CreateUserArgs.ts b/apps/roi-cacl-2/src/user/base/CreateUserArgs.ts new file mode 100644 index 0000000..092a504 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/CreateUserArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserCreateInput } from "./UserCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateUserArgs { + @ApiProperty({ + required: true, + type: () => UserCreateInput, + }) + @ValidateNested() + @Type(() => UserCreateInput) + @Field(() => UserCreateInput, { nullable: false }) + data!: UserCreateInput; +} + +export { CreateUserArgs as CreateUserArgs }; diff --git a/apps/roi-cacl-2/src/user/base/CredentialCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/CredentialCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..7935ba6 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/CredentialCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class CredentialCreateNestedManyWithoutUsersInput { + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + connect?: Array<CredentialWhereUniqueInput>; +} + +export { CredentialCreateNestedManyWithoutUsersInput as CredentialCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/CredentialUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/CredentialUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..70a4f73 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/CredentialUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class CredentialUpdateManyWithoutUsersInput { + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + connect?: Array<CredentialWhereUniqueInput>; + + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + disconnect?: Array<CredentialWhereUniqueInput>; + + @Field(() => [CredentialWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [CredentialWhereUniqueInput], + }) + set?: Array<CredentialWhereUniqueInput>; +} + +export { CredentialUpdateManyWithoutUsersInput as CredentialUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/DeleteUserArgs.ts b/apps/roi-cacl-2/src/user/base/DeleteUserArgs.ts new file mode 100644 index 0000000..042ed5f --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/DeleteUserArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "./UserWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteUserArgs { + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput, { nullable: false }) + where!: UserWhereUniqueInput; +} + +export { DeleteUserArgs as DeleteUserArgs }; diff --git a/apps/roi-cacl-2/src/user/base/EnumUserIdentityProvider.ts b/apps/roi-cacl-2/src/user/base/EnumUserIdentityProvider.ts new file mode 100644 index 0000000..ee0713c --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/EnumUserIdentityProvider.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumUserIdentityProvider { + Cal = "CAL", + Google = "GOOGLE", + Saml = "SAML", +} + +registerEnumType(EnumUserIdentityProvider, { + name: "EnumUserIdentityProvider", +}); diff --git a/apps/roi-cacl-2/src/user/base/EnumUserPlan.ts b/apps/roi-cacl-2/src/user/base/EnumUserPlan.ts new file mode 100644 index 0000000..ea63ce5 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/EnumUserPlan.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumUserPlan { + Free = "FREE", + Trial = "TRIAL", + Pro = "PRO", +} + +registerEnumType(EnumUserPlan, { + name: "EnumUserPlan", +}); diff --git a/apps/roi-cacl-2/src/user/base/EnumUserRole.ts b/apps/roi-cacl-2/src/user/base/EnumUserRole.ts new file mode 100644 index 0000000..3320ef4 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/EnumUserRole.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { User } from "./User"; +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumUserRole { + User = "USER", + Admin = "ADMIN", +} + +registerEnumType(EnumUserRole, { + name: "EnumUserRole", +}); diff --git a/apps/roi-cacl-2/src/user/base/EventTypeCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/EventTypeCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..37c498f --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/EventTypeCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeCreateNestedManyWithoutUsersInput { + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + connect?: Array<EventTypeWhereUniqueInput>; +} + +export { EventTypeCreateNestedManyWithoutUsersInput as EventTypeCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/EventTypeUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/EventTypeUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..0358a85 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/EventTypeUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class EventTypeUpdateManyWithoutUsersInput { + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + connect?: Array<EventTypeWhereUniqueInput>; + + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + disconnect?: Array<EventTypeWhereUniqueInput>; + + @Field(() => [EventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [EventTypeWhereUniqueInput], + }) + set?: Array<EventTypeWhereUniqueInput>; +} + +export { EventTypeUpdateManyWithoutUsersInput as EventTypeUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/FeedbackCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/FeedbackCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..cdc1a17 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/FeedbackCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { FeedbackWhereUniqueInput } from "../../feedback/base/FeedbackWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class FeedbackCreateNestedManyWithoutUsersInput { + @Field(() => [FeedbackWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [FeedbackWhereUniqueInput], + }) + connect?: Array<FeedbackWhereUniqueInput>; +} + +export { FeedbackCreateNestedManyWithoutUsersInput as FeedbackCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/FeedbackUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/FeedbackUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..7407664 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/FeedbackUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { FeedbackWhereUniqueInput } from "../../feedback/base/FeedbackWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class FeedbackUpdateManyWithoutUsersInput { + @Field(() => [FeedbackWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [FeedbackWhereUniqueInput], + }) + connect?: Array<FeedbackWhereUniqueInput>; + + @Field(() => [FeedbackWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [FeedbackWhereUniqueInput], + }) + disconnect?: Array<FeedbackWhereUniqueInput>; + + @Field(() => [FeedbackWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [FeedbackWhereUniqueInput], + }) + set?: Array<FeedbackWhereUniqueInput>; +} + +export { FeedbackUpdateManyWithoutUsersInput as FeedbackUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/ImpersonationCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/ImpersonationCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..db476d3 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/ImpersonationCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ImpersonationWhereUniqueInput } from "../../impersonation/base/ImpersonationWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ImpersonationCreateNestedManyWithoutUsersInput { + @Field(() => [ImpersonationWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ImpersonationWhereUniqueInput], + }) + connect?: Array<ImpersonationWhereUniqueInput>; +} + +export { ImpersonationCreateNestedManyWithoutUsersInput as ImpersonationCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/ImpersonationUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/ImpersonationUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..7dd53c9 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/ImpersonationUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ImpersonationWhereUniqueInput } from "../../impersonation/base/ImpersonationWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ImpersonationUpdateManyWithoutUsersInput { + @Field(() => [ImpersonationWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ImpersonationWhereUniqueInput], + }) + connect?: Array<ImpersonationWhereUniqueInput>; + + @Field(() => [ImpersonationWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ImpersonationWhereUniqueInput], + }) + disconnect?: Array<ImpersonationWhereUniqueInput>; + + @Field(() => [ImpersonationWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ImpersonationWhereUniqueInput], + }) + set?: Array<ImpersonationWhereUniqueInput>; +} + +export { ImpersonationUpdateManyWithoutUsersInput as ImpersonationUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/MembershipCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/MembershipCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..7070b7e --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/MembershipCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { MembershipWhereUniqueInput } from "../../membership/base/MembershipWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class MembershipCreateNestedManyWithoutUsersInput { + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + connect?: Array<MembershipWhereUniqueInput>; +} + +export { MembershipCreateNestedManyWithoutUsersInput as MembershipCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/MembershipUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/MembershipUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..b9c82a5 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/MembershipUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { MembershipWhereUniqueInput } from "../../membership/base/MembershipWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class MembershipUpdateManyWithoutUsersInput { + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + connect?: Array<MembershipWhereUniqueInput>; + + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + disconnect?: Array<MembershipWhereUniqueInput>; + + @Field(() => [MembershipWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [MembershipWhereUniqueInput], + }) + set?: Array<MembershipWhereUniqueInput>; +} + +export { MembershipUpdateManyWithoutUsersInput as MembershipUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/ScheduleCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/ScheduleCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..4c2a127 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/ScheduleCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ScheduleCreateNestedManyWithoutUsersInput { + @Field(() => [ScheduleWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ScheduleWhereUniqueInput], + }) + connect?: Array<ScheduleWhereUniqueInput>; +} + +export { ScheduleCreateNestedManyWithoutUsersInput as ScheduleCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/ScheduleUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/ScheduleUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..fec4f82 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/ScheduleUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class ScheduleUpdateManyWithoutUsersInput { + @Field(() => [ScheduleWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ScheduleWhereUniqueInput], + }) + connect?: Array<ScheduleWhereUniqueInput>; + + @Field(() => [ScheduleWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ScheduleWhereUniqueInput], + }) + disconnect?: Array<ScheduleWhereUniqueInput>; + + @Field(() => [ScheduleWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [ScheduleWhereUniqueInput], + }) + set?: Array<ScheduleWhereUniqueInput>; +} + +export { ScheduleUpdateManyWithoutUsersInput as ScheduleUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/SelectedCalendarCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/SelectedCalendarCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..45844fc --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/SelectedCalendarCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { SelectedCalendarWhereUniqueInput } from "../../selectedCalendar/base/SelectedCalendarWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class SelectedCalendarCreateNestedManyWithoutUsersInput { + @Field(() => [SelectedCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SelectedCalendarWhereUniqueInput], + }) + connect?: Array<SelectedCalendarWhereUniqueInput>; +} + +export { SelectedCalendarCreateNestedManyWithoutUsersInput as SelectedCalendarCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/SelectedCalendarUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/SelectedCalendarUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..96187bb --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/SelectedCalendarUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { SelectedCalendarWhereUniqueInput } from "../../selectedCalendar/base/SelectedCalendarWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class SelectedCalendarUpdateManyWithoutUsersInput { + @Field(() => [SelectedCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SelectedCalendarWhereUniqueInput], + }) + connect?: Array<SelectedCalendarWhereUniqueInput>; + + @Field(() => [SelectedCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SelectedCalendarWhereUniqueInput], + }) + disconnect?: Array<SelectedCalendarWhereUniqueInput>; + + @Field(() => [SelectedCalendarWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SelectedCalendarWhereUniqueInput], + }) + set?: Array<SelectedCalendarWhereUniqueInput>; +} + +export { SelectedCalendarUpdateManyWithoutUsersInput as SelectedCalendarUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/SessionCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/SessionCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..140201a --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/SessionCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { SessionWhereUniqueInput } from "../../session/base/SessionWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class SessionCreateNestedManyWithoutUsersInput { + @Field(() => [SessionWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SessionWhereUniqueInput], + }) + connect?: Array<SessionWhereUniqueInput>; +} + +export { SessionCreateNestedManyWithoutUsersInput as SessionCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/SessionUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/SessionUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..afbe78c --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/SessionUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { SessionWhereUniqueInput } from "../../session/base/SessionWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class SessionUpdateManyWithoutUsersInput { + @Field(() => [SessionWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SessionWhereUniqueInput], + }) + connect?: Array<SessionWhereUniqueInput>; + + @Field(() => [SessionWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SessionWhereUniqueInput], + }) + disconnect?: Array<SessionWhereUniqueInput>; + + @Field(() => [SessionWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [SessionWhereUniqueInput], + }) + set?: Array<SessionWhereUniqueInput>; +} + +export { SessionUpdateManyWithoutUsersInput as SessionUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/UpdateUserArgs.ts b/apps/roi-cacl-2/src/user/base/UpdateUserArgs.ts new file mode 100644 index 0000000..1f13420 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UpdateUserArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "./UserWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { UserUpdateInput } from "./UserUpdateInput"; + +@ArgsType() +class UpdateUserArgs { + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput, { nullable: false }) + where!: UserWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => UserUpdateInput, + }) + @ValidateNested() + @Type(() => UserUpdateInput) + @Field(() => UserUpdateInput, { nullable: false }) + data!: UserUpdateInput; +} + +export { UpdateUserArgs as UpdateUserArgs }; diff --git a/apps/roi-cacl-2/src/user/base/User.ts b/apps/roi-cacl-2/src/user/base/User.ts new file mode 100644 index 0000000..81988f4 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/User.ts @@ -0,0 +1,529 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsString, + IsOptional, + IsDate, + IsBoolean, + IsEnum, + ValidateNested, +} from "class-validator"; +import { Type } from "class-transformer"; +import { EnumUserIdentityProvider } from "./EnumUserIdentityProvider"; +import { EnumUserPlan } from "./EnumUserPlan"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { JsonValue } from "type-fest"; +import { EnumUserRole } from "./EnumUserRole"; +import { EventType } from "../../eventType/base/EventType"; +import { Credential } from "../../credential/base/Credential"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { Membership } from "../../membership/base/Membership"; +import { Booking } from "../../booking/base/Booking"; +import { Schedule } from "../../schedule/base/Schedule"; +import { Availability } from "../../availability/base/Availability"; +import { SelectedCalendar } from "../../selectedCalendar/base/SelectedCalendar"; +import { Webhook } from "../../webhook/base/Webhook"; +import { Impersonation } from "../../impersonation/base/Impersonation"; +import { ApiKey } from "../../apiKey/base/ApiKey"; +import { Account } from "../../account/base/Account"; +import { Session } from "../../session/base/Session"; +import { Feedback } from "../../feedback/base/Feedback"; +import { Workflow } from "../../workflow/base/Workflow"; + +@ObjectType() +class User { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + username!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name!: string | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + email!: string; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + emailVerified!: Date | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + password!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + bio!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + avatar!: string | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + timeZone!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + weekStart!: string; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + startTime!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + endTime!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + bufferTime!: number; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hideBranding!: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + theme!: string | null; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdDate!: Date; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + trialEndsAt!: Date | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + defaultScheduleId!: number | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + completedOnboarding!: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + locale!: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + timeFormat!: number | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + twoFactorSecret!: string | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + twoFactorEnabled!: boolean; + + @ApiProperty({ + required: true, + enum: EnumUserIdentityProvider, + }) + @IsEnum(EnumUserIdentityProvider) + @Field(() => EnumUserIdentityProvider, { + nullable: true, + }) + identityProvider?: "CAL" | "GOOGLE" | "SAML"; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + identityProviderId!: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + invitedTo!: number | null; + + @ApiProperty({ + required: true, + enum: EnumUserPlan, + }) + @IsEnum(EnumUserPlan) + @Field(() => EnumUserPlan, { + nullable: true, + }) + plan?: "FREE" | "TRIAL" | "PRO"; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + brandColor!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + darkBrandColor!: string; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + away!: boolean; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + allowDynamicBooking!: boolean | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + metadata!: JsonValue; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + verified!: boolean | null; + + @ApiProperty({ + required: true, + enum: EnumUserRole, + }) + @IsEnum(EnumUserRole) + @Field(() => EnumUserRole, { + nullable: true, + }) + role?: "USER" | "ADMIN"; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + disableImpersonation!: boolean; + + @ApiProperty({ + required: false, + type: () => [EventType], + }) + @ValidateNested() + @Type(() => EventType) + @IsOptional() + eventTypes?: Array<EventType>; + + @ApiProperty({ + required: false, + type: () => [Credential], + }) + @ValidateNested() + @Type(() => Credential) + @IsOptional() + credentials?: Array<Credential>; + + @ApiProperty({ + required: false, + type: () => DestinationCalendar, + }) + @ValidateNested() + @Type(() => DestinationCalendar) + @IsOptional() + destinationCalendar?: DestinationCalendar | null; + + @ApiProperty({ + required: false, + type: () => [Membership], + }) + @ValidateNested() + @Type(() => Membership) + @IsOptional() + teams?: Array<Membership>; + + @ApiProperty({ + required: false, + type: () => [Booking], + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + bookings?: Array<Booking>; + + @ApiProperty({ + required: false, + type: () => [Schedule], + }) + @ValidateNested() + @Type(() => Schedule) + @IsOptional() + schedules?: Array<Schedule>; + + @ApiProperty({ + required: false, + type: () => [Availability], + }) + @ValidateNested() + @Type(() => Availability) + @IsOptional() + availability?: Array<Availability>; + + @ApiProperty({ + required: false, + type: () => [SelectedCalendar], + }) + @ValidateNested() + @Type(() => SelectedCalendar) + @IsOptional() + selectedCalendars?: Array<SelectedCalendar>; + + @ApiProperty({ + required: false, + type: () => [Webhook], + }) + @ValidateNested() + @Type(() => Webhook) + @IsOptional() + webhooks?: Array<Webhook>; + + @ApiProperty({ + required: false, + type: () => [Impersonation], + }) + @ValidateNested() + @Type(() => Impersonation) + @IsOptional() + impersonatedUsers?: Array<Impersonation>; + + @ApiProperty({ + required: false, + type: () => [Impersonation], + }) + @ValidateNested() + @Type(() => Impersonation) + @IsOptional() + impersonatedBy?: Array<Impersonation>; + + @ApiProperty({ + required: false, + type: () => [ApiKey], + }) + @ValidateNested() + @Type(() => ApiKey) + @IsOptional() + apiKeys?: Array<ApiKey>; + + @ApiProperty({ + required: false, + type: () => [Account], + }) + @ValidateNested() + @Type(() => Account) + @IsOptional() + accounts?: Array<Account>; + + @ApiProperty({ + required: false, + type: () => [Session], + }) + @ValidateNested() + @Type(() => Session) + @IsOptional() + sessions?: Array<Session>; + + @ApiProperty({ + required: false, + type: () => [Feedback], + }) + @ValidateNested() + @Type(() => Feedback) + @IsOptional() + feedback?: Array<Feedback>; + + @ApiProperty({ + required: false, + type: () => [Workflow], + }) + @ValidateNested() + @Type(() => Workflow) + @IsOptional() + workflows?: Array<Workflow>; +} + +export { User as User }; diff --git a/apps/roi-cacl-2/src/user/base/UserCountArgs.ts b/apps/roi-cacl-2/src/user/base/UserCountArgs.ts new file mode 100644 index 0000000..f4a14ac --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereInput } from "./UserWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class UserCountArgs { + @ApiProperty({ + required: false, + type: () => UserWhereInput, + }) + @Field(() => UserWhereInput, { nullable: true }) + @Type(() => UserWhereInput) + where?: UserWhereInput; +} + +export { UserCountArgs as UserCountArgs }; diff --git a/apps/roi-cacl-2/src/user/base/UserCreateInput.ts b/apps/roi-cacl-2/src/user/base/UserCreateInput.ts new file mode 100644 index 0000000..a325214 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserCreateInput.ts @@ -0,0 +1,555 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsDate, + IsInt, + IsBoolean, + IsEnum, + ValidateNested, +} from "class-validator"; +import { Type } from "class-transformer"; +import { EnumUserIdentityProvider } from "./EnumUserIdentityProvider"; +import { EnumUserPlan } from "./EnumUserPlan"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { EnumUserRole } from "./EnumUserRole"; +import { EventTypeCreateNestedManyWithoutUsersInput } from "./EventTypeCreateNestedManyWithoutUsersInput"; +import { CredentialCreateNestedManyWithoutUsersInput } from "./CredentialCreateNestedManyWithoutUsersInput"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { MembershipCreateNestedManyWithoutUsersInput } from "./MembershipCreateNestedManyWithoutUsersInput"; +import { BookingCreateNestedManyWithoutUsersInput } from "./BookingCreateNestedManyWithoutUsersInput"; +import { ScheduleCreateNestedManyWithoutUsersInput } from "./ScheduleCreateNestedManyWithoutUsersInput"; +import { AvailabilityCreateNestedManyWithoutUsersInput } from "./AvailabilityCreateNestedManyWithoutUsersInput"; +import { SelectedCalendarCreateNestedManyWithoutUsersInput } from "./SelectedCalendarCreateNestedManyWithoutUsersInput"; +import { WebhookCreateNestedManyWithoutUsersInput } from "./WebhookCreateNestedManyWithoutUsersInput"; +import { ImpersonationCreateNestedManyWithoutUsersInput } from "./ImpersonationCreateNestedManyWithoutUsersInput"; +import { ApiKeyCreateNestedManyWithoutUsersInput } from "./ApiKeyCreateNestedManyWithoutUsersInput"; +import { AccountCreateNestedManyWithoutUsersInput } from "./AccountCreateNestedManyWithoutUsersInput"; +import { SessionCreateNestedManyWithoutUsersInput } from "./SessionCreateNestedManyWithoutUsersInput"; +import { FeedbackCreateNestedManyWithoutUsersInput } from "./FeedbackCreateNestedManyWithoutUsersInput"; +import { WorkflowCreateNestedManyWithoutUsersInput } from "./WorkflowCreateNestedManyWithoutUsersInput"; + +@InputType() +class UserCreateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + username?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name?: string | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + email!: string; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + emailVerified?: Date | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + password?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + bio?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + avatar?: string | null; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + timeZone!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + weekStart!: string; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + startTime!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + endTime!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + bufferTime!: number; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + hideBranding!: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + theme?: string | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + trialEndsAt?: Date | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + defaultScheduleId?: number | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + completedOnboarding!: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + locale?: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + timeFormat?: number | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + twoFactorSecret?: string | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + twoFactorEnabled!: boolean; + + @ApiProperty({ + required: true, + enum: EnumUserIdentityProvider, + }) + @IsEnum(EnumUserIdentityProvider) + @Field(() => EnumUserIdentityProvider) + identityProvider!: "CAL" | "GOOGLE" | "SAML"; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + identityProviderId?: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + invitedTo?: number | null; + + @ApiProperty({ + required: true, + enum: EnumUserPlan, + }) + @IsEnum(EnumUserPlan) + @Field(() => EnumUserPlan) + plan!: "FREE" | "TRIAL" | "PRO"; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + brandColor!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + darkBrandColor!: string; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + away!: boolean; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + allowDynamicBooking?: boolean | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + metadata?: InputJsonValue; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + verified?: boolean | null; + + @ApiProperty({ + required: true, + enum: EnumUserRole, + }) + @IsEnum(EnumUserRole) + @Field(() => EnumUserRole) + role!: "USER" | "ADMIN"; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + disableImpersonation!: boolean; + + @ApiProperty({ + required: false, + type: () => EventTypeCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => EventTypeCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => EventTypeCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + eventTypes?: EventTypeCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => CredentialCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => CredentialCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => CredentialCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + credentials?: CredentialCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => MembershipCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => MembershipCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => MembershipCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + teams?: MembershipCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => BookingCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => BookingCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => BookingCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + bookings?: BookingCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ScheduleCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ScheduleCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => ScheduleCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + schedules?: ScheduleCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => AvailabilityCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => AvailabilityCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + availability?: AvailabilityCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => SelectedCalendarCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => SelectedCalendarCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + selectedCalendars?: SelectedCalendarCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => WebhookCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => WebhookCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => WebhookCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + webhooks?: WebhookCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ImpersonationCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ImpersonationCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => ImpersonationCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + impersonatedUsers?: ImpersonationCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ImpersonationCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ImpersonationCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => ImpersonationCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + impersonatedBy?: ImpersonationCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ApiKeyCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ApiKeyCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => ApiKeyCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + apiKeys?: ApiKeyCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => AccountCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => AccountCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => AccountCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + accounts?: AccountCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => SessionCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => SessionCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => SessionCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + sessions?: SessionCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => FeedbackCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => FeedbackCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => FeedbackCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + feedback?: FeedbackCreateNestedManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => WorkflowCreateNestedManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => WorkflowCreateNestedManyWithoutUsersInput) + @IsOptional() + @Field(() => WorkflowCreateNestedManyWithoutUsersInput, { + nullable: true, + }) + workflows?: WorkflowCreateNestedManyWithoutUsersInput; +} + +export { UserCreateInput as UserCreateInput }; diff --git a/apps/roi-cacl-2/src/user/base/UserFindManyArgs.ts b/apps/roi-cacl-2/src/user/base/UserFindManyArgs.ts new file mode 100644 index 0000000..8ba369c --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereInput } from "./UserWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { UserOrderByInput } from "./UserOrderByInput"; + +@ArgsType() +class UserFindManyArgs { + @ApiProperty({ + required: false, + type: () => UserWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => UserWhereInput, { nullable: true }) + @Type(() => UserWhereInput) + where?: UserWhereInput; + + @ApiProperty({ + required: false, + type: [UserOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [UserOrderByInput], { nullable: true }) + @Type(() => UserOrderByInput) + orderBy?: Array<UserOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { UserFindManyArgs as UserFindManyArgs }; diff --git a/apps/roi-cacl-2/src/user/base/UserFindUniqueArgs.ts b/apps/roi-cacl-2/src/user/base/UserFindUniqueArgs.ts new file mode 100644 index 0000000..c64506f --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereUniqueInput } from "./UserWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class UserFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput, { nullable: false }) + where!: UserWhereUniqueInput; +} + +export { UserFindUniqueArgs as UserFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/user/base/UserListRelationFilter.ts b/apps/roi-cacl-2/src/user/base/UserListRelationFilter.ts new file mode 100644 index 0000000..0ff7d94 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { UserWhereInput } from "./UserWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class UserListRelationFilter { + @ApiProperty({ + required: false, + type: () => UserWhereInput, + }) + @ValidateNested() + @Type(() => UserWhereInput) + @IsOptional() + @Field(() => UserWhereInput, { + nullable: true, + }) + every?: UserWhereInput; + + @ApiProperty({ + required: false, + type: () => UserWhereInput, + }) + @ValidateNested() + @Type(() => UserWhereInput) + @IsOptional() + @Field(() => UserWhereInput, { + nullable: true, + }) + some?: UserWhereInput; + + @ApiProperty({ + required: false, + type: () => UserWhereInput, + }) + @ValidateNested() + @Type(() => UserWhereInput) + @IsOptional() + @Field(() => UserWhereInput, { + nullable: true, + }) + none?: UserWhereInput; +} +export { UserListRelationFilter as UserListRelationFilter }; diff --git a/apps/roi-cacl-2/src/user/base/UserOrderByInput.ts b/apps/roi-cacl-2/src/user/base/UserOrderByInput.ts new file mode 100644 index 0000000..fa5b55e --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserOrderByInput.ts @@ -0,0 +1,419 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class UserOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + username?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + name?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + email?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + emailVerified?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + password?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bio?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + avatar?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + timeZone?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + weekStart?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + startTime?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + endTime?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bufferTime?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + hideBranding?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + theme?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdDate?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + trialEndsAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + defaultScheduleId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + completedOnboarding?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + locale?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + timeFormat?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + twoFactorSecret?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + twoFactorEnabled?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + identityProvider?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + identityProviderId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + invitedTo?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + plan?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + brandColor?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + darkBrandColor?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + away?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + allowDynamicBooking?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + metadata?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + verified?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + role?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + disableImpersonation?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + destinationCalendarId?: SortOrder; +} + +export { UserOrderByInput as UserOrderByInput }; diff --git a/apps/roi-cacl-2/src/user/base/UserUpdateInput.ts b/apps/roi-cacl-2/src/user/base/UserUpdateInput.ts new file mode 100644 index 0000000..9c09f0e --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserUpdateInput.ts @@ -0,0 +1,603 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsDate, + IsInt, + IsBoolean, + IsEnum, + ValidateNested, +} from "class-validator"; +import { Type } from "class-transformer"; +import { EnumUserIdentityProvider } from "./EnumUserIdentityProvider"; +import { EnumUserPlan } from "./EnumUserPlan"; +import { IsJSONValue } from "../../validators"; +import { GraphQLJSON } from "graphql-type-json"; +import { InputJsonValue } from "../../types"; +import { EnumUserRole } from "./EnumUserRole"; +import { EventTypeUpdateManyWithoutUsersInput } from "./EventTypeUpdateManyWithoutUsersInput"; +import { CredentialUpdateManyWithoutUsersInput } from "./CredentialUpdateManyWithoutUsersInput"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { MembershipUpdateManyWithoutUsersInput } from "./MembershipUpdateManyWithoutUsersInput"; +import { BookingUpdateManyWithoutUsersInput } from "./BookingUpdateManyWithoutUsersInput"; +import { ScheduleUpdateManyWithoutUsersInput } from "./ScheduleUpdateManyWithoutUsersInput"; +import { AvailabilityUpdateManyWithoutUsersInput } from "./AvailabilityUpdateManyWithoutUsersInput"; +import { SelectedCalendarUpdateManyWithoutUsersInput } from "./SelectedCalendarUpdateManyWithoutUsersInput"; +import { WebhookUpdateManyWithoutUsersInput } from "./WebhookUpdateManyWithoutUsersInput"; +import { ImpersonationUpdateManyWithoutUsersInput } from "./ImpersonationUpdateManyWithoutUsersInput"; +import { ApiKeyUpdateManyWithoutUsersInput } from "./ApiKeyUpdateManyWithoutUsersInput"; +import { AccountUpdateManyWithoutUsersInput } from "./AccountUpdateManyWithoutUsersInput"; +import { SessionUpdateManyWithoutUsersInput } from "./SessionUpdateManyWithoutUsersInput"; +import { FeedbackUpdateManyWithoutUsersInput } from "./FeedbackUpdateManyWithoutUsersInput"; +import { WorkflowUpdateManyWithoutUsersInput } from "./WorkflowUpdateManyWithoutUsersInput"; + +@InputType() +class UserUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + username?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + email?: string; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + emailVerified?: Date | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + password?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + bio?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + avatar?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + timeZone?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + weekStart?: string; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + startTime?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + endTime?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + bufferTime?: number; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + hideBranding?: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + theme?: string | null; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + trialEndsAt?: Date | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + defaultScheduleId?: number | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + completedOnboarding?: boolean; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + locale?: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + timeFormat?: number | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + twoFactorSecret?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + twoFactorEnabled?: boolean; + + @ApiProperty({ + required: false, + enum: EnumUserIdentityProvider, + }) + @IsEnum(EnumUserIdentityProvider) + @IsOptional() + @Field(() => EnumUserIdentityProvider, { + nullable: true, + }) + identityProvider?: "CAL" | "GOOGLE" | "SAML"; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + identityProviderId?: string | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + invitedTo?: number | null; + + @ApiProperty({ + required: false, + enum: EnumUserPlan, + }) + @IsEnum(EnumUserPlan) + @IsOptional() + @Field(() => EnumUserPlan, { + nullable: true, + }) + plan?: "FREE" | "TRIAL" | "PRO"; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + brandColor?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + darkBrandColor?: string; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + away?: boolean; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + allowDynamicBooking?: boolean | null; + + @ApiProperty({ + required: false, + }) + @IsJSONValue() + @IsOptional() + @Field(() => GraphQLJSON, { + nullable: true, + }) + metadata?: InputJsonValue; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + verified?: boolean | null; + + @ApiProperty({ + required: false, + enum: EnumUserRole, + }) + @IsEnum(EnumUserRole) + @IsOptional() + @Field(() => EnumUserRole, { + nullable: true, + }) + role?: "USER" | "ADMIN"; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + disableImpersonation?: boolean; + + @ApiProperty({ + required: false, + type: () => EventTypeUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => EventTypeUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => EventTypeUpdateManyWithoutUsersInput, { + nullable: true, + }) + eventTypes?: EventTypeUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => CredentialUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => CredentialUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => CredentialUpdateManyWithoutUsersInput, { + nullable: true, + }) + credentials?: CredentialUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => MembershipUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => MembershipUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => MembershipUpdateManyWithoutUsersInput, { + nullable: true, + }) + teams?: MembershipUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => BookingUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => BookingUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => BookingUpdateManyWithoutUsersInput, { + nullable: true, + }) + bookings?: BookingUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ScheduleUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ScheduleUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => ScheduleUpdateManyWithoutUsersInput, { + nullable: true, + }) + schedules?: ScheduleUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => AvailabilityUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => AvailabilityUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => AvailabilityUpdateManyWithoutUsersInput, { + nullable: true, + }) + availability?: AvailabilityUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => SelectedCalendarUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => SelectedCalendarUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => SelectedCalendarUpdateManyWithoutUsersInput, { + nullable: true, + }) + selectedCalendars?: SelectedCalendarUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => WebhookUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => WebhookUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => WebhookUpdateManyWithoutUsersInput, { + nullable: true, + }) + webhooks?: WebhookUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ImpersonationUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ImpersonationUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => ImpersonationUpdateManyWithoutUsersInput, { + nullable: true, + }) + impersonatedUsers?: ImpersonationUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ImpersonationUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ImpersonationUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => ImpersonationUpdateManyWithoutUsersInput, { + nullable: true, + }) + impersonatedBy?: ImpersonationUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => ApiKeyUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => ApiKeyUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => ApiKeyUpdateManyWithoutUsersInput, { + nullable: true, + }) + apiKeys?: ApiKeyUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => AccountUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => AccountUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => AccountUpdateManyWithoutUsersInput, { + nullable: true, + }) + accounts?: AccountUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => SessionUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => SessionUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => SessionUpdateManyWithoutUsersInput, { + nullable: true, + }) + sessions?: SessionUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => FeedbackUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => FeedbackUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => FeedbackUpdateManyWithoutUsersInput, { + nullable: true, + }) + feedback?: FeedbackUpdateManyWithoutUsersInput; + + @ApiProperty({ + required: false, + type: () => WorkflowUpdateManyWithoutUsersInput, + }) + @ValidateNested() + @Type(() => WorkflowUpdateManyWithoutUsersInput) + @IsOptional() + @Field(() => WorkflowUpdateManyWithoutUsersInput, { + nullable: true, + }) + workflows?: WorkflowUpdateManyWithoutUsersInput; +} + +export { UserUpdateInput as UserUpdateInput }; diff --git a/apps/roi-cacl-2/src/user/base/UserWhereInput.ts b/apps/roi-cacl-2/src/user/base/UserWhereInput.ts new file mode 100644 index 0000000..543ad70 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserWhereInput.ts @@ -0,0 +1,624 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, IsEnum, ValidateNested } from "class-validator"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { StringFilter } from "../../util/StringFilter"; +import { DateTimeNullableFilter } from "../../util/DateTimeNullableFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { EnumUserIdentityProvider } from "./EnumUserIdentityProvider"; +import { EnumUserPlan } from "./EnumUserPlan"; +import { BooleanNullableFilter } from "../../util/BooleanNullableFilter"; +import { JsonFilter } from "../../util/JsonFilter"; +import { EnumUserRole } from "./EnumUserRole"; +import { EventTypeListRelationFilter } from "../../eventType/base/EventTypeListRelationFilter"; +import { CredentialListRelationFilter } from "../../credential/base/CredentialListRelationFilter"; +import { DestinationCalendarWhereUniqueInput } from "../../destinationCalendar/base/DestinationCalendarWhereUniqueInput"; +import { MembershipListRelationFilter } from "../../membership/base/MembershipListRelationFilter"; +import { BookingListRelationFilter } from "../../booking/base/BookingListRelationFilter"; +import { ScheduleListRelationFilter } from "../../schedule/base/ScheduleListRelationFilter"; +import { AvailabilityListRelationFilter } from "../../availability/base/AvailabilityListRelationFilter"; +import { SelectedCalendarListRelationFilter } from "../../selectedCalendar/base/SelectedCalendarListRelationFilter"; +import { WebhookListRelationFilter } from "../../webhook/base/WebhookListRelationFilter"; +import { ImpersonationListRelationFilter } from "../../impersonation/base/ImpersonationListRelationFilter"; +import { ApiKeyListRelationFilter } from "../../apiKey/base/ApiKeyListRelationFilter"; +import { AccountListRelationFilter } from "../../account/base/AccountListRelationFilter"; +import { SessionListRelationFilter } from "../../session/base/SessionListRelationFilter"; +import { FeedbackListRelationFilter } from "../../feedback/base/FeedbackListRelationFilter"; +import { WorkflowListRelationFilter } from "../../workflow/base/WorkflowListRelationFilter"; + +@InputType() +class UserWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + username?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + name?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + email?: StringFilter; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + emailVerified?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + password?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + bio?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + avatar?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + timeZone?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + weekStart?: StringFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + startTime?: IntFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + endTime?: IntFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + bufferTime?: IntFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + hideBranding?: BooleanFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + theme?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdDate?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeNullableFilter, + }) + @Type(() => DateTimeNullableFilter) + @IsOptional() + @Field(() => DateTimeNullableFilter, { + nullable: true, + }) + trialEndsAt?: DateTimeNullableFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + defaultScheduleId?: IntNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + completedOnboarding?: BooleanFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + locale?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + timeFormat?: IntNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + twoFactorSecret?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + twoFactorEnabled?: BooleanFilter; + + @ApiProperty({ + required: false, + enum: EnumUserIdentityProvider, + }) + @IsEnum(EnumUserIdentityProvider) + @IsOptional() + @Field(() => EnumUserIdentityProvider, { + nullable: true, + }) + identityProvider?: "CAL" | "GOOGLE" | "SAML"; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + identityProviderId?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + invitedTo?: IntNullableFilter; + + @ApiProperty({ + required: false, + enum: EnumUserPlan, + }) + @IsEnum(EnumUserPlan) + @IsOptional() + @Field(() => EnumUserPlan, { + nullable: true, + }) + plan?: "FREE" | "TRIAL" | "PRO"; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + brandColor?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + darkBrandColor?: StringFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + away?: BooleanFilter; + + @ApiProperty({ + required: false, + type: BooleanNullableFilter, + }) + @Type(() => BooleanNullableFilter) + @IsOptional() + @Field(() => BooleanNullableFilter, { + nullable: true, + }) + allowDynamicBooking?: BooleanNullableFilter; + + @ApiProperty({ + required: false, + type: JsonFilter, + }) + @Type(() => JsonFilter) + @IsOptional() + @Field(() => JsonFilter, { + nullable: true, + }) + metadata?: JsonFilter; + + @ApiProperty({ + required: false, + type: BooleanNullableFilter, + }) + @Type(() => BooleanNullableFilter) + @IsOptional() + @Field(() => BooleanNullableFilter, { + nullable: true, + }) + verified?: BooleanNullableFilter; + + @ApiProperty({ + required: false, + enum: EnumUserRole, + }) + @IsEnum(EnumUserRole) + @IsOptional() + @Field(() => EnumUserRole, { + nullable: true, + }) + role?: "USER" | "ADMIN"; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + disableImpersonation?: BooleanFilter; + + @ApiProperty({ + required: false, + type: () => EventTypeListRelationFilter, + }) + @ValidateNested() + @Type(() => EventTypeListRelationFilter) + @IsOptional() + @Field(() => EventTypeListRelationFilter, { + nullable: true, + }) + eventTypes?: EventTypeListRelationFilter; + + @ApiProperty({ + required: false, + type: () => CredentialListRelationFilter, + }) + @ValidateNested() + @Type(() => CredentialListRelationFilter) + @IsOptional() + @Field(() => CredentialListRelationFilter, { + nullable: true, + }) + credentials?: CredentialListRelationFilter; + + @ApiProperty({ + required: false, + type: () => DestinationCalendarWhereUniqueInput, + }) + @ValidateNested() + @Type(() => DestinationCalendarWhereUniqueInput) + @IsOptional() + @Field(() => DestinationCalendarWhereUniqueInput, { + nullable: true, + }) + destinationCalendar?: DestinationCalendarWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => MembershipListRelationFilter, + }) + @ValidateNested() + @Type(() => MembershipListRelationFilter) + @IsOptional() + @Field(() => MembershipListRelationFilter, { + nullable: true, + }) + teams?: MembershipListRelationFilter; + + @ApiProperty({ + required: false, + type: () => BookingListRelationFilter, + }) + @ValidateNested() + @Type(() => BookingListRelationFilter) + @IsOptional() + @Field(() => BookingListRelationFilter, { + nullable: true, + }) + bookings?: BookingListRelationFilter; + + @ApiProperty({ + required: false, + type: () => ScheduleListRelationFilter, + }) + @ValidateNested() + @Type(() => ScheduleListRelationFilter) + @IsOptional() + @Field(() => ScheduleListRelationFilter, { + nullable: true, + }) + schedules?: ScheduleListRelationFilter; + + @ApiProperty({ + required: false, + type: () => AvailabilityListRelationFilter, + }) + @ValidateNested() + @Type(() => AvailabilityListRelationFilter) + @IsOptional() + @Field(() => AvailabilityListRelationFilter, { + nullable: true, + }) + availability?: AvailabilityListRelationFilter; + + @ApiProperty({ + required: false, + type: () => SelectedCalendarListRelationFilter, + }) + @ValidateNested() + @Type(() => SelectedCalendarListRelationFilter) + @IsOptional() + @Field(() => SelectedCalendarListRelationFilter, { + nullable: true, + }) + selectedCalendars?: SelectedCalendarListRelationFilter; + + @ApiProperty({ + required: false, + type: () => WebhookListRelationFilter, + }) + @ValidateNested() + @Type(() => WebhookListRelationFilter) + @IsOptional() + @Field(() => WebhookListRelationFilter, { + nullable: true, + }) + webhooks?: WebhookListRelationFilter; + + @ApiProperty({ + required: false, + type: () => ImpersonationListRelationFilter, + }) + @ValidateNested() + @Type(() => ImpersonationListRelationFilter) + @IsOptional() + @Field(() => ImpersonationListRelationFilter, { + nullable: true, + }) + impersonatedUsers?: ImpersonationListRelationFilter; + + @ApiProperty({ + required: false, + type: () => ImpersonationListRelationFilter, + }) + @ValidateNested() + @Type(() => ImpersonationListRelationFilter) + @IsOptional() + @Field(() => ImpersonationListRelationFilter, { + nullable: true, + }) + impersonatedBy?: ImpersonationListRelationFilter; + + @ApiProperty({ + required: false, + type: () => ApiKeyListRelationFilter, + }) + @ValidateNested() + @Type(() => ApiKeyListRelationFilter) + @IsOptional() + @Field(() => ApiKeyListRelationFilter, { + nullable: true, + }) + apiKeys?: ApiKeyListRelationFilter; + + @ApiProperty({ + required: false, + type: () => AccountListRelationFilter, + }) + @ValidateNested() + @Type(() => AccountListRelationFilter) + @IsOptional() + @Field(() => AccountListRelationFilter, { + nullable: true, + }) + accounts?: AccountListRelationFilter; + + @ApiProperty({ + required: false, + type: () => SessionListRelationFilter, + }) + @ValidateNested() + @Type(() => SessionListRelationFilter) + @IsOptional() + @Field(() => SessionListRelationFilter, { + nullable: true, + }) + sessions?: SessionListRelationFilter; + + @ApiProperty({ + required: false, + type: () => FeedbackListRelationFilter, + }) + @ValidateNested() + @Type(() => FeedbackListRelationFilter) + @IsOptional() + @Field(() => FeedbackListRelationFilter, { + nullable: true, + }) + feedback?: FeedbackListRelationFilter; + + @ApiProperty({ + required: false, + type: () => WorkflowListRelationFilter, + }) + @ValidateNested() + @Type(() => WorkflowListRelationFilter) + @IsOptional() + @Field(() => WorkflowListRelationFilter, { + nullable: true, + }) + workflows?: WorkflowListRelationFilter; +} + +export { UserWhereInput as UserWhereInput }; diff --git a/apps/roi-cacl-2/src/user/base/UserWhereUniqueInput.ts b/apps/roi-cacl-2/src/user/base/UserWhereUniqueInput.ts new file mode 100644 index 0000000..fb14ea6 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/UserWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class UserWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { UserWhereUniqueInput as UserWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/user/base/WebhookCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/WebhookCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..facf619 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/WebhookCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WebhookCreateNestedManyWithoutUsersInput { + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + connect?: Array<WebhookWhereUniqueInput>; +} + +export { WebhookCreateNestedManyWithoutUsersInput as WebhookCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/WebhookUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/WebhookUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..a44cbf3 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/WebhookUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WebhookUpdateManyWithoutUsersInput { + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + connect?: Array<WebhookWhereUniqueInput>; + + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + disconnect?: Array<WebhookWhereUniqueInput>; + + @Field(() => [WebhookWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WebhookWhereUniqueInput], + }) + set?: Array<WebhookWhereUniqueInput>; +} + +export { WebhookUpdateManyWithoutUsersInput as WebhookUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/WorkflowCreateNestedManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/WorkflowCreateNestedManyWithoutUsersInput.ts new file mode 100644 index 0000000..376d255 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/WorkflowCreateNestedManyWithoutUsersInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowCreateNestedManyWithoutUsersInput { + @Field(() => [WorkflowWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowWhereUniqueInput], + }) + connect?: Array<WorkflowWhereUniqueInput>; +} + +export { WorkflowCreateNestedManyWithoutUsersInput as WorkflowCreateNestedManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/WorkflowUpdateManyWithoutUsersInput.ts b/apps/roi-cacl-2/src/user/base/WorkflowUpdateManyWithoutUsersInput.ts new file mode 100644 index 0000000..a0dfd94 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/WorkflowUpdateManyWithoutUsersInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowUpdateManyWithoutUsersInput { + @Field(() => [WorkflowWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowWhereUniqueInput], + }) + connect?: Array<WorkflowWhereUniqueInput>; + + @Field(() => [WorkflowWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowWhereUniqueInput], + }) + disconnect?: Array<WorkflowWhereUniqueInput>; + + @Field(() => [WorkflowWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowWhereUniqueInput], + }) + set?: Array<WorkflowWhereUniqueInput>; +} + +export { WorkflowUpdateManyWithoutUsersInput as WorkflowUpdateManyWithoutUsersInput }; diff --git a/apps/roi-cacl-2/src/user/base/user.controller.base.spec.ts b/apps/roi-cacl-2/src/user/base/user.controller.base.spec.ts new file mode 100644 index 0000000..e6ac4c3 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/user.controller.base.spec.ts @@ -0,0 +1,306 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { UserController } from "../user.controller"; +import { UserService } from "../user.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + username: "exampleUsername", + name: "exampleName", + email: "exampleEmail", + emailVerified: new Date(), + password: "examplePassword", + bio: "exampleBio", + avatar: "exampleAvatar", + timeZone: "exampleTimeZone", + weekStart: "exampleWeekStart", + startTime: 42, + endTime: 42, + bufferTime: 42, + hideBranding: "true", + theme: "exampleTheme", + createdDate: new Date(), + trialEndsAt: new Date(), + defaultScheduleId: 42, + completedOnboarding: "true", + locale: "exampleLocale", + timeFormat: 42, + twoFactorSecret: "exampleTwoFactorSecret", + twoFactorEnabled: "true", + identityProviderId: "exampleIdentityProviderId", + invitedTo: 42, + brandColor: "exampleBrandColor", + darkBrandColor: "exampleDarkBrandColor", + away: "true", + allowDynamicBooking: "true", + verified: "true", + disableImpersonation: "true", +}; +const CREATE_RESULT = { + id: 42, + username: "exampleUsername", + name: "exampleName", + email: "exampleEmail", + emailVerified: new Date(), + password: "examplePassword", + bio: "exampleBio", + avatar: "exampleAvatar", + timeZone: "exampleTimeZone", + weekStart: "exampleWeekStart", + startTime: 42, + endTime: 42, + bufferTime: 42, + hideBranding: "true", + theme: "exampleTheme", + createdDate: new Date(), + trialEndsAt: new Date(), + defaultScheduleId: 42, + completedOnboarding: "true", + locale: "exampleLocale", + timeFormat: 42, + twoFactorSecret: "exampleTwoFactorSecret", + twoFactorEnabled: "true", + identityProviderId: "exampleIdentityProviderId", + invitedTo: 42, + brandColor: "exampleBrandColor", + darkBrandColor: "exampleDarkBrandColor", + away: "true", + allowDynamicBooking: "true", + verified: "true", + disableImpersonation: "true", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + username: "exampleUsername", + name: "exampleName", + email: "exampleEmail", + emailVerified: new Date(), + password: "examplePassword", + bio: "exampleBio", + avatar: "exampleAvatar", + timeZone: "exampleTimeZone", + weekStart: "exampleWeekStart", + startTime: 42, + endTime: 42, + bufferTime: 42, + hideBranding: "true", + theme: "exampleTheme", + createdDate: new Date(), + trialEndsAt: new Date(), + defaultScheduleId: 42, + completedOnboarding: "true", + locale: "exampleLocale", + timeFormat: 42, + twoFactorSecret: "exampleTwoFactorSecret", + twoFactorEnabled: "true", + identityProviderId: "exampleIdentityProviderId", + invitedTo: 42, + brandColor: "exampleBrandColor", + darkBrandColor: "exampleDarkBrandColor", + away: "true", + allowDynamicBooking: "true", + verified: "true", + disableImpersonation: "true", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + username: "exampleUsername", + name: "exampleName", + email: "exampleEmail", + emailVerified: new Date(), + password: "examplePassword", + bio: "exampleBio", + avatar: "exampleAvatar", + timeZone: "exampleTimeZone", + weekStart: "exampleWeekStart", + startTime: 42, + endTime: 42, + bufferTime: 42, + hideBranding: "true", + theme: "exampleTheme", + createdDate: new Date(), + trialEndsAt: new Date(), + defaultScheduleId: 42, + completedOnboarding: "true", + locale: "exampleLocale", + timeFormat: 42, + twoFactorSecret: "exampleTwoFactorSecret", + twoFactorEnabled: "true", + identityProviderId: "exampleIdentityProviderId", + invitedTo: 42, + brandColor: "exampleBrandColor", + darkBrandColor: "exampleDarkBrandColor", + away: "true", + allowDynamicBooking: "true", + verified: "true", + disableImpersonation: "true", +}; + +const service = { + createUser() { + return CREATE_RESULT; + }, + users: () => FIND_MANY_RESULT, + user: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("User", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: UserService, + useValue: service, + }, + ], + controllers: [UserController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /users", async () => { + await request(app.getHttpServer()) + .post("/users") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + emailVerified: CREATE_RESULT.emailVerified.toISOString(), + createdDate: CREATE_RESULT.createdDate.toISOString(), + trialEndsAt: CREATE_RESULT.trialEndsAt.toISOString(), + }); + }); + + test("GET /users", async () => { + await request(app.getHttpServer()) + .get("/users") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + emailVerified: FIND_MANY_RESULT[0].emailVerified.toISOString(), + createdDate: FIND_MANY_RESULT[0].createdDate.toISOString(), + trialEndsAt: FIND_MANY_RESULT[0].trialEndsAt.toISOString(), + }, + ]); + }); + + test("GET /users/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/users"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /users/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/users"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + emailVerified: FIND_ONE_RESULT.emailVerified.toISOString(), + createdDate: FIND_ONE_RESULT.createdDate.toISOString(), + trialEndsAt: FIND_ONE_RESULT.trialEndsAt.toISOString(), + }); + }); + + test("POST /users existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/users") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + emailVerified: CREATE_RESULT.emailVerified.toISOString(), + createdDate: CREATE_RESULT.createdDate.toISOString(), + trialEndsAt: CREATE_RESULT.trialEndsAt.toISOString(), + }) + .then(function () { + agent + .post("/users") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/user/base/user.controller.base.ts b/apps/roi-cacl-2/src/user/base/user.controller.base.ts new file mode 100644 index 0000000..e38a22f --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/user.controller.base.ts @@ -0,0 +1,1738 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { UserService } from "../user.service"; +import { UserCreateInput } from "./UserCreateInput"; +import { User } from "./User"; +import { UserFindManyArgs } from "./UserFindManyArgs"; +import { UserWhereUniqueInput } from "./UserWhereUniqueInput"; +import { UserUpdateInput } from "./UserUpdateInput"; +import { EventTypeFindManyArgs } from "../../eventType/base/EventTypeFindManyArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { CredentialFindManyArgs } from "../../credential/base/CredentialFindManyArgs"; +import { Credential } from "../../credential/base/Credential"; +import { CredentialWhereUniqueInput } from "../../credential/base/CredentialWhereUniqueInput"; +import { MembershipFindManyArgs } from "../../membership/base/MembershipFindManyArgs"; +import { Membership } from "../../membership/base/Membership"; +import { MembershipWhereUniqueInput } from "../../membership/base/MembershipWhereUniqueInput"; +import { BookingFindManyArgs } from "../../booking/base/BookingFindManyArgs"; +import { Booking } from "../../booking/base/Booking"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { ScheduleFindManyArgs } from "../../schedule/base/ScheduleFindManyArgs"; +import { Schedule } from "../../schedule/base/Schedule"; +import { ScheduleWhereUniqueInput } from "../../schedule/base/ScheduleWhereUniqueInput"; +import { AvailabilityFindManyArgs } from "../../availability/base/AvailabilityFindManyArgs"; +import { Availability } from "../../availability/base/Availability"; +import { AvailabilityWhereUniqueInput } from "../../availability/base/AvailabilityWhereUniqueInput"; +import { SelectedCalendarFindManyArgs } from "../../selectedCalendar/base/SelectedCalendarFindManyArgs"; +import { SelectedCalendar } from "../../selectedCalendar/base/SelectedCalendar"; +import { SelectedCalendarWhereUniqueInput } from "../../selectedCalendar/base/SelectedCalendarWhereUniqueInput"; +import { WebhookFindManyArgs } from "../../webhook/base/WebhookFindManyArgs"; +import { Webhook } from "../../webhook/base/Webhook"; +import { WebhookWhereUniqueInput } from "../../webhook/base/WebhookWhereUniqueInput"; +import { ImpersonationFindManyArgs } from "../../impersonation/base/ImpersonationFindManyArgs"; +import { Impersonation } from "../../impersonation/base/Impersonation"; +import { ImpersonationWhereUniqueInput } from "../../impersonation/base/ImpersonationWhereUniqueInput"; +import { ApiKeyFindManyArgs } from "../../apiKey/base/ApiKeyFindManyArgs"; +import { ApiKey } from "../../apiKey/base/ApiKey"; +import { ApiKeyWhereUniqueInput } from "../../apiKey/base/ApiKeyWhereUniqueInput"; +import { AccountFindManyArgs } from "../../account/base/AccountFindManyArgs"; +import { Account } from "../../account/base/Account"; +import { AccountWhereUniqueInput } from "../../account/base/AccountWhereUniqueInput"; +import { SessionFindManyArgs } from "../../session/base/SessionFindManyArgs"; +import { Session } from "../../session/base/Session"; +import { SessionWhereUniqueInput } from "../../session/base/SessionWhereUniqueInput"; +import { FeedbackFindManyArgs } from "../../feedback/base/FeedbackFindManyArgs"; +import { Feedback } from "../../feedback/base/Feedback"; +import { FeedbackWhereUniqueInput } from "../../feedback/base/FeedbackWhereUniqueInput"; +import { WorkflowFindManyArgs } from "../../workflow/base/WorkflowFindManyArgs"; +import { Workflow } from "../../workflow/base/Workflow"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; + +export class UserControllerBase { + constructor(protected readonly service: UserService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: User }) + async createUser(@common.Body() data: UserCreateInput): Promise<User> { + return await this.service.createUser({ + data: { + ...data, + + destinationCalendar: data.destinationCalendar + ? { + connect: data.destinationCalendar, + } + : undefined, + }, + select: { + id: true, + username: true, + name: true, + email: true, + emailVerified: true, + password: true, + bio: true, + avatar: true, + timeZone: true, + weekStart: true, + startTime: true, + endTime: true, + bufferTime: true, + hideBranding: true, + theme: true, + createdDate: true, + trialEndsAt: true, + defaultScheduleId: true, + completedOnboarding: true, + locale: true, + timeFormat: true, + twoFactorSecret: true, + twoFactorEnabled: true, + identityProvider: true, + identityProviderId: true, + invitedTo: true, + plan: true, + brandColor: true, + darkBrandColor: true, + away: true, + allowDynamicBooking: true, + metadata: true, + verified: true, + role: true, + disableImpersonation: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [User] }) + @ApiNestedQuery(UserFindManyArgs) + async users(@common.Req() request: Request): Promise<User[]> { + const args = plainToClass(UserFindManyArgs, request.query); + return this.service.users({ + ...args, + select: { + id: true, + username: true, + name: true, + email: true, + emailVerified: true, + password: true, + bio: true, + avatar: true, + timeZone: true, + weekStart: true, + startTime: true, + endTime: true, + bufferTime: true, + hideBranding: true, + theme: true, + createdDate: true, + trialEndsAt: true, + defaultScheduleId: true, + completedOnboarding: true, + locale: true, + timeFormat: true, + twoFactorSecret: true, + twoFactorEnabled: true, + identityProvider: true, + identityProviderId: true, + invitedTo: true, + plan: true, + brandColor: true, + darkBrandColor: true, + away: true, + allowDynamicBooking: true, + metadata: true, + verified: true, + role: true, + disableImpersonation: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: User }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async user( + @common.Param() params: UserWhereUniqueInput + ): Promise<User | null> { + const result = await this.service.user({ + where: params, + select: { + id: true, + username: true, + name: true, + email: true, + emailVerified: true, + password: true, + bio: true, + avatar: true, + timeZone: true, + weekStart: true, + startTime: true, + endTime: true, + bufferTime: true, + hideBranding: true, + theme: true, + createdDate: true, + trialEndsAt: true, + defaultScheduleId: true, + completedOnboarding: true, + locale: true, + timeFormat: true, + twoFactorSecret: true, + twoFactorEnabled: true, + identityProvider: true, + identityProviderId: true, + invitedTo: true, + plan: true, + brandColor: true, + darkBrandColor: true, + away: true, + allowDynamicBooking: true, + metadata: true, + verified: true, + role: true, + disableImpersonation: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: User }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateUser( + @common.Param() params: UserWhereUniqueInput, + @common.Body() data: UserUpdateInput + ): Promise<User | null> { + try { + return await this.service.updateUser({ + where: params, + data: { + ...data, + + destinationCalendar: data.destinationCalendar + ? { + connect: data.destinationCalendar, + } + : undefined, + }, + select: { + id: true, + username: true, + name: true, + email: true, + emailVerified: true, + password: true, + bio: true, + avatar: true, + timeZone: true, + weekStart: true, + startTime: true, + endTime: true, + bufferTime: true, + hideBranding: true, + theme: true, + createdDate: true, + trialEndsAt: true, + defaultScheduleId: true, + completedOnboarding: true, + locale: true, + timeFormat: true, + twoFactorSecret: true, + twoFactorEnabled: true, + identityProvider: true, + identityProviderId: true, + invitedTo: true, + plan: true, + brandColor: true, + darkBrandColor: true, + away: true, + allowDynamicBooking: true, + metadata: true, + verified: true, + role: true, + disableImpersonation: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: User }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteUser( + @common.Param() params: UserWhereUniqueInput + ): Promise<User | null> { + try { + return await this.service.deleteUser({ + where: params, + select: { + id: true, + username: true, + name: true, + email: true, + emailVerified: true, + password: true, + bio: true, + avatar: true, + timeZone: true, + weekStart: true, + startTime: true, + endTime: true, + bufferTime: true, + hideBranding: true, + theme: true, + createdDate: true, + trialEndsAt: true, + defaultScheduleId: true, + completedOnboarding: true, + locale: true, + timeFormat: true, + twoFactorSecret: true, + twoFactorEnabled: true, + identityProvider: true, + identityProviderId: true, + invitedTo: true, + plan: true, + brandColor: true, + darkBrandColor: true, + away: true, + allowDynamicBooking: true, + metadata: true, + verified: true, + role: true, + disableImpersonation: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/eventTypes") + @ApiNestedQuery(EventTypeFindManyArgs) + async findEventTypes( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<EventType[]> { + const query = plainToClass(EventTypeFindManyArgs, request.query); + const results = await this.service.findEventTypes(params.id, { + ...query, + select: { + id: true, + title: true, + slug: true, + description: true, + position: true, + locations: true, + length: true, + hidden: true, + userId: true, + + team: { + select: { + id: true, + }, + }, + + eventName: true, + timeZone: true, + periodType: true, + periodStartDate: true, + periodEndDate: true, + periodDays: true, + periodCountCalendarDays: true, + requiresConfirmation: true, + recurringEvent: true, + disableGuests: true, + hideCalendarNotes: true, + minimumBookingNotice: true, + beforeEventBuffer: true, + afterEventBuffer: true, + seatsPerTimeSlot: true, + schedulingType: true, + + schedule: { + select: { + id: true, + }, + }, + + price: true, + currency: true, + slotInterval: true, + metadata: true, + successRedirectUrl: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + hashedLink: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/eventTypes") + async connectEventTypes( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventTypes: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/eventTypes") + async updateEventTypes( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventTypes: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/eventTypes") + async disconnectEventTypes( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: EventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + eventTypes: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/credentials") + @ApiNestedQuery(CredentialFindManyArgs) + async findCredentials( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Credential[]> { + const query = plainToClass(CredentialFindManyArgs, request.query); + const results = await this.service.findCredentials(params.id, { + ...query, + select: { + id: true, + typeField: true, + key: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/credentials") + async connectCredentials( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: CredentialWhereUniqueInput[] + ): Promise<void> { + const data = { + credentials: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/credentials") + async updateCredentials( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: CredentialWhereUniqueInput[] + ): Promise<void> { + const data = { + credentials: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/credentials") + async disconnectCredentials( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: CredentialWhereUniqueInput[] + ): Promise<void> { + const data = { + credentials: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/teams") + @ApiNestedQuery(MembershipFindManyArgs) + async findTeams( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Membership[]> { + const query = plainToClass(MembershipFindManyArgs, request.query); + const results = await this.service.findTeams(params.id, { + ...query, + select: { + id: true, + accepted: true, + role: true, + + team: { + select: { + id: true, + }, + }, + + user: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/teams") + async connectTeams( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: MembershipWhereUniqueInput[] + ): Promise<void> { + const data = { + teams: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/teams") + async updateTeams( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: MembershipWhereUniqueInput[] + ): Promise<void> { + const data = { + teams: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/teams") + async disconnectTeams( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: MembershipWhereUniqueInput[] + ): Promise<void> { + const data = { + teams: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/bookings") + @ApiNestedQuery(BookingFindManyArgs) + async findBookings( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Booking[]> { + const query = plainToClass(BookingFindManyArgs, request.query); + const results = await this.service.findBookings(params.id, { + ...query, + select: { + id: true, + uid: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + title: true, + description: true, + customInputs: true, + startTime: true, + endTime: true, + location: true, + createdAt: true, + updatedAt: true, + status: true, + paid: true, + cancellationReason: true, + rejectionReason: true, + dynamicEventSlugRef: true, + dynamicGroupSlugRef: true, + rescheduled: true, + fromReschedule: true, + recurringEventId: true, + smsReminderNumber: true, + + destinationCalendar: { + select: { + id: true, + }, + }, + + dailyRef: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/bookings") + async connectBookings( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: BookingWhereUniqueInput[] + ): Promise<void> { + const data = { + bookings: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/bookings") + async updateBookings( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: BookingWhereUniqueInput[] + ): Promise<void> { + const data = { + bookings: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/bookings") + async disconnectBookings( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: BookingWhereUniqueInput[] + ): Promise<void> { + const data = { + bookings: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/schedules") + @ApiNestedQuery(ScheduleFindManyArgs) + async findSchedules( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Schedule[]> { + const query = plainToClass(ScheduleFindManyArgs, request.query); + const results = await this.service.findSchedules(params.id, { + ...query, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + name: true, + timeZone: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/schedules") + async connectSchedules( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ScheduleWhereUniqueInput[] + ): Promise<void> { + const data = { + schedules: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/schedules") + async updateSchedules( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ScheduleWhereUniqueInput[] + ): Promise<void> { + const data = { + schedules: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/schedules") + async disconnectSchedules( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ScheduleWhereUniqueInput[] + ): Promise<void> { + const data = { + schedules: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/availability") + @ApiNestedQuery(AvailabilityFindManyArgs) + async findAvailability( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Availability[]> { + const query = plainToClass(AvailabilityFindManyArgs, request.query); + const results = await this.service.findAvailability(params.id, { + ...query, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + days: true, + startTime: true, + endTime: true, + date: true, + + schedule: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/availability") + async connectAvailability( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/availability") + async updateAvailability( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/availability") + async disconnectAvailability( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: AvailabilityWhereUniqueInput[] + ): Promise<void> { + const data = { + availability: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/selectedCalendars") + @ApiNestedQuery(SelectedCalendarFindManyArgs) + async findSelectedCalendars( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<SelectedCalendar[]> { + const query = plainToClass(SelectedCalendarFindManyArgs, request.query); + const results = await this.service.findSelectedCalendars(params.id, { + ...query, + select: { + id: true, + + user: { + select: { + id: true, + }, + }, + + integration: true, + externalId: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/selectedCalendars") + async connectSelectedCalendars( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: SelectedCalendarWhereUniqueInput[] + ): Promise<void> { + const data = { + selectedCalendars: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/selectedCalendars") + async updateSelectedCalendars( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: SelectedCalendarWhereUniqueInput[] + ): Promise<void> { + const data = { + selectedCalendars: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/selectedCalendars") + async disconnectSelectedCalendars( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: SelectedCalendarWhereUniqueInput[] + ): Promise<void> { + const data = { + selectedCalendars: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/webhooks") + @ApiNestedQuery(WebhookFindManyArgs) + async findWebhooks( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Webhook[]> { + const query = plainToClass(WebhookFindManyArgs, request.query); + const results = await this.service.findWebhooks(params.id, { + ...query, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/webhooks") + async connectWebhooks( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhooks: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/webhooks") + async updateWebhooks( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhooks: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/webhooks") + async disconnectWebhooks( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: WebhookWhereUniqueInput[] + ): Promise<void> { + const data = { + webhooks: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/impersonatedUsers") + @ApiNestedQuery(ImpersonationFindManyArgs) + async findImpersonatedUsers( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Impersonation[]> { + const query = plainToClass(ImpersonationFindManyArgs, request.query); + const results = await this.service.findImpersonatedUsers(params.id, { + ...query, + select: { + id: true, + createdAt: true, + + impersonatedUser: { + select: { + id: true, + }, + }, + + impersonatedBy: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/impersonatedUsers") + async connectImpersonatedUsers( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ImpersonationWhereUniqueInput[] + ): Promise<void> { + const data = { + impersonatedUsers: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/impersonatedUsers") + async updateImpersonatedUsers( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ImpersonationWhereUniqueInput[] + ): Promise<void> { + const data = { + impersonatedUsers: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/impersonatedUsers") + async disconnectImpersonatedUsers( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ImpersonationWhereUniqueInput[] + ): Promise<void> { + const data = { + impersonatedUsers: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/impersonatedBy") + @ApiNestedQuery(ImpersonationFindManyArgs) + async findImpersonatedBy( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Impersonation[]> { + const query = plainToClass(ImpersonationFindManyArgs, request.query); + const results = await this.service.findImpersonatedBy(params.id, { + ...query, + select: { + id: true, + createdAt: true, + + impersonatedUser: { + select: { + id: true, + }, + }, + + impersonatedBy: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/impersonatedBy") + async connectImpersonatedBy( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ImpersonationWhereUniqueInput[] + ): Promise<void> { + const data = { + impersonatedBy: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/impersonatedBy") + async updateImpersonatedBy( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ImpersonationWhereUniqueInput[] + ): Promise<void> { + const data = { + impersonatedBy: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/impersonatedBy") + async disconnectImpersonatedBy( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ImpersonationWhereUniqueInput[] + ): Promise<void> { + const data = { + impersonatedBy: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/apiKeys") + @ApiNestedQuery(ApiKeyFindManyArgs) + async findApiKeys( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<ApiKey[]> { + const query = plainToClass(ApiKeyFindManyArgs, request.query); + const results = await this.service.findApiKeys(params.id, { + ...query, + select: { + id: true, + note: true, + createdAt: true, + expiresAt: true, + lastUsedAt: true, + hashedKey: true, + + user: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/apiKeys") + async connectApiKeys( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ApiKeyWhereUniqueInput[] + ): Promise<void> { + const data = { + apiKeys: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/apiKeys") + async updateApiKeys( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ApiKeyWhereUniqueInput[] + ): Promise<void> { + const data = { + apiKeys: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/apiKeys") + async disconnectApiKeys( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: ApiKeyWhereUniqueInput[] + ): Promise<void> { + const data = { + apiKeys: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/accounts") + @ApiNestedQuery(AccountFindManyArgs) + async findAccounts( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Account[]> { + const query = plainToClass(AccountFindManyArgs, request.query); + const results = await this.service.findAccounts(params.id, { + ...query, + select: { + id: true, + typeField: true, + provider: true, + providerAccountId: true, + refreshToken: true, + accessToken: true, + expiresAt: true, + tokenType: true, + scope: true, + idToken: true, + sessionState: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/accounts") + async connectAccounts( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: AccountWhereUniqueInput[] + ): Promise<void> { + const data = { + accounts: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/accounts") + async updateAccounts( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: AccountWhereUniqueInput[] + ): Promise<void> { + const data = { + accounts: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/accounts") + async disconnectAccounts( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: AccountWhereUniqueInput[] + ): Promise<void> { + const data = { + accounts: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/sessions") + @ApiNestedQuery(SessionFindManyArgs) + async findSessions( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Session[]> { + const query = plainToClass(SessionFindManyArgs, request.query); + const results = await this.service.findSessions(params.id, { + ...query, + select: { + id: true, + sessionToken: true, + expires: true, + + user: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/sessions") + async connectSessions( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: SessionWhereUniqueInput[] + ): Promise<void> { + const data = { + sessions: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/sessions") + async updateSessions( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: SessionWhereUniqueInput[] + ): Promise<void> { + const data = { + sessions: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/sessions") + async disconnectSessions( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: SessionWhereUniqueInput[] + ): Promise<void> { + const data = { + sessions: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/feedback") + @ApiNestedQuery(FeedbackFindManyArgs) + async findFeedback( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Feedback[]> { + const query = plainToClass(FeedbackFindManyArgs, request.query); + const results = await this.service.findFeedback(params.id, { + ...query, + select: { + id: true, + date: true, + + user: { + select: { + id: true, + }, + }, + + rating: true, + comment: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/feedback") + async connectFeedback( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: FeedbackWhereUniqueInput[] + ): Promise<void> { + const data = { + feedback: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/feedback") + async updateFeedback( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: FeedbackWhereUniqueInput[] + ): Promise<void> { + const data = { + feedback: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/feedback") + async disconnectFeedback( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: FeedbackWhereUniqueInput[] + ): Promise<void> { + const data = { + feedback: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/workflows") + @ApiNestedQuery(WorkflowFindManyArgs) + async findWorkflows( + @common.Req() request: Request, + @common.Param() params: UserWhereUniqueInput + ): Promise<Workflow[]> { + const query = plainToClass(WorkflowFindManyArgs, request.query); + const results = await this.service.findWorkflows(params.id, { + ...query, + select: { + id: true, + name: true, + + user: { + select: { + id: true, + }, + }, + + trigger: true, + time: true, + timeUnit: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/workflows") + async connectWorkflows( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: WorkflowWhereUniqueInput[] + ): Promise<void> { + const data = { + workflows: { + connect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/workflows") + async updateWorkflows( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: WorkflowWhereUniqueInput[] + ): Promise<void> { + const data = { + workflows: { + set: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/workflows") + async disconnectWorkflows( + @common.Param() params: UserWhereUniqueInput, + @common.Body() body: WorkflowWhereUniqueInput[] + ): Promise<void> { + const data = { + workflows: { + disconnect: body, + }, + }; + await this.service.updateUser({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/user/base/user.module.base.ts b/apps/roi-cacl-2/src/user/base/user.module.base.ts new file mode 100644 index 0000000..87dbcf8 --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/user.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class UserModuleBase {} diff --git a/apps/roi-cacl-2/src/user/base/user.resolver.base.ts b/apps/roi-cacl-2/src/user/base/user.resolver.base.ts new file mode 100644 index 0000000..b325b7f --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/user.resolver.base.ts @@ -0,0 +1,359 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { User } from "./User"; +import { UserCountArgs } from "./UserCountArgs"; +import { UserFindManyArgs } from "./UserFindManyArgs"; +import { UserFindUniqueArgs } from "./UserFindUniqueArgs"; +import { CreateUserArgs } from "./CreateUserArgs"; +import { UpdateUserArgs } from "./UpdateUserArgs"; +import { DeleteUserArgs } from "./DeleteUserArgs"; +import { EventTypeFindManyArgs } from "../../eventType/base/EventTypeFindManyArgs"; +import { EventType } from "../../eventType/base/EventType"; +import { CredentialFindManyArgs } from "../../credential/base/CredentialFindManyArgs"; +import { Credential } from "../../credential/base/Credential"; +import { MembershipFindManyArgs } from "../../membership/base/MembershipFindManyArgs"; +import { Membership } from "../../membership/base/Membership"; +import { BookingFindManyArgs } from "../../booking/base/BookingFindManyArgs"; +import { Booking } from "../../booking/base/Booking"; +import { ScheduleFindManyArgs } from "../../schedule/base/ScheduleFindManyArgs"; +import { Schedule } from "../../schedule/base/Schedule"; +import { AvailabilityFindManyArgs } from "../../availability/base/AvailabilityFindManyArgs"; +import { Availability } from "../../availability/base/Availability"; +import { SelectedCalendarFindManyArgs } from "../../selectedCalendar/base/SelectedCalendarFindManyArgs"; +import { SelectedCalendar } from "../../selectedCalendar/base/SelectedCalendar"; +import { WebhookFindManyArgs } from "../../webhook/base/WebhookFindManyArgs"; +import { Webhook } from "../../webhook/base/Webhook"; +import { ImpersonationFindManyArgs } from "../../impersonation/base/ImpersonationFindManyArgs"; +import { Impersonation } from "../../impersonation/base/Impersonation"; +import { ApiKeyFindManyArgs } from "../../apiKey/base/ApiKeyFindManyArgs"; +import { ApiKey } from "../../apiKey/base/ApiKey"; +import { AccountFindManyArgs } from "../../account/base/AccountFindManyArgs"; +import { Account } from "../../account/base/Account"; +import { SessionFindManyArgs } from "../../session/base/SessionFindManyArgs"; +import { Session } from "../../session/base/Session"; +import { FeedbackFindManyArgs } from "../../feedback/base/FeedbackFindManyArgs"; +import { Feedback } from "../../feedback/base/Feedback"; +import { WorkflowFindManyArgs } from "../../workflow/base/WorkflowFindManyArgs"; +import { Workflow } from "../../workflow/base/Workflow"; +import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; +import { UserService } from "../user.service"; +@graphql.Resolver(() => User) +export class UserResolverBase { + constructor(protected readonly service: UserService) {} + + async _usersMeta( + @graphql.Args() args: UserCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [User]) + async users(@graphql.Args() args: UserFindManyArgs): Promise<User[]> { + return this.service.users(args); + } + + @graphql.Query(() => User, { nullable: true }) + async user(@graphql.Args() args: UserFindUniqueArgs): Promise<User | null> { + const result = await this.service.user(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => User) + async createUser(@graphql.Args() args: CreateUserArgs): Promise<User> { + return await this.service.createUser({ + ...args, + data: { + ...args.data, + + destinationCalendar: args.data.destinationCalendar + ? { + connect: args.data.destinationCalendar, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => User) + async updateUser(@graphql.Args() args: UpdateUserArgs): Promise<User | null> { + try { + return await this.service.updateUser({ + ...args, + data: { + ...args.data, + + destinationCalendar: args.data.destinationCalendar + ? { + connect: args.data.destinationCalendar, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => User) + async deleteUser(@graphql.Args() args: DeleteUserArgs): Promise<User | null> { + try { + return await this.service.deleteUser(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [EventType], { name: "eventTypes" }) + async findEventTypes( + @graphql.Parent() parent: User, + @graphql.Args() args: EventTypeFindManyArgs + ): Promise<EventType[]> { + const results = await this.service.findEventTypes(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Credential], { name: "credentials" }) + async findCredentials( + @graphql.Parent() parent: User, + @graphql.Args() args: CredentialFindManyArgs + ): Promise<Credential[]> { + const results = await this.service.findCredentials(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Membership], { name: "teams" }) + async findTeams( + @graphql.Parent() parent: User, + @graphql.Args() args: MembershipFindManyArgs + ): Promise<Membership[]> { + const results = await this.service.findTeams(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Booking], { name: "bookings" }) + async findBookings( + @graphql.Parent() parent: User, + @graphql.Args() args: BookingFindManyArgs + ): Promise<Booking[]> { + const results = await this.service.findBookings(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Schedule], { name: "schedules" }) + async findSchedules( + @graphql.Parent() parent: User, + @graphql.Args() args: ScheduleFindManyArgs + ): Promise<Schedule[]> { + const results = await this.service.findSchedules(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Availability], { name: "availability" }) + async findAvailability( + @graphql.Parent() parent: User, + @graphql.Args() args: AvailabilityFindManyArgs + ): Promise<Availability[]> { + const results = await this.service.findAvailability(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [SelectedCalendar], { name: "selectedCalendars" }) + async findSelectedCalendars( + @graphql.Parent() parent: User, + @graphql.Args() args: SelectedCalendarFindManyArgs + ): Promise<SelectedCalendar[]> { + const results = await this.service.findSelectedCalendars(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Webhook], { name: "webhooks" }) + async findWebhooks( + @graphql.Parent() parent: User, + @graphql.Args() args: WebhookFindManyArgs + ): Promise<Webhook[]> { + const results = await this.service.findWebhooks(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Impersonation], { name: "impersonatedUsers" }) + async findImpersonatedUsers( + @graphql.Parent() parent: User, + @graphql.Args() args: ImpersonationFindManyArgs + ): Promise<Impersonation[]> { + const results = await this.service.findImpersonatedUsers(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Impersonation], { name: "impersonatedBy" }) + async findImpersonatedBy( + @graphql.Parent() parent: User, + @graphql.Args() args: ImpersonationFindManyArgs + ): Promise<Impersonation[]> { + const results = await this.service.findImpersonatedBy(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [ApiKey], { name: "apiKeys" }) + async findApiKeys( + @graphql.Parent() parent: User, + @graphql.Args() args: ApiKeyFindManyArgs + ): Promise<ApiKey[]> { + const results = await this.service.findApiKeys(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Account], { name: "accounts" }) + async findAccounts( + @graphql.Parent() parent: User, + @graphql.Args() args: AccountFindManyArgs + ): Promise<Account[]> { + const results = await this.service.findAccounts(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Session], { name: "sessions" }) + async findSessions( + @graphql.Parent() parent: User, + @graphql.Args() args: SessionFindManyArgs + ): Promise<Session[]> { + const results = await this.service.findSessions(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Feedback], { name: "feedback" }) + async findFeedback( + @graphql.Parent() parent: User, + @graphql.Args() args: FeedbackFindManyArgs + ): Promise<Feedback[]> { + const results = await this.service.findFeedback(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [Workflow], { name: "workflows" }) + async findWorkflows( + @graphql.Parent() parent: User, + @graphql.Args() args: WorkflowFindManyArgs + ): Promise<Workflow[]> { + const results = await this.service.findWorkflows(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => DestinationCalendar, { + nullable: true, + name: "destinationCalendar", + }) + async getDestinationCalendar( + @graphql.Parent() parent: User + ): Promise<DestinationCalendar | null> { + const result = await this.service.getDestinationCalendar(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/user/base/user.service.base.ts b/apps/roi-cacl-2/src/user/base/user.service.base.ts new file mode 100644 index 0000000..270192a --- /dev/null +++ b/apps/roi-cacl-2/src/user/base/user.service.base.ts @@ -0,0 +1,241 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + User as PrismaUser, + EventType as PrismaEventType, + Credential as PrismaCredential, + Membership as PrismaMembership, + Booking as PrismaBooking, + Schedule as PrismaSchedule, + Availability as PrismaAvailability, + SelectedCalendar as PrismaSelectedCalendar, + Webhook as PrismaWebhook, + Impersonation as PrismaImpersonation, + ApiKey as PrismaApiKey, + Account as PrismaAccount, + Session as PrismaSession, + Feedback as PrismaFeedback, + Workflow as PrismaWorkflow, + DestinationCalendar as PrismaDestinationCalendar, +} from "@prisma/client"; + +export class UserServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.UserCountArgs, "select">): Promise<number> { + return this.prisma.user.count(args); + } + + async users<T extends Prisma.UserFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.UserFindManyArgs> + ): Promise<PrismaUser[]> { + return this.prisma.user.findMany<Prisma.UserFindManyArgs>(args); + } + async user<T extends Prisma.UserFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.UserFindUniqueArgs> + ): Promise<PrismaUser | null> { + return this.prisma.user.findUnique(args); + } + async createUser<T extends Prisma.UserCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.UserCreateArgs> + ): Promise<PrismaUser> { + return this.prisma.user.create<T>(args); + } + async updateUser<T extends Prisma.UserUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.UserUpdateArgs> + ): Promise<PrismaUser> { + return this.prisma.user.update<T>(args); + } + async deleteUser<T extends Prisma.UserDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.UserDeleteArgs> + ): Promise<PrismaUser> { + return this.prisma.user.delete(args); + } + + async findEventTypes( + parentId: number, + args: Prisma.EventTypeFindManyArgs + ): Promise<PrismaEventType[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .eventTypes(args); + } + + async findCredentials( + parentId: number, + args: Prisma.CredentialFindManyArgs + ): Promise<PrismaCredential[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .credentials(args); + } + + async findTeams( + parentId: number, + args: Prisma.MembershipFindManyArgs + ): Promise<PrismaMembership[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .teams(args); + } + + async findBookings( + parentId: number, + args: Prisma.BookingFindManyArgs + ): Promise<PrismaBooking[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .bookings(args); + } + + async findSchedules( + parentId: number, + args: Prisma.ScheduleFindManyArgs + ): Promise<PrismaSchedule[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .schedules(args); + } + + async findAvailability( + parentId: number, + args: Prisma.AvailabilityFindManyArgs + ): Promise<PrismaAvailability[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .availability(args); + } + + async findSelectedCalendars( + parentId: number, + args: Prisma.SelectedCalendarFindManyArgs + ): Promise<PrismaSelectedCalendar[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .selectedCalendars(args); + } + + async findWebhooks( + parentId: number, + args: Prisma.WebhookFindManyArgs + ): Promise<PrismaWebhook[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .webhooks(args); + } + + async findImpersonatedUsers( + parentId: number, + args: Prisma.ImpersonationFindManyArgs + ): Promise<PrismaImpersonation[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .impersonatedUsers(args); + } + + async findImpersonatedBy( + parentId: number, + args: Prisma.ImpersonationFindManyArgs + ): Promise<PrismaImpersonation[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .impersonatedBy(args); + } + + async findApiKeys( + parentId: number, + args: Prisma.ApiKeyFindManyArgs + ): Promise<PrismaApiKey[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .apiKeys(args); + } + + async findAccounts( + parentId: number, + args: Prisma.AccountFindManyArgs + ): Promise<PrismaAccount[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .accounts(args); + } + + async findSessions( + parentId: number, + args: Prisma.SessionFindManyArgs + ): Promise<PrismaSession[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .sessions(args); + } + + async findFeedback( + parentId: number, + args: Prisma.FeedbackFindManyArgs + ): Promise<PrismaFeedback[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .feedback(args); + } + + async findWorkflows( + parentId: number, + args: Prisma.WorkflowFindManyArgs + ): Promise<PrismaWorkflow[]> { + return this.prisma.user + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .workflows(args); + } + + async getDestinationCalendar( + parentId: number + ): Promise<PrismaDestinationCalendar | null> { + return this.prisma.user + .findUnique({ + where: { id: parentId }, + }) + .destinationCalendar(); + } +} diff --git a/apps/roi-cacl-2/src/user/user.controller.ts b/apps/roi-cacl-2/src/user/user.controller.ts new file mode 100644 index 0000000..b783f3c --- /dev/null +++ b/apps/roi-cacl-2/src/user/user.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { UserService } from "./user.service"; +import { UserControllerBase } from "./base/user.controller.base"; + +@swagger.ApiTags("users") +@common.Controller("users") +export class UserController extends UserControllerBase { + constructor(protected readonly service: UserService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/user/user.module.ts b/apps/roi-cacl-2/src/user/user.module.ts new file mode 100644 index 0000000..6fb3d60 --- /dev/null +++ b/apps/roi-cacl-2/src/user/user.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { UserModuleBase } from "./base/user.module.base"; +import { UserService } from "./user.service"; +import { UserController } from "./user.controller"; +import { UserResolver } from "./user.resolver"; + +@Module({ + imports: [UserModuleBase], + controllers: [UserController], + providers: [UserService, UserResolver], + exports: [UserService], +}) +export class UserModule {} diff --git a/apps/roi-cacl-2/src/user/user.resolver.ts b/apps/roi-cacl-2/src/user/user.resolver.ts new file mode 100644 index 0000000..9997b13 --- /dev/null +++ b/apps/roi-cacl-2/src/user/user.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { UserResolverBase } from "./base/user.resolver.base"; +import { User } from "./base/User"; +import { UserService } from "./user.service"; + +@graphql.Resolver(() => User) +export class UserResolver extends UserResolverBase { + constructor(protected readonly service: UserService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/user/user.service.ts b/apps/roi-cacl-2/src/user/user.service.ts new file mode 100644 index 0000000..cae0388 --- /dev/null +++ b/apps/roi-cacl-2/src/user/user.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { UserServiceBase } from "./base/user.service.base"; + +@Injectable() +export class UserService extends UserServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/util/BooleanFilter.ts b/apps/roi-cacl-2/src/util/BooleanFilter.ts new file mode 100644 index 0000000..75f4e34 --- /dev/null +++ b/apps/roi-cacl-2/src/util/BooleanFilter.ts @@ -0,0 +1,32 @@ +import { Field, InputType } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +export class BooleanFilter { + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + @Type(() => Boolean) + equals?: boolean; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + @Type(() => Boolean) + not?: boolean; +} diff --git a/apps/roi-cacl-2/src/util/BooleanNullableFilter.ts b/apps/roi-cacl-2/src/util/BooleanNullableFilter.ts new file mode 100644 index 0000000..9f48ac1 --- /dev/null +++ b/apps/roi-cacl-2/src/util/BooleanNullableFilter.ts @@ -0,0 +1,31 @@ +import { Field, InputType } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +@InputType({ + isAbstract: true, + description: undefined, +}) +export class BooleanNullableFilter { + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + @Type(() => Boolean) + equals?: boolean | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + @Type(() => Boolean) + not?: boolean | null; +} diff --git a/apps/roi-cacl-2/src/util/DateTimeFilter.ts b/apps/roi-cacl-2/src/util/DateTimeFilter.ts new file mode 100644 index 0000000..d2b6dfb --- /dev/null +++ b/apps/roi-cacl-2/src/util/DateTimeFilter.ts @@ -0,0 +1,97 @@ +import { Field, InputType } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +@InputType({ + isAbstract: true, + description: undefined, +}) +export class DateTimeFilter { + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + equals?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + not?: Date; + + @ApiProperty({ + required: false, + type: [Date], + }) + @IsOptional() + @Field(() => [Date], { + nullable: true, + }) + @Type(() => Date) + in?: Date[]; + + @ApiProperty({ + required: false, + type: [Date], + }) + @IsOptional() + @Field(() => [Date], { + nullable: true, + }) + @Type(() => Date) + notIn?: Date[]; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + lt?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + lte?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + gt?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + gte?: Date; +} diff --git a/apps/roi-cacl-2/src/util/DateTimeNullableFilter.ts b/apps/roi-cacl-2/src/util/DateTimeNullableFilter.ts new file mode 100644 index 0000000..ccc00a5 --- /dev/null +++ b/apps/roi-cacl-2/src/util/DateTimeNullableFilter.ts @@ -0,0 +1,97 @@ +import { Field, InputType } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +@InputType({ + isAbstract: true, + description: undefined, +}) +export class DateTimeNullableFilter { + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + equals?: Date | null; + + @ApiProperty({ + required: false, + type: [Date], + }) + @IsOptional() + @Field(() => [Date], { + nullable: true, + }) + @Type(() => Date) + in?: Date[] | null; + + @ApiProperty({ + required: false, + type: [Date], + }) + @IsOptional() + @Field(() => [Date], { + nullable: true, + }) + @Type(() => Date) + notIn?: Date[] | null; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + lt?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + lte?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + gt?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + gte?: Date; + + @ApiProperty({ + required: false, + type: Date, + }) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + @Type(() => Date) + not?: Date; +} diff --git a/apps/roi-cacl-2/src/util/FloatFilter.ts b/apps/roi-cacl-2/src/util/FloatFilter.ts new file mode 100644 index 0000000..a3266d2 --- /dev/null +++ b/apps/roi-cacl-2/src/util/FloatFilter.ts @@ -0,0 +1,98 @@ +import { Field, InputType, Float } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +export class FloatFilter { + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + equals?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => [Float], { + nullable: true, + }) + @Type(() => Number) + in?: number[]; + + @ApiProperty({ + required: false, + type: [Number], + }) + @IsOptional() + @Field(() => [Float], { + nullable: true, + }) + @Type(() => Number) + notIn?: number[]; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + lt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + lte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + gt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + gte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + not?: number; +} diff --git a/apps/roi-cacl-2/src/util/FloatNullableFilter.ts b/apps/roi-cacl-2/src/util/FloatNullableFilter.ts new file mode 100644 index 0000000..feb0fc5 --- /dev/null +++ b/apps/roi-cacl-2/src/util/FloatNullableFilter.ts @@ -0,0 +1,98 @@ +import { Field, InputType, Float } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +export class FloatNullableFilter { + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + equals?: number | null; + + @ApiProperty({ + required: false, + type: [Number], + }) + @IsOptional() + @Field(() => [Float], { + nullable: true, + }) + @Type(() => Number) + in?: number[] | null; + + @ApiProperty({ + required: false, + type: [Number], + }) + @IsOptional() + @Field(() => [Float], { + nullable: true, + }) + @Type(() => Number) + notIn?: number[] | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + lt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + lte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + gt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + gte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Float, { + nullable: true, + }) + @Type(() => Number) + not?: number; +} diff --git a/apps/roi-cacl-2/src/util/IntFilter.ts b/apps/roi-cacl-2/src/util/IntFilter.ts new file mode 100644 index 0000000..f6880e7 --- /dev/null +++ b/apps/roi-cacl-2/src/util/IntFilter.ts @@ -0,0 +1,98 @@ +import { Field, InputType, Int } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +export class IntFilter { + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + equals?: number; + + @ApiProperty({ + required: false, + type: [Number], + }) + @IsOptional() + @Field(() => [Int], { + nullable: true, + }) + @Type(() => Number) + in?: number[]; + + @ApiProperty({ + required: false, + type: [Number], + }) + @IsOptional() + @Field(() => [Int], { + nullable: true, + }) + @Type(() => Number) + notIn?: number[]; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + lt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + lte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + gt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + gte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + not?: number; +} diff --git a/apps/roi-cacl-2/src/util/IntNullableFilter.ts b/apps/roi-cacl-2/src/util/IntNullableFilter.ts new file mode 100644 index 0000000..e3b71a3 --- /dev/null +++ b/apps/roi-cacl-2/src/util/IntNullableFilter.ts @@ -0,0 +1,98 @@ +import { Field, InputType, Int } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +export class IntNullableFilter { + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + equals?: number | null; + + @ApiProperty({ + required: false, + type: [Number], + }) + @IsOptional() + @Field(() => [Int], { + nullable: true, + }) + @Type(() => Number) + in?: number[] | null; + + @ApiProperty({ + required: false, + type: [Number], + }) + @IsOptional() + @Field(() => [Int], { + nullable: true, + }) + @Type(() => Number) + notIn?: number[] | null; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + lt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + lte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + gt?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + gte?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @Field(() => Int, { + nullable: true, + }) + @Type(() => Number) + not?: number; +} diff --git a/apps/roi-cacl-2/src/util/JsonFilter.ts b/apps/roi-cacl-2/src/util/JsonFilter.ts new file mode 100644 index 0000000..7040b74 --- /dev/null +++ b/apps/roi-cacl-2/src/util/JsonFilter.ts @@ -0,0 +1,31 @@ +import { Field, InputType } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { GraphQLJSONObject } from "graphql-type-json"; +import { InputJsonValue } from "../types"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +export class JsonFilter { + @ApiProperty({ + required: false, + type: GraphQLJSONObject, + }) + @IsOptional() + @Field(() => GraphQLJSONObject, { + nullable: true, + }) + equals?: InputJsonValue; + + @ApiProperty({ + required: false, + type: GraphQLJSONObject, + }) + @IsOptional() + @Field(() => GraphQLJSONObject, { + nullable: true, + }) + not?: InputJsonValue; +} diff --git a/apps/roi-cacl-2/src/util/JsonNullableFilter.ts b/apps/roi-cacl-2/src/util/JsonNullableFilter.ts new file mode 100644 index 0000000..3381d52 --- /dev/null +++ b/apps/roi-cacl-2/src/util/JsonNullableFilter.ts @@ -0,0 +1,31 @@ +import type { JsonValue } from "type-fest"; +import { Field, InputType } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { GraphQLJSONObject } from "graphql-type-json"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +export class JsonNullableFilter { + @ApiProperty({ + required: false, + type: GraphQLJSONObject, + }) + @IsOptional() + @Field(() => GraphQLJSONObject, { + nullable: true, + }) + equals?: JsonValue; + + @ApiProperty({ + required: false, + type: GraphQLJSONObject, + }) + @IsOptional() + @Field(() => GraphQLJSONObject, { + nullable: true, + }) + not?: JsonValue; +} diff --git a/apps/roi-cacl-2/src/util/MetaQueryPayload.ts b/apps/roi-cacl-2/src/util/MetaQueryPayload.ts new file mode 100644 index 0000000..fc30531 --- /dev/null +++ b/apps/roi-cacl-2/src/util/MetaQueryPayload.ts @@ -0,0 +1,13 @@ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; + +@ObjectType() +class MetaQueryPayload { + @ApiProperty({ + required: true, + type: [Number], + }) + @Field(() => Number) + count!: number; +} +export { MetaQueryPayload }; diff --git a/apps/roi-cacl-2/src/util/QueryMode.ts b/apps/roi-cacl-2/src/util/QueryMode.ts new file mode 100644 index 0000000..f9b1653 --- /dev/null +++ b/apps/roi-cacl-2/src/util/QueryMode.ts @@ -0,0 +1,10 @@ +import { registerEnumType } from "@nestjs/graphql"; + +export enum QueryMode { + Default = "default", + Insensitive = "insensitive", +} +registerEnumType(QueryMode, { + name: "QueryMode", + description: undefined, +}); diff --git a/apps/roi-cacl-2/src/util/SortOrder.ts b/apps/roi-cacl-2/src/util/SortOrder.ts new file mode 100644 index 0000000..d4108e6 --- /dev/null +++ b/apps/roi-cacl-2/src/util/SortOrder.ts @@ -0,0 +1,10 @@ +import { registerEnumType } from "@nestjs/graphql"; + +export enum SortOrder { + Asc = "asc", + Desc = "desc", +} +registerEnumType(SortOrder, { + name: "SortOrder", + description: undefined, +}); diff --git a/apps/roi-cacl-2/src/util/StringFilter.ts b/apps/roi-cacl-2/src/util/StringFilter.ts new file mode 100644 index 0000000..80b573d --- /dev/null +++ b/apps/roi-cacl-2/src/util/StringFilter.ts @@ -0,0 +1,141 @@ +import { Field, InputType } from "@nestjs/graphql"; +import { QueryMode } from "./QueryMode"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType({ + isAbstract: true, +}) +export class StringFilter { + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + equals?: string; + + @ApiProperty({ + required: false, + type: [String], + }) + @IsOptional() + @Field(() => [String], { + nullable: true, + }) + @Type(() => String) + in?: string[]; + + @ApiProperty({ + required: false, + type: [String], + }) + @IsOptional() + @Field(() => [String], { + nullable: true, + }) + @Type(() => String) + notIn?: string[]; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + lt?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + lte?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + gt?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + gte?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + contains?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + startsWith?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + endsWith?: string; + + @ApiProperty({ + required: false, + enum: ["Default", "Insensitive"], + }) + @IsOptional() + @Field(() => QueryMode, { + nullable: true, + }) + mode?: QueryMode; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + not?: string; +} diff --git a/apps/roi-cacl-2/src/util/StringNullableFilter.ts b/apps/roi-cacl-2/src/util/StringNullableFilter.ts new file mode 100644 index 0000000..01b399c --- /dev/null +++ b/apps/roi-cacl-2/src/util/StringNullableFilter.ts @@ -0,0 +1,141 @@ +import { Field, InputType } from "@nestjs/graphql"; +import { QueryMode } from "./QueryMode"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType({ + isAbstract: true, +}) +export class StringNullableFilter { + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + equals?: string | null; + + @ApiProperty({ + required: false, + type: [String], + }) + @IsOptional() + @Field(() => [String], { + nullable: true, + }) + @Type(() => String) + in?: string[] | null; + + @ApiProperty({ + required: false, + type: [String], + }) + @IsOptional() + @Field(() => [String], { + nullable: true, + }) + @Type(() => String) + notIn?: string[] | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + lt?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + lte?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + gt?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + gte?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + contains?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + startsWith?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + endsWith?: string; + + @ApiProperty({ + required: false, + enum: ["Default", "Insensitive"], + }) + @IsOptional() + @Field(() => QueryMode, { + nullable: true, + }) + mode?: QueryMode; + + @ApiProperty({ + required: false, + type: String, + }) + @IsOptional() + @Field(() => String, { + nullable: true, + }) + @Type(() => String) + not?: string; +} diff --git a/apps/roi-cacl-2/src/validators/index.ts b/apps/roi-cacl-2/src/validators/index.ts new file mode 100644 index 0000000..7f62d84 --- /dev/null +++ b/apps/roi-cacl-2/src/validators/index.ts @@ -0,0 +1 @@ +export * from "./is-json-value-validator"; diff --git a/apps/roi-cacl-2/src/validators/is-json-value-validator.spec.ts b/apps/roi-cacl-2/src/validators/is-json-value-validator.spec.ts new file mode 100644 index 0000000..5a77824 --- /dev/null +++ b/apps/roi-cacl-2/src/validators/is-json-value-validator.spec.ts @@ -0,0 +1,44 @@ +import { validate, ValidationError } from "class-validator"; +import { IsJSONValue } from "./is-json-value-validator"; + +class TestClass { + @IsJSONValue() + jsonProperty: unknown; +} + +describe("IsJSONValue", () => { + it("should validate a valid JSON string", async () => { + const testObj = new TestClass(); + testObj.jsonProperty = '{"name": "John", "age": 30}'; + const errors: ValidationError[] = await validate(testObj); + expect(errors.length).toBe(0); + }); + + it("should not validate an invalid JSON string", async () => { + const testObj = new TestClass(); + testObj.jsonProperty = '{name: "John", age: 30}'; + const errors: ValidationError[] = await validate(testObj); + expect(errors.length).toBe(1); + }); + + it("should not validate an invalid JSON string", async () => { + const testObj = new TestClass(); + testObj.jsonProperty = "John"; + const errors: ValidationError[] = await validate(testObj); + expect(errors.length).toBe(1); + }); + + it("should validate a valid JSON object", async () => { + const testObj = new TestClass(); + testObj.jsonProperty = { name: "John", age: 30 }; + const errors: ValidationError[] = await validate(testObj); + expect(errors.length).toBe(0); + }); + + it("should validate a valid JSON array", async () => { + const testObj = new TestClass(); + testObj.jsonProperty = ["John", "30"]; + const errors: ValidationError[] = await validate(testObj); + expect(errors.length).toBe(0); + }); +}); diff --git a/apps/roi-cacl-2/src/validators/is-json-value-validator.ts b/apps/roi-cacl-2/src/validators/is-json-value-validator.ts new file mode 100644 index 0000000..1002540 --- /dev/null +++ b/apps/roi-cacl-2/src/validators/is-json-value-validator.ts @@ -0,0 +1,29 @@ +import { + ValidationArguments, + registerDecorator, + ValidationOptions, +} from "class-validator"; +import isJSONValidator from "validator/lib/isJSON"; + +export function IsJSONValue(validationOptions?: ValidationOptions) { + return function (object: Record<string, any>, propertyName: string) { + registerDecorator({ + name: "IsJSONValue", + target: object.constructor, + propertyName: propertyName, + options: validationOptions, + validator: { + validate(value: any, args: ValidationArguments) { + if (typeof value === "string") { + return isJSONValidator(value); + } + + return isJSONValidator(JSON.stringify(value)); + }, + defaultMessage(args: ValidationArguments): string { + return `${args.property} must be a valid json`; + }, + }, + }); + }; +} diff --git a/apps/roi-cacl-2/src/verificationToken/base/CreateVerificationTokenArgs.ts b/apps/roi-cacl-2/src/verificationToken/base/CreateVerificationTokenArgs.ts new file mode 100644 index 0000000..cbf8894 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/CreateVerificationTokenArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { VerificationTokenCreateInput } from "./VerificationTokenCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateVerificationTokenArgs { + @ApiProperty({ + required: true, + type: () => VerificationTokenCreateInput, + }) + @ValidateNested() + @Type(() => VerificationTokenCreateInput) + @Field(() => VerificationTokenCreateInput, { nullable: false }) + data!: VerificationTokenCreateInput; +} + +export { CreateVerificationTokenArgs as CreateVerificationTokenArgs }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/DeleteVerificationTokenArgs.ts b/apps/roi-cacl-2/src/verificationToken/base/DeleteVerificationTokenArgs.ts new file mode 100644 index 0000000..1dd7e24 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/DeleteVerificationTokenArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { VerificationTokenWhereUniqueInput } from "./VerificationTokenWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteVerificationTokenArgs { + @ApiProperty({ + required: true, + type: () => VerificationTokenWhereUniqueInput, + }) + @ValidateNested() + @Type(() => VerificationTokenWhereUniqueInput) + @Field(() => VerificationTokenWhereUniqueInput, { nullable: false }) + where!: VerificationTokenWhereUniqueInput; +} + +export { DeleteVerificationTokenArgs as DeleteVerificationTokenArgs }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/UpdateVerificationTokenArgs.ts b/apps/roi-cacl-2/src/verificationToken/base/UpdateVerificationTokenArgs.ts new file mode 100644 index 0000000..6628262 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/UpdateVerificationTokenArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { VerificationTokenWhereUniqueInput } from "./VerificationTokenWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { VerificationTokenUpdateInput } from "./VerificationTokenUpdateInput"; + +@ArgsType() +class UpdateVerificationTokenArgs { + @ApiProperty({ + required: true, + type: () => VerificationTokenWhereUniqueInput, + }) + @ValidateNested() + @Type(() => VerificationTokenWhereUniqueInput) + @Field(() => VerificationTokenWhereUniqueInput, { nullable: false }) + where!: VerificationTokenWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => VerificationTokenUpdateInput, + }) + @ValidateNested() + @Type(() => VerificationTokenUpdateInput) + @Field(() => VerificationTokenUpdateInput, { nullable: false }) + data!: VerificationTokenUpdateInput; +} + +export { UpdateVerificationTokenArgs as UpdateVerificationTokenArgs }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationToken.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationToken.ts new file mode 100644 index 0000000..ec6f587 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationToken.ts @@ -0,0 +1,68 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, IsString, IsDate } from "class-validator"; +import { Type } from "class-transformer"; + +@ObjectType() +class VerificationToken { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + identifier!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + token!: string; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + expires!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + updatedAt!: Date; +} + +export { VerificationToken as VerificationToken }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCountArgs.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCountArgs.ts new file mode 100644 index 0000000..072dbf8 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { VerificationTokenWhereInput } from "./VerificationTokenWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class VerificationTokenCountArgs { + @ApiProperty({ + required: false, + type: () => VerificationTokenWhereInput, + }) + @Field(() => VerificationTokenWhereInput, { nullable: true }) + @Type(() => VerificationTokenWhereInput) + where?: VerificationTokenWhereInput; +} + +export { VerificationTokenCountArgs as VerificationTokenCountArgs }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCreateInput.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCreateInput.ts new file mode 100644 index 0000000..1c2ce78 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenCreateInput.ts @@ -0,0 +1,44 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsDate } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class VerificationTokenCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + identifier!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + token!: string; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + expires!: Date; +} + +export { VerificationTokenCreateInput as VerificationTokenCreateInput }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindManyArgs.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindManyArgs.ts new file mode 100644 index 0000000..a0e1c98 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { VerificationTokenWhereInput } from "./VerificationTokenWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { VerificationTokenOrderByInput } from "./VerificationTokenOrderByInput"; + +@ArgsType() +class VerificationTokenFindManyArgs { + @ApiProperty({ + required: false, + type: () => VerificationTokenWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => VerificationTokenWhereInput, { nullable: true }) + @Type(() => VerificationTokenWhereInput) + where?: VerificationTokenWhereInput; + + @ApiProperty({ + required: false, + type: [VerificationTokenOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [VerificationTokenOrderByInput], { nullable: true }) + @Type(() => VerificationTokenOrderByInput) + orderBy?: Array<VerificationTokenOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { VerificationTokenFindManyArgs as VerificationTokenFindManyArgs }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindUniqueArgs.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindUniqueArgs.ts new file mode 100644 index 0000000..5caab59 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { VerificationTokenWhereUniqueInput } from "./VerificationTokenWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class VerificationTokenFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => VerificationTokenWhereUniqueInput, + }) + @ValidateNested() + @Type(() => VerificationTokenWhereUniqueInput) + @Field(() => VerificationTokenWhereUniqueInput, { nullable: false }) + where!: VerificationTokenWhereUniqueInput; +} + +export { VerificationTokenFindUniqueArgs as VerificationTokenFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenListRelationFilter.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenListRelationFilter.ts new file mode 100644 index 0000000..688ddc8 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { VerificationTokenWhereInput } from "./VerificationTokenWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class VerificationTokenListRelationFilter { + @ApiProperty({ + required: false, + type: () => VerificationTokenWhereInput, + }) + @ValidateNested() + @Type(() => VerificationTokenWhereInput) + @IsOptional() + @Field(() => VerificationTokenWhereInput, { + nullable: true, + }) + every?: VerificationTokenWhereInput; + + @ApiProperty({ + required: false, + type: () => VerificationTokenWhereInput, + }) + @ValidateNested() + @Type(() => VerificationTokenWhereInput) + @IsOptional() + @Field(() => VerificationTokenWhereInput, { + nullable: true, + }) + some?: VerificationTokenWhereInput; + + @ApiProperty({ + required: false, + type: () => VerificationTokenWhereInput, + }) + @ValidateNested() + @Type(() => VerificationTokenWhereInput) + @IsOptional() + @Field(() => VerificationTokenWhereInput, { + nullable: true, + }) + none?: VerificationTokenWhereInput; +} +export { VerificationTokenListRelationFilter as VerificationTokenListRelationFilter }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenOrderByInput.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenOrderByInput.ts new file mode 100644 index 0000000..698b599 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenOrderByInput.ts @@ -0,0 +1,89 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class VerificationTokenOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + identifier?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + token?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + expires?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + updatedAt?: SortOrder; +} + +export { VerificationTokenOrderByInput as VerificationTokenOrderByInput }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenUpdateInput.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenUpdateInput.ts new file mode 100644 index 0000000..8a2581a --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenUpdateInput.ts @@ -0,0 +1,53 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsDate } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class VerificationTokenUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + identifier?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + token?: string; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + expires?: Date; +} + +export { VerificationTokenUpdateInput as VerificationTokenUpdateInput }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereInput.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereInput.ts new file mode 100644 index 0000000..63e44a4 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereInput.ts @@ -0,0 +1,89 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; + +@InputType() +class VerificationTokenWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + identifier?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + token?: StringFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + expires?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + updatedAt?: DateTimeFilter; +} + +export { VerificationTokenWhereInput as VerificationTokenWhereInput }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereUniqueInput.ts b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereUniqueInput.ts new file mode 100644 index 0000000..63f952f --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/VerificationTokenWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class VerificationTokenWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { VerificationTokenWhereUniqueInput as VerificationTokenWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.spec.ts b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.spec.ts new file mode 100644 index 0000000..ba73b5e --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.spec.ts @@ -0,0 +1,206 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { VerificationTokenController } from "../verificationToken.controller"; +import { VerificationTokenService } from "../verificationToken.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + identifier: "exampleIdentifier", + token: "exampleToken", + expires: new Date(), + createdAt: new Date(), + updatedAt: new Date(), +}; +const CREATE_RESULT = { + id: 42, + identifier: "exampleIdentifier", + token: "exampleToken", + expires: new Date(), + createdAt: new Date(), + updatedAt: new Date(), +}; +const FIND_MANY_RESULT = [ + { + id: 42, + identifier: "exampleIdentifier", + token: "exampleToken", + expires: new Date(), + createdAt: new Date(), + updatedAt: new Date(), + }, +]; +const FIND_ONE_RESULT = { + id: 42, + identifier: "exampleIdentifier", + token: "exampleToken", + expires: new Date(), + createdAt: new Date(), + updatedAt: new Date(), +}; + +const service = { + createVerificationToken() { + return CREATE_RESULT; + }, + verificationTokens: () => FIND_MANY_RESULT, + verificationToken: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("VerificationToken", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: VerificationTokenService, + useValue: service, + }, + ], + controllers: [VerificationTokenController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /verificationTokens", async () => { + await request(app.getHttpServer()) + .post("/verificationTokens") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + expires: CREATE_RESULT.expires.toISOString(), + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + }); + }); + + test("GET /verificationTokens", async () => { + await request(app.getHttpServer()) + .get("/verificationTokens") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + expires: FIND_MANY_RESULT[0].expires.toISOString(), + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(), + }, + ]); + }); + + test("GET /verificationTokens/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/verificationTokens"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /verificationTokens/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/verificationTokens"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + expires: FIND_ONE_RESULT.expires.toISOString(), + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(), + }); + }); + + test("POST /verificationTokens existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/verificationTokens") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + expires: CREATE_RESULT.expires.toISOString(), + createdAt: CREATE_RESULT.createdAt.toISOString(), + updatedAt: CREATE_RESULT.updatedAt.toISOString(), + }) + .then(function () { + agent + .post("/verificationTokens") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.ts b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.ts new file mode 100644 index 0000000..36af970 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.controller.base.ts @@ -0,0 +1,148 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { VerificationTokenService } from "../verificationToken.service"; +import { VerificationTokenCreateInput } from "./VerificationTokenCreateInput"; +import { VerificationToken } from "./VerificationToken"; +import { VerificationTokenFindManyArgs } from "./VerificationTokenFindManyArgs"; +import { VerificationTokenWhereUniqueInput } from "./VerificationTokenWhereUniqueInput"; +import { VerificationTokenUpdateInput } from "./VerificationTokenUpdateInput"; + +export class VerificationTokenControllerBase { + constructor(protected readonly service: VerificationTokenService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: VerificationToken }) + async createVerificationToken( + @common.Body() data: VerificationTokenCreateInput + ): Promise<VerificationToken> { + return await this.service.createVerificationToken({ + data: data, + select: { + id: true, + identifier: true, + token: true, + expires: true, + createdAt: true, + updatedAt: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [VerificationToken] }) + @ApiNestedQuery(VerificationTokenFindManyArgs) + async verificationTokens( + @common.Req() request: Request + ): Promise<VerificationToken[]> { + const args = plainToClass(VerificationTokenFindManyArgs, request.query); + return this.service.verificationTokens({ + ...args, + select: { + id: true, + identifier: true, + token: true, + expires: true, + createdAt: true, + updatedAt: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: VerificationToken }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async verificationToken( + @common.Param() params: VerificationTokenWhereUniqueInput + ): Promise<VerificationToken | null> { + const result = await this.service.verificationToken({ + where: params, + select: { + id: true, + identifier: true, + token: true, + expires: true, + createdAt: true, + updatedAt: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: VerificationToken }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateVerificationToken( + @common.Param() params: VerificationTokenWhereUniqueInput, + @common.Body() data: VerificationTokenUpdateInput + ): Promise<VerificationToken | null> { + try { + return await this.service.updateVerificationToken({ + where: params, + data: data, + select: { + id: true, + identifier: true, + token: true, + expires: true, + createdAt: true, + updatedAt: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: VerificationToken }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteVerificationToken( + @common.Param() params: VerificationTokenWhereUniqueInput + ): Promise<VerificationToken | null> { + try { + return await this.service.deleteVerificationToken({ + where: params, + select: { + id: true, + identifier: true, + token: true, + expires: true, + createdAt: true, + updatedAt: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/verificationToken/base/verificationToken.module.base.ts b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.module.base.ts new file mode 100644 index 0000000..0abd237 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class VerificationTokenModuleBase {} diff --git a/apps/roi-cacl-2/src/verificationToken/base/verificationToken.resolver.base.ts b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.resolver.base.ts new file mode 100644 index 0000000..2811b61 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.resolver.base.ts @@ -0,0 +1,99 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { VerificationToken } from "./VerificationToken"; +import { VerificationTokenCountArgs } from "./VerificationTokenCountArgs"; +import { VerificationTokenFindManyArgs } from "./VerificationTokenFindManyArgs"; +import { VerificationTokenFindUniqueArgs } from "./VerificationTokenFindUniqueArgs"; +import { CreateVerificationTokenArgs } from "./CreateVerificationTokenArgs"; +import { UpdateVerificationTokenArgs } from "./UpdateVerificationTokenArgs"; +import { DeleteVerificationTokenArgs } from "./DeleteVerificationTokenArgs"; +import { VerificationTokenService } from "../verificationToken.service"; +@graphql.Resolver(() => VerificationToken) +export class VerificationTokenResolverBase { + constructor(protected readonly service: VerificationTokenService) {} + + async _verificationTokensMeta( + @graphql.Args() args: VerificationTokenCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [VerificationToken]) + async verificationTokens( + @graphql.Args() args: VerificationTokenFindManyArgs + ): Promise<VerificationToken[]> { + return this.service.verificationTokens(args); + } + + @graphql.Query(() => VerificationToken, { nullable: true }) + async verificationToken( + @graphql.Args() args: VerificationTokenFindUniqueArgs + ): Promise<VerificationToken | null> { + const result = await this.service.verificationToken(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => VerificationToken) + async createVerificationToken( + @graphql.Args() args: CreateVerificationTokenArgs + ): Promise<VerificationToken> { + return await this.service.createVerificationToken({ + ...args, + data: args.data, + }); + } + + @graphql.Mutation(() => VerificationToken) + async updateVerificationToken( + @graphql.Args() args: UpdateVerificationTokenArgs + ): Promise<VerificationToken | null> { + try { + return await this.service.updateVerificationToken({ + ...args, + data: args.data, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => VerificationToken) + async deleteVerificationToken( + @graphql.Args() args: DeleteVerificationTokenArgs + ): Promise<VerificationToken | null> { + try { + return await this.service.deleteVerificationToken(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/verificationToken/base/verificationToken.service.base.ts b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.service.base.ts new file mode 100644 index 0000000..a1005f6 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/base/verificationToken.service.base.ts @@ -0,0 +1,54 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; +import { + Prisma, + VerificationToken as PrismaVerificationToken, +} from "@prisma/client"; + +export class VerificationTokenServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.VerificationTokenCountArgs, "select"> + ): Promise<number> { + return this.prisma.verificationToken.count(args); + } + + async verificationTokens<T extends Prisma.VerificationTokenFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.VerificationTokenFindManyArgs> + ): Promise<PrismaVerificationToken[]> { + return this.prisma.verificationToken.findMany<Prisma.VerificationTokenFindManyArgs>( + args + ); + } + async verificationToken<T extends Prisma.VerificationTokenFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.VerificationTokenFindUniqueArgs> + ): Promise<PrismaVerificationToken | null> { + return this.prisma.verificationToken.findUnique(args); + } + async createVerificationToken<T extends Prisma.VerificationTokenCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.VerificationTokenCreateArgs> + ): Promise<PrismaVerificationToken> { + return this.prisma.verificationToken.create<T>(args); + } + async updateVerificationToken<T extends Prisma.VerificationTokenUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.VerificationTokenUpdateArgs> + ): Promise<PrismaVerificationToken> { + return this.prisma.verificationToken.update<T>(args); + } + async deleteVerificationToken<T extends Prisma.VerificationTokenDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.VerificationTokenDeleteArgs> + ): Promise<PrismaVerificationToken> { + return this.prisma.verificationToken.delete(args); + } +} diff --git a/apps/roi-cacl-2/src/verificationToken/verificationToken.controller.ts b/apps/roi-cacl-2/src/verificationToken/verificationToken.controller.ts new file mode 100644 index 0000000..a6eecd0 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/verificationToken.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { VerificationTokenService } from "./verificationToken.service"; +import { VerificationTokenControllerBase } from "./base/verificationToken.controller.base"; + +@swagger.ApiTags("verificationTokens") +@common.Controller("verificationTokens") +export class VerificationTokenController extends VerificationTokenControllerBase { + constructor(protected readonly service: VerificationTokenService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/verificationToken/verificationToken.module.ts b/apps/roi-cacl-2/src/verificationToken/verificationToken.module.ts new file mode 100644 index 0000000..15a0f36 --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/verificationToken.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { VerificationTokenModuleBase } from "./base/verificationToken.module.base"; +import { VerificationTokenService } from "./verificationToken.service"; +import { VerificationTokenController } from "./verificationToken.controller"; +import { VerificationTokenResolver } from "./verificationToken.resolver"; + +@Module({ + imports: [VerificationTokenModuleBase], + controllers: [VerificationTokenController], + providers: [VerificationTokenService, VerificationTokenResolver], + exports: [VerificationTokenService], +}) +export class VerificationTokenModule {} diff --git a/apps/roi-cacl-2/src/verificationToken/verificationToken.resolver.ts b/apps/roi-cacl-2/src/verificationToken/verificationToken.resolver.ts new file mode 100644 index 0000000..31d93fb --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/verificationToken.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { VerificationTokenResolverBase } from "./base/verificationToken.resolver.base"; +import { VerificationToken } from "./base/VerificationToken"; +import { VerificationTokenService } from "./verificationToken.service"; + +@graphql.Resolver(() => VerificationToken) +export class VerificationTokenResolver extends VerificationTokenResolverBase { + constructor(protected readonly service: VerificationTokenService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/verificationToken/verificationToken.service.ts b/apps/roi-cacl-2/src/verificationToken/verificationToken.service.ts new file mode 100644 index 0000000..e20cd3d --- /dev/null +++ b/apps/roi-cacl-2/src/verificationToken/verificationToken.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { VerificationTokenServiceBase } from "./base/verificationToken.service.base"; + +@Injectable() +export class VerificationTokenService extends VerificationTokenServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/webhook/base/CreateWebhookArgs.ts b/apps/roi-cacl-2/src/webhook/base/CreateWebhookArgs.ts new file mode 100644 index 0000000..56efe01 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/CreateWebhookArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WebhookCreateInput } from "./WebhookCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateWebhookArgs { + @ApiProperty({ + required: true, + type: () => WebhookCreateInput, + }) + @ValidateNested() + @Type(() => WebhookCreateInput) + @Field(() => WebhookCreateInput, { nullable: false }) + data!: WebhookCreateInput; +} + +export { CreateWebhookArgs as CreateWebhookArgs }; diff --git a/apps/roi-cacl-2/src/webhook/base/DeleteWebhookArgs.ts b/apps/roi-cacl-2/src/webhook/base/DeleteWebhookArgs.ts new file mode 100644 index 0000000..68f756c --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/DeleteWebhookArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WebhookWhereUniqueInput } from "./WebhookWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteWebhookArgs { + @ApiProperty({ + required: true, + type: () => WebhookWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WebhookWhereUniqueInput) + @Field(() => WebhookWhereUniqueInput, { nullable: false }) + where!: WebhookWhereUniqueInput; +} + +export { DeleteWebhookArgs as DeleteWebhookArgs }; diff --git a/apps/roi-cacl-2/src/webhook/base/EnumWebhookEventTriggers.ts b/apps/roi-cacl-2/src/webhook/base/EnumWebhookEventTriggers.ts new file mode 100644 index 0000000..d21feca --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/EnumWebhookEventTriggers.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumWebhookEventTriggers { + BookingCreated = "BOOKING_CREATED", + BookingRescheduled = "BOOKING_RESCHEDULED", + BookingCancelled = "BOOKING_CANCELLED", +} + +registerEnumType(EnumWebhookEventTriggers, { + name: "EnumWebhookEventTriggers", +}); diff --git a/apps/roi-cacl-2/src/webhook/base/UpdateWebhookArgs.ts b/apps/roi-cacl-2/src/webhook/base/UpdateWebhookArgs.ts new file mode 100644 index 0000000..accbbcc --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/UpdateWebhookArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WebhookWhereUniqueInput } from "./WebhookWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { WebhookUpdateInput } from "./WebhookUpdateInput"; + +@ArgsType() +class UpdateWebhookArgs { + @ApiProperty({ + required: true, + type: () => WebhookWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WebhookWhereUniqueInput) + @Field(() => WebhookWhereUniqueInput, { nullable: false }) + where!: WebhookWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => WebhookUpdateInput, + }) + @ValidateNested() + @Type(() => WebhookUpdateInput) + @Field(() => WebhookUpdateInput, { nullable: false }) + data!: WebhookUpdateInput; +} + +export { UpdateWebhookArgs as UpdateWebhookArgs }; diff --git a/apps/roi-cacl-2/src/webhook/base/Webhook.ts b/apps/roi-cacl-2/src/webhook/base/Webhook.ts new file mode 100644 index 0000000..da55dd4 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/Webhook.ts @@ -0,0 +1,128 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsDate, + IsBoolean, + IsEnum, + ValidateNested, +} from "class-validator"; +import { Type } from "class-transformer"; +import { EnumWebhookEventTriggers } from "./EnumWebhookEventTriggers"; +import { User } from "../../user/base/User"; +import { EventType } from "../../eventType/base/EventType"; +import { AppModel } from "../../appModel/base/AppModel"; + +@ObjectType() +class Webhook { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + subscriberUrl!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + payloadTemplate!: string | null; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + createdAt!: Date; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + active!: boolean; + + @ApiProperty({ + required: true, + enum: EnumWebhookEventTriggers, + isArray: true, + }) + @IsEnum(EnumWebhookEventTriggers, { + each: true, + }) + @IsOptional() + @Field(() => [EnumWebhookEventTriggers], { + nullable: true, + }) + eventTriggers?: Array< + "BOOKING_CREATED" | "BOOKING_RESCHEDULED" | "BOOKING_CANCELLED" + >; + + @ApiProperty({ + required: false, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + @IsOptional() + user?: User | null; + + @ApiProperty({ + required: false, + type: () => EventType, + }) + @ValidateNested() + @Type(() => EventType) + @IsOptional() + eventType?: EventType | null; + + @ApiProperty({ + required: false, + type: () => AppModel, + }) + @ValidateNested() + @Type(() => AppModel) + @IsOptional() + appField?: AppModel | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + secret!: string | null; +} + +export { Webhook as Webhook }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookCountArgs.ts b/apps/roi-cacl-2/src/webhook/base/WebhookCountArgs.ts new file mode 100644 index 0000000..cf2c36a --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WebhookWhereInput } from "./WebhookWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class WebhookCountArgs { + @ApiProperty({ + required: false, + type: () => WebhookWhereInput, + }) + @Field(() => WebhookWhereInput, { nullable: true }) + @Type(() => WebhookWhereInput) + where?: WebhookWhereInput; +} + +export { WebhookCountArgs as WebhookCountArgs }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookCreateInput.ts b/apps/roi-cacl-2/src/webhook/base/WebhookCreateInput.ts new file mode 100644 index 0000000..64322de --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookCreateInput.ts @@ -0,0 +1,120 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsBoolean, + IsEnum, + ValidateNested, +} from "class-validator"; +import { EnumWebhookEventTriggers } from "./EnumWebhookEventTriggers"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; + +@InputType() +class WebhookCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + subscriberUrl!: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + payloadTemplate?: string | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + active!: boolean; + + @ApiProperty({ + required: true, + enum: EnumWebhookEventTriggers, + isArray: true, + }) + @IsEnum(EnumWebhookEventTriggers, { + each: true, + }) + @IsOptional() + @Field(() => [EnumWebhookEventTriggers], { + nullable: true, + }) + eventTriggers?: Array< + "BOOKING_CREATED" | "BOOKING_RESCHEDULED" | "BOOKING_CANCELLED" + >; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + secret?: string | null; +} + +export { WebhookCreateInput as WebhookCreateInput }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookFindManyArgs.ts b/apps/roi-cacl-2/src/webhook/base/WebhookFindManyArgs.ts new file mode 100644 index 0000000..f6068f9 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WebhookWhereInput } from "./WebhookWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { WebhookOrderByInput } from "./WebhookOrderByInput"; + +@ArgsType() +class WebhookFindManyArgs { + @ApiProperty({ + required: false, + type: () => WebhookWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => WebhookWhereInput, { nullable: true }) + @Type(() => WebhookWhereInput) + where?: WebhookWhereInput; + + @ApiProperty({ + required: false, + type: [WebhookOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [WebhookOrderByInput], { nullable: true }) + @Type(() => WebhookOrderByInput) + orderBy?: Array<WebhookOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { WebhookFindManyArgs as WebhookFindManyArgs }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookFindUniqueArgs.ts b/apps/roi-cacl-2/src/webhook/base/WebhookFindUniqueArgs.ts new file mode 100644 index 0000000..7ffbbf0 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WebhookWhereUniqueInput } from "./WebhookWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class WebhookFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => WebhookWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WebhookWhereUniqueInput) + @Field(() => WebhookWhereUniqueInput, { nullable: false }) + where!: WebhookWhereUniqueInput; +} + +export { WebhookFindUniqueArgs as WebhookFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookListRelationFilter.ts b/apps/roi-cacl-2/src/webhook/base/WebhookListRelationFilter.ts new file mode 100644 index 0000000..49c8445 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WebhookWhereInput } from "./WebhookWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class WebhookListRelationFilter { + @ApiProperty({ + required: false, + type: () => WebhookWhereInput, + }) + @ValidateNested() + @Type(() => WebhookWhereInput) + @IsOptional() + @Field(() => WebhookWhereInput, { + nullable: true, + }) + every?: WebhookWhereInput; + + @ApiProperty({ + required: false, + type: () => WebhookWhereInput, + }) + @ValidateNested() + @Type(() => WebhookWhereInput) + @IsOptional() + @Field(() => WebhookWhereInput, { + nullable: true, + }) + some?: WebhookWhereInput; + + @ApiProperty({ + required: false, + type: () => WebhookWhereInput, + }) + @ValidateNested() + @Type(() => WebhookWhereInput) + @IsOptional() + @Field(() => WebhookWhereInput, { + nullable: true, + }) + none?: WebhookWhereInput; +} +export { WebhookListRelationFilter as WebhookListRelationFilter }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookOrderByInput.ts b/apps/roi-cacl-2/src/webhook/base/WebhookOrderByInput.ts new file mode 100644 index 0000000..6831f5a --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookOrderByInput.ts @@ -0,0 +1,133 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class WebhookOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + subscriberUrl?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + payloadTemplate?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + createdAt?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + active?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTriggers?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTypeId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + appId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + secret?: SortOrder; +} + +export { WebhookOrderByInput as WebhookOrderByInput }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookUpdateInput.ts b/apps/roi-cacl-2/src/webhook/base/WebhookUpdateInput.ts new file mode 100644 index 0000000..f29dc3b --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookUpdateInput.ts @@ -0,0 +1,126 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + IsBoolean, + IsEnum, + ValidateNested, +} from "class-validator"; +import { EnumWebhookEventTriggers } from "./EnumWebhookEventTriggers"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; + +@InputType() +class WebhookUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + subscriberUrl?: string; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + payloadTemplate?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + active?: boolean; + + @ApiProperty({ + required: false, + enum: EnumWebhookEventTriggers, + isArray: true, + }) + @IsEnum(EnumWebhookEventTriggers, { + each: true, + }) + @IsOptional() + @Field(() => [EnumWebhookEventTriggers], { + nullable: true, + }) + eventTriggers?: Array< + "BOOKING_CREATED" | "BOOKING_RESCHEDULED" | "BOOKING_CANCELLED" + >; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + secret?: string | null; +} + +export { WebhookUpdateInput as WebhookUpdateInput }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookWhereInput.ts b/apps/roi-cacl-2/src/webhook/base/WebhookWhereInput.ts new file mode 100644 index 0000000..6058c63 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookWhereInput.ts @@ -0,0 +1,129 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { StringFilter } from "../../util/StringFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; +import { AppModelWhereUniqueInput } from "../../appModel/base/AppModelWhereUniqueInput"; + +@InputType() +class WebhookWhereInput { + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + id?: StringFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + subscriberUrl?: StringFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + payloadTemplate?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + createdAt?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + active?: BooleanFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => AppModelWhereUniqueInput, + }) + @ValidateNested() + @Type(() => AppModelWhereUniqueInput) + @IsOptional() + @Field(() => AppModelWhereUniqueInput, { + nullable: true, + }) + appField?: AppModelWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + secret?: StringNullableFilter; +} + +export { WebhookWhereInput as WebhookWhereInput }; diff --git a/apps/roi-cacl-2/src/webhook/base/WebhookWhereUniqueInput.ts b/apps/roi-cacl-2/src/webhook/base/WebhookWhereUniqueInput.ts new file mode 100644 index 0000000..98cb75b --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/WebhookWhereUniqueInput.ts @@ -0,0 +1,27 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsString } from "class-validator"; + +@InputType() +class WebhookWhereUniqueInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + id!: string; +} + +export { WebhookWhereUniqueInput as WebhookWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/webhook/base/webhook.controller.base.spec.ts b/apps/roi-cacl-2/src/webhook/base/webhook.controller.base.spec.ts new file mode 100644 index 0000000..c377aa3 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/webhook.controller.base.spec.ts @@ -0,0 +1,198 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { WebhookController } from "../webhook.controller"; +import { WebhookService } from "../webhook.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: "exampleId", + subscriberUrl: "exampleSubscriberUrl", + payloadTemplate: "examplePayloadTemplate", + createdAt: new Date(), + active: "true", + secret: "exampleSecret", +}; +const CREATE_RESULT = { + id: "exampleId", + subscriberUrl: "exampleSubscriberUrl", + payloadTemplate: "examplePayloadTemplate", + createdAt: new Date(), + active: "true", + secret: "exampleSecret", +}; +const FIND_MANY_RESULT = [ + { + id: "exampleId", + subscriberUrl: "exampleSubscriberUrl", + payloadTemplate: "examplePayloadTemplate", + createdAt: new Date(), + active: "true", + secret: "exampleSecret", + }, +]; +const FIND_ONE_RESULT = { + id: "exampleId", + subscriberUrl: "exampleSubscriberUrl", + payloadTemplate: "examplePayloadTemplate", + createdAt: new Date(), + active: "true", + secret: "exampleSecret", +}; + +const service = { + createWebhook() { + return CREATE_RESULT; + }, + webhooks: () => FIND_MANY_RESULT, + webhook: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Webhook", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: WebhookService, + useValue: service, + }, + ], + controllers: [WebhookController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /webhooks", async () => { + await request(app.getHttpServer()) + .post("/webhooks") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + }); + }); + + test("GET /webhooks", async () => { + await request(app.getHttpServer()) + .get("/webhooks") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(), + }, + ]); + }); + + test("GET /webhooks/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/webhooks"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /webhooks/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/webhooks"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + createdAt: FIND_ONE_RESULT.createdAt.toISOString(), + }); + }); + + test("POST /webhooks existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/webhooks") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + createdAt: CREATE_RESULT.createdAt.toISOString(), + }) + .then(function () { + agent + .post("/webhooks") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/webhook/base/webhook.controller.base.ts b/apps/roi-cacl-2/src/webhook/base/webhook.controller.base.ts new file mode 100644 index 0000000..734ff02 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/webhook.controller.base.ts @@ -0,0 +1,286 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { WebhookService } from "../webhook.service"; +import { WebhookCreateInput } from "./WebhookCreateInput"; +import { Webhook } from "./Webhook"; +import { WebhookFindManyArgs } from "./WebhookFindManyArgs"; +import { WebhookWhereUniqueInput } from "./WebhookWhereUniqueInput"; +import { WebhookUpdateInput } from "./WebhookUpdateInput"; + +export class WebhookControllerBase { + constructor(protected readonly service: WebhookService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Webhook }) + async createWebhook( + @common.Body() data: WebhookCreateInput + ): Promise<Webhook> { + return await this.service.createWebhook({ + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + appField: data.appField + ? { + connect: data.appField, + } + : undefined, + }, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Webhook] }) + @ApiNestedQuery(WebhookFindManyArgs) + async webhooks(@common.Req() request: Request): Promise<Webhook[]> { + const args = plainToClass(WebhookFindManyArgs, request.query); + return this.service.webhooks({ + ...args, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Webhook }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async webhook( + @common.Param() params: WebhookWhereUniqueInput + ): Promise<Webhook | null> { + const result = await this.service.webhook({ + where: params, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Webhook }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateWebhook( + @common.Param() params: WebhookWhereUniqueInput, + @common.Body() data: WebhookUpdateInput + ): Promise<Webhook | null> { + try { + return await this.service.updateWebhook({ + where: params, + data: { + ...data, + + user: data.user + ? { + connect: data.user, + } + : undefined, + + eventType: data.eventType + ? { + connect: data.eventType, + } + : undefined, + + appField: data.appField + ? { + connect: data.appField, + } + : undefined, + }, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Webhook }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteWebhook( + @common.Param() params: WebhookWhereUniqueInput + ): Promise<Webhook | null> { + try { + return await this.service.deleteWebhook({ + where: params, + select: { + id: true, + subscriberUrl: true, + payloadTemplate: true, + createdAt: true, + active: true, + eventTriggers: true, + + user: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + + appField: { + select: { + id: true, + }, + }, + + secret: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/webhook/base/webhook.module.base.ts b/apps/roi-cacl-2/src/webhook/base/webhook.module.base.ts new file mode 100644 index 0000000..d987dfb --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/webhook.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class WebhookModuleBase {} diff --git a/apps/roi-cacl-2/src/webhook/base/webhook.resolver.base.ts b/apps/roi-cacl-2/src/webhook/base/webhook.resolver.base.ts new file mode 100644 index 0000000..02299fc --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/webhook.resolver.base.ts @@ -0,0 +1,185 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Webhook } from "./Webhook"; +import { WebhookCountArgs } from "./WebhookCountArgs"; +import { WebhookFindManyArgs } from "./WebhookFindManyArgs"; +import { WebhookFindUniqueArgs } from "./WebhookFindUniqueArgs"; +import { CreateWebhookArgs } from "./CreateWebhookArgs"; +import { UpdateWebhookArgs } from "./UpdateWebhookArgs"; +import { DeleteWebhookArgs } from "./DeleteWebhookArgs"; +import { User } from "../../user/base/User"; +import { EventType } from "../../eventType/base/EventType"; +import { AppModel } from "../../appModel/base/AppModel"; +import { WebhookService } from "../webhook.service"; +@graphql.Resolver(() => Webhook) +export class WebhookResolverBase { + constructor(protected readonly service: WebhookService) {} + + async _webhooksMeta( + @graphql.Args() args: WebhookCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Webhook]) + async webhooks( + @graphql.Args() args: WebhookFindManyArgs + ): Promise<Webhook[]> { + return this.service.webhooks(args); + } + + @graphql.Query(() => Webhook, { nullable: true }) + async webhook( + @graphql.Args() args: WebhookFindUniqueArgs + ): Promise<Webhook | null> { + const result = await this.service.webhook(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Webhook) + async createWebhook( + @graphql.Args() args: CreateWebhookArgs + ): Promise<Webhook> { + return await this.service.createWebhook({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + appField: args.data.appField + ? { + connect: args.data.appField, + } + : undefined, + }, + }); + } + + @graphql.Mutation(() => Webhook) + async updateWebhook( + @graphql.Args() args: UpdateWebhookArgs + ): Promise<Webhook | null> { + try { + return await this.service.updateWebhook({ + ...args, + data: { + ...args.data, + + user: args.data.user + ? { + connect: args.data.user, + } + : undefined, + + eventType: args.data.eventType + ? { + connect: args.data.eventType, + } + : undefined, + + appField: args.data.appField + ? { + connect: args.data.appField, + } + : undefined, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Webhook) + async deleteWebhook( + @graphql.Args() args: DeleteWebhookArgs + ): Promise<Webhook | null> { + try { + return await this.service.deleteWebhook(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Webhook): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => EventType, { + nullable: true, + name: "eventType", + }) + async getEventType( + @graphql.Parent() parent: Webhook + ): Promise<EventType | null> { + const result = await this.service.getEventType(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => AppModel, { + nullable: true, + name: "appField", + }) + async getAppField( + @graphql.Parent() parent: Webhook + ): Promise<AppModel | null> { + const result = await this.service.getAppField(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/webhook/base/webhook.service.base.ts b/apps/roi-cacl-2/src/webhook/base/webhook.service.base.ts new file mode 100644 index 0000000..1a755f3 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/base/webhook.service.base.ts @@ -0,0 +1,78 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Webhook as PrismaWebhook, + User as PrismaUser, + EventType as PrismaEventType, + AppModel as PrismaAppModel, +} from "@prisma/client"; + +export class WebhookServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.WebhookCountArgs, "select">): Promise<number> { + return this.prisma.webhook.count(args); + } + + async webhooks<T extends Prisma.WebhookFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.WebhookFindManyArgs> + ): Promise<PrismaWebhook[]> { + return this.prisma.webhook.findMany<Prisma.WebhookFindManyArgs>(args); + } + async webhook<T extends Prisma.WebhookFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.WebhookFindUniqueArgs> + ): Promise<PrismaWebhook | null> { + return this.prisma.webhook.findUnique(args); + } + async createWebhook<T extends Prisma.WebhookCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.WebhookCreateArgs> + ): Promise<PrismaWebhook> { + return this.prisma.webhook.create<T>(args); + } + async updateWebhook<T extends Prisma.WebhookUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.WebhookUpdateArgs> + ): Promise<PrismaWebhook> { + return this.prisma.webhook.update<T>(args); + } + async deleteWebhook<T extends Prisma.WebhookDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.WebhookDeleteArgs> + ): Promise<PrismaWebhook> { + return this.prisma.webhook.delete(args); + } + + async getUser(parentId: string): Promise<PrismaUser | null> { + return this.prisma.webhook + .findUnique({ + where: { id: parentId }, + }) + .user(); + } + + async getEventType(parentId: string): Promise<PrismaEventType | null> { + return this.prisma.webhook + .findUnique({ + where: { id: parentId }, + }) + .eventType(); + } + + async getAppField(parentId: string): Promise<PrismaAppModel | null> { + return this.prisma.webhook + .findUnique({ + where: { id: parentId }, + }) + .appField(); + } +} diff --git a/apps/roi-cacl-2/src/webhook/webhook.controller.ts b/apps/roi-cacl-2/src/webhook/webhook.controller.ts new file mode 100644 index 0000000..3ba0214 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/webhook.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { WebhookService } from "./webhook.service"; +import { WebhookControllerBase } from "./base/webhook.controller.base"; + +@swagger.ApiTags("webhooks") +@common.Controller("webhooks") +export class WebhookController extends WebhookControllerBase { + constructor(protected readonly service: WebhookService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/webhook/webhook.module.ts b/apps/roi-cacl-2/src/webhook/webhook.module.ts new file mode 100644 index 0000000..659384e --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/webhook.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { WebhookModuleBase } from "./base/webhook.module.base"; +import { WebhookService } from "./webhook.service"; +import { WebhookController } from "./webhook.controller"; +import { WebhookResolver } from "./webhook.resolver"; + +@Module({ + imports: [WebhookModuleBase], + controllers: [WebhookController], + providers: [WebhookService, WebhookResolver], + exports: [WebhookService], +}) +export class WebhookModule {} diff --git a/apps/roi-cacl-2/src/webhook/webhook.resolver.ts b/apps/roi-cacl-2/src/webhook/webhook.resolver.ts new file mode 100644 index 0000000..b32c62b --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/webhook.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { WebhookResolverBase } from "./base/webhook.resolver.base"; +import { Webhook } from "./base/Webhook"; +import { WebhookService } from "./webhook.service"; + +@graphql.Resolver(() => Webhook) +export class WebhookResolver extends WebhookResolverBase { + constructor(protected readonly service: WebhookService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/webhook/webhook.service.ts b/apps/roi-cacl-2/src/webhook/webhook.service.ts new file mode 100644 index 0000000..6271e81 --- /dev/null +++ b/apps/roi-cacl-2/src/webhook/webhook.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { WebhookServiceBase } from "./base/webhook.service.base"; + +@Injectable() +export class WebhookService extends WebhookServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/workflow/base/CreateWorkflowArgs.ts b/apps/roi-cacl-2/src/workflow/base/CreateWorkflowArgs.ts new file mode 100644 index 0000000..a0d01dd --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/CreateWorkflowArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowCreateInput } from "./WorkflowCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateWorkflowArgs { + @ApiProperty({ + required: true, + type: () => WorkflowCreateInput, + }) + @ValidateNested() + @Type(() => WorkflowCreateInput) + @Field(() => WorkflowCreateInput, { nullable: false }) + data!: WorkflowCreateInput; +} + +export { CreateWorkflowArgs as CreateWorkflowArgs }; diff --git a/apps/roi-cacl-2/src/workflow/base/DeleteWorkflowArgs.ts b/apps/roi-cacl-2/src/workflow/base/DeleteWorkflowArgs.ts new file mode 100644 index 0000000..0ce1e06 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/DeleteWorkflowArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereUniqueInput } from "./WorkflowWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteWorkflowArgs { + @ApiProperty({ + required: true, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @Field(() => WorkflowWhereUniqueInput, { nullable: false }) + where!: WorkflowWhereUniqueInput; +} + +export { DeleteWorkflowArgs as DeleteWorkflowArgs }; diff --git a/apps/roi-cacl-2/src/workflow/base/EnumWorkflowTimeUnit.ts b/apps/roi-cacl-2/src/workflow/base/EnumWorkflowTimeUnit.ts new file mode 100644 index 0000000..7344b66 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/EnumWorkflowTimeUnit.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumWorkflowTimeUnit { + Day = "DAY", + Hour = "HOUR", + Minute = "MINUTE", +} + +registerEnumType(EnumWorkflowTimeUnit, { + name: "EnumWorkflowTimeUnit", +}); diff --git a/apps/roi-cacl-2/src/workflow/base/EnumWorkflowTrigger.ts b/apps/roi-cacl-2/src/workflow/base/EnumWorkflowTrigger.ts new file mode 100644 index 0000000..3f712f5 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/EnumWorkflowTrigger.ts @@ -0,0 +1,22 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumWorkflowTrigger { + BeforeEvent = "BEFORE_EVENT", + EventCancelled = "EVENT_CANCELLED", + NewEvent = "NEW_EVENT", +} + +registerEnumType(EnumWorkflowTrigger, { + name: "EnumWorkflowTrigger", +}); diff --git a/apps/roi-cacl-2/src/workflow/base/UpdateWorkflowArgs.ts b/apps/roi-cacl-2/src/workflow/base/UpdateWorkflowArgs.ts new file mode 100644 index 0000000..67f0e0a --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/UpdateWorkflowArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereUniqueInput } from "./WorkflowWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowUpdateInput } from "./WorkflowUpdateInput"; + +@ArgsType() +class UpdateWorkflowArgs { + @ApiProperty({ + required: true, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @Field(() => WorkflowWhereUniqueInput, { nullable: false }) + where!: WorkflowWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => WorkflowUpdateInput, + }) + @ValidateNested() + @Type(() => WorkflowUpdateInput) + @Field(() => WorkflowUpdateInput, { nullable: false }) + data!: WorkflowUpdateInput; +} + +export { UpdateWorkflowArgs as UpdateWorkflowArgs }; diff --git a/apps/roi-cacl-2/src/workflow/base/Workflow.ts b/apps/roi-cacl-2/src/workflow/base/Workflow.ts new file mode 100644 index 0000000..22cce39 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/Workflow.ts @@ -0,0 +1,105 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsString, + ValidateNested, + IsEnum, + IsOptional, +} from "class-validator"; +import { User } from "../../user/base/User"; +import { Type } from "class-transformer"; +import { EnumWorkflowTrigger } from "./EnumWorkflowTrigger"; +import { EnumWorkflowTimeUnit } from "./EnumWorkflowTimeUnit"; +import { WorkflowStep } from "../../workflowStep/base/WorkflowStep"; +import { WorkflowsOnEventType } from "../../workflowsOnEventType/base/WorkflowsOnEventType"; + +@ObjectType() +class Workflow { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + name!: string; + + @ApiProperty({ + required: true, + type: () => User, + }) + @ValidateNested() + @Type(() => User) + user?: User; + + @ApiProperty({ + required: true, + enum: EnumWorkflowTrigger, + }) + @IsEnum(EnumWorkflowTrigger) + @Field(() => EnumWorkflowTrigger, { + nullable: true, + }) + trigger?: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + time!: number | null; + + @ApiProperty({ + required: false, + enum: EnumWorkflowTimeUnit, + }) + @IsEnum(EnumWorkflowTimeUnit) + @IsOptional() + @Field(() => EnumWorkflowTimeUnit, { + nullable: true, + }) + timeUnit?: "DAY" | "HOUR" | "MINUTE" | null; + + @ApiProperty({ + required: false, + type: () => [WorkflowStep], + }) + @ValidateNested() + @Type(() => WorkflowStep) + @IsOptional() + steps?: Array<WorkflowStep>; + + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventType], + }) + @ValidateNested() + @Type(() => WorkflowsOnEventType) + @IsOptional() + activeOn?: Array<WorkflowsOnEventType>; +} + +export { Workflow as Workflow }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowCountArgs.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowCountArgs.ts new file mode 100644 index 0000000..9a74697 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereInput } from "./WorkflowWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowCountArgs { + @ApiProperty({ + required: false, + type: () => WorkflowWhereInput, + }) + @Field(() => WorkflowWhereInput, { nullable: true }) + @Type(() => WorkflowWhereInput) + where?: WorkflowWhereInput; +} + +export { WorkflowCountArgs as WorkflowCountArgs }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowCreateInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowCreateInput.ts new file mode 100644 index 0000000..e25cdfa --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowCreateInput.ts @@ -0,0 +1,102 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + ValidateNested, + IsEnum, + IsInt, + IsOptional, +} from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EnumWorkflowTrigger } from "./EnumWorkflowTrigger"; +import { EnumWorkflowTimeUnit } from "./EnumWorkflowTimeUnit"; +import { WorkflowStepCreateNestedManyWithoutWorkflowsInput } from "./WorkflowStepCreateNestedManyWithoutWorkflowsInput"; +import { WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput } from "./WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput"; + +@InputType() +class WorkflowCreateInput { + @ApiProperty({ + required: true, + type: String, + }) + @IsString() + @Field(() => String) + name!: string; + + @ApiProperty({ + required: true, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @Field(() => UserWhereUniqueInput) + user!: UserWhereUniqueInput; + + @ApiProperty({ + required: true, + enum: EnumWorkflowTrigger, + }) + @IsEnum(EnumWorkflowTrigger) + @Field(() => EnumWorkflowTrigger) + trigger!: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + time?: number | null; + + @ApiProperty({ + required: false, + enum: EnumWorkflowTimeUnit, + }) + @IsEnum(EnumWorkflowTimeUnit) + @IsOptional() + @Field(() => EnumWorkflowTimeUnit, { + nullable: true, + }) + timeUnit?: "DAY" | "HOUR" | "MINUTE" | null; + + @ApiProperty({ + required: false, + type: () => WorkflowStepCreateNestedManyWithoutWorkflowsInput, + }) + @ValidateNested() + @Type(() => WorkflowStepCreateNestedManyWithoutWorkflowsInput) + @IsOptional() + @Field(() => WorkflowStepCreateNestedManyWithoutWorkflowsInput, { + nullable: true, + }) + steps?: WorkflowStepCreateNestedManyWithoutWorkflowsInput; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput) + @IsOptional() + @Field(() => WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput, { + nullable: true, + }) + activeOn?: WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput; +} + +export { WorkflowCreateInput as WorkflowCreateInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowFindManyArgs.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowFindManyArgs.ts new file mode 100644 index 0000000..2471e21 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereInput } from "./WorkflowWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowOrderByInput } from "./WorkflowOrderByInput"; + +@ArgsType() +class WorkflowFindManyArgs { + @ApiProperty({ + required: false, + type: () => WorkflowWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => WorkflowWhereInput, { nullable: true }) + @Type(() => WorkflowWhereInput) + where?: WorkflowWhereInput; + + @ApiProperty({ + required: false, + type: [WorkflowOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [WorkflowOrderByInput], { nullable: true }) + @Type(() => WorkflowOrderByInput) + orderBy?: Array<WorkflowOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { WorkflowFindManyArgs as WorkflowFindManyArgs }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowFindUniqueArgs.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowFindUniqueArgs.ts new file mode 100644 index 0000000..4ea9c4e --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereUniqueInput } from "./WorkflowWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @Field(() => WorkflowWhereUniqueInput, { nullable: false }) + where!: WorkflowWhereUniqueInput; +} + +export { WorkflowFindUniqueArgs as WorkflowFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowListRelationFilter.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowListRelationFilter.ts new file mode 100644 index 0000000..9d6787a --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereInput } from "./WorkflowWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class WorkflowListRelationFilter { + @ApiProperty({ + required: false, + type: () => WorkflowWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereInput) + @IsOptional() + @Field(() => WorkflowWhereInput, { + nullable: true, + }) + every?: WorkflowWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereInput) + @IsOptional() + @Field(() => WorkflowWhereInput, { + nullable: true, + }) + some?: WorkflowWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereInput) + @IsOptional() + @Field(() => WorkflowWhereInput, { + nullable: true, + }) + none?: WorkflowWhereInput; +} +export { WorkflowListRelationFilter as WorkflowListRelationFilter }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowOrderByInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowOrderByInput.ts new file mode 100644 index 0000000..46ed50a --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowOrderByInput.ts @@ -0,0 +1,89 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class WorkflowOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + name?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + userId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + trigger?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + time?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + timeUnit?: SortOrder; +} + +export { WorkflowOrderByInput as WorkflowOrderByInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..896718b --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowStepCreateNestedManyWithoutWorkflowsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowStepWhereUniqueInput } from "../../workflowStep/base/WorkflowStepWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowStepCreateNestedManyWithoutWorkflowsInput { + @Field(() => [WorkflowStepWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowStepWhereUniqueInput], + }) + connect?: Array<WorkflowStepWhereUniqueInput>; +} + +export { WorkflowStepCreateNestedManyWithoutWorkflowsInput as WorkflowStepCreateNestedManyWithoutWorkflowsInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowStepUpdateManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowStepUpdateManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..687f85b --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowStepUpdateManyWithoutWorkflowsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowStepWhereUniqueInput } from "../../workflowStep/base/WorkflowStepWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowStepUpdateManyWithoutWorkflowsInput { + @Field(() => [WorkflowStepWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowStepWhereUniqueInput], + }) + connect?: Array<WorkflowStepWhereUniqueInput>; + + @Field(() => [WorkflowStepWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowStepWhereUniqueInput], + }) + disconnect?: Array<WorkflowStepWhereUniqueInput>; + + @Field(() => [WorkflowStepWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowStepWhereUniqueInput], + }) + set?: Array<WorkflowStepWhereUniqueInput>; +} + +export { WorkflowStepUpdateManyWithoutWorkflowsInput as WorkflowStepUpdateManyWithoutWorkflowsInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowUpdateInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowUpdateInput.ts new file mode 100644 index 0000000..591edda --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowUpdateInput.ts @@ -0,0 +1,111 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsString, + IsOptional, + ValidateNested, + IsEnum, + IsInt, +} from "class-validator"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EnumWorkflowTrigger } from "./EnumWorkflowTrigger"; +import { EnumWorkflowTimeUnit } from "./EnumWorkflowTimeUnit"; +import { WorkflowStepUpdateManyWithoutWorkflowsInput } from "./WorkflowStepUpdateManyWithoutWorkflowsInput"; +import { WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput } from "./WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput"; + +@InputType() +class WorkflowUpdateInput { + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + name?: string; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + enum: EnumWorkflowTrigger, + }) + @IsEnum(EnumWorkflowTrigger) + @IsOptional() + @Field(() => EnumWorkflowTrigger, { + nullable: true, + }) + trigger?: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + time?: number | null; + + @ApiProperty({ + required: false, + enum: EnumWorkflowTimeUnit, + }) + @IsEnum(EnumWorkflowTimeUnit) + @IsOptional() + @Field(() => EnumWorkflowTimeUnit, { + nullable: true, + }) + timeUnit?: "DAY" | "HOUR" | "MINUTE" | null; + + @ApiProperty({ + required: false, + type: () => WorkflowStepUpdateManyWithoutWorkflowsInput, + }) + @ValidateNested() + @Type(() => WorkflowStepUpdateManyWithoutWorkflowsInput) + @IsOptional() + @Field(() => WorkflowStepUpdateManyWithoutWorkflowsInput, { + nullable: true, + }) + steps?: WorkflowStepUpdateManyWithoutWorkflowsInput; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput) + @IsOptional() + @Field(() => WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput, { + nullable: true, + }) + activeOn?: WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput; +} + +export { WorkflowUpdateInput as WorkflowUpdateInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowWhereInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowWhereInput.ts new file mode 100644 index 0000000..af225d3 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowWhereInput.ts @@ -0,0 +1,119 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested, IsEnum } from "class-validator"; +import { StringFilter } from "../../util/StringFilter"; +import { UserWhereUniqueInput } from "../../user/base/UserWhereUniqueInput"; +import { EnumWorkflowTrigger } from "./EnumWorkflowTrigger"; +import { IntNullableFilter } from "../../util/IntNullableFilter"; +import { EnumWorkflowTimeUnit } from "./EnumWorkflowTimeUnit"; +import { WorkflowStepListRelationFilter } from "../../workflowStep/base/WorkflowStepListRelationFilter"; +import { WorkflowsOnEventTypeListRelationFilter } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeListRelationFilter"; + +@InputType() +class WorkflowWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: StringFilter, + }) + @Type(() => StringFilter) + @IsOptional() + @Field(() => StringFilter, { + nullable: true, + }) + name?: StringFilter; + + @ApiProperty({ + required: false, + type: () => UserWhereUniqueInput, + }) + @ValidateNested() + @Type(() => UserWhereUniqueInput) + @IsOptional() + @Field(() => UserWhereUniqueInput, { + nullable: true, + }) + user?: UserWhereUniqueInput; + + @ApiProperty({ + required: false, + enum: EnumWorkflowTrigger, + }) + @IsEnum(EnumWorkflowTrigger) + @IsOptional() + @Field(() => EnumWorkflowTrigger, { + nullable: true, + }) + trigger?: "BEFORE_EVENT" | "EVENT_CANCELLED" | "NEW_EVENT"; + + @ApiProperty({ + required: false, + type: IntNullableFilter, + }) + @Type(() => IntNullableFilter) + @IsOptional() + @Field(() => IntNullableFilter, { + nullable: true, + }) + time?: IntNullableFilter; + + @ApiProperty({ + required: false, + enum: EnumWorkflowTimeUnit, + }) + @IsEnum(EnumWorkflowTimeUnit) + @IsOptional() + @Field(() => EnumWorkflowTimeUnit, { + nullable: true, + }) + timeUnit?: "DAY" | "HOUR" | "MINUTE"; + + @ApiProperty({ + required: false, + type: () => WorkflowStepListRelationFilter, + }) + @ValidateNested() + @Type(() => WorkflowStepListRelationFilter) + @IsOptional() + @Field(() => WorkflowStepListRelationFilter, { + nullable: true, + }) + steps?: WorkflowStepListRelationFilter; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeListRelationFilter, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeListRelationFilter) + @IsOptional() + @Field(() => WorkflowsOnEventTypeListRelationFilter, { + nullable: true, + }) + activeOn?: WorkflowsOnEventTypeListRelationFilter; +} + +export { WorkflowWhereInput as WorkflowWhereInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowWhereUniqueInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowWhereUniqueInput.ts new file mode 100644 index 0000000..a69d3cc --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class WorkflowWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { WorkflowWhereUniqueInput as WorkflowWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..b469ecf --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput { + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + connect?: Array<WorkflowsOnEventTypeWhereUniqueInput>; +} + +export { WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput as WorkflowsOnEventTypeCreateNestedManyWithoutWorkflowsInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts b/apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts new file mode 100644 index 0000000..be4c2ae --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput { + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + connect?: Array<WorkflowsOnEventTypeWhereUniqueInput>; + + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + disconnect?: Array<WorkflowsOnEventTypeWhereUniqueInput>; + + @Field(() => [WorkflowsOnEventTypeWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowsOnEventTypeWhereUniqueInput], + }) + set?: Array<WorkflowsOnEventTypeWhereUniqueInput>; +} + +export { WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput as WorkflowsOnEventTypeUpdateManyWithoutWorkflowsInput }; diff --git a/apps/roi-cacl-2/src/workflow/base/workflow.controller.base.spec.ts b/apps/roi-cacl-2/src/workflow/base/workflow.controller.base.spec.ts new file mode 100644 index 0000000..151052e --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/workflow.controller.base.spec.ts @@ -0,0 +1,172 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { WorkflowController } from "../workflow.controller"; +import { WorkflowService } from "../workflow.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + name: "exampleName", + time: 42, +}; +const CREATE_RESULT = { + id: 42, + name: "exampleName", + time: 42, +}; +const FIND_MANY_RESULT = [ + { + id: 42, + name: "exampleName", + time: 42, + }, +]; +const FIND_ONE_RESULT = { + id: 42, + name: "exampleName", + time: 42, +}; + +const service = { + createWorkflow() { + return CREATE_RESULT; + }, + workflows: () => FIND_MANY_RESULT, + workflow: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("Workflow", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: WorkflowService, + useValue: service, + }, + ], + controllers: [WorkflowController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /workflows", async () => { + await request(app.getHttpServer()) + .post("/workflows") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /workflows", async () => { + await request(app.getHttpServer()) + .get("/workflows") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /workflows/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflows"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /workflows/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflows"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /workflows existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/workflows") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/workflows") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/workflow/base/workflow.controller.base.ts b/apps/roi-cacl-2/src/workflow/base/workflow.controller.base.ts new file mode 100644 index 0000000..81d8044 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/workflow.controller.base.ts @@ -0,0 +1,363 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { WorkflowService } from "../workflow.service"; +import { WorkflowCreateInput } from "./WorkflowCreateInput"; +import { Workflow } from "./Workflow"; +import { WorkflowFindManyArgs } from "./WorkflowFindManyArgs"; +import { WorkflowWhereUniqueInput } from "./WorkflowWhereUniqueInput"; +import { WorkflowUpdateInput } from "./WorkflowUpdateInput"; +import { WorkflowStepFindManyArgs } from "../../workflowStep/base/WorkflowStepFindManyArgs"; +import { WorkflowStep } from "../../workflowStep/base/WorkflowStep"; +import { WorkflowStepWhereUniqueInput } from "../../workflowStep/base/WorkflowStepWhereUniqueInput"; +import { WorkflowsOnEventTypeFindManyArgs } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs"; +import { WorkflowsOnEventType } from "../../workflowsOnEventType/base/WorkflowsOnEventType"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput"; + +export class WorkflowControllerBase { + constructor(protected readonly service: WorkflowService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: Workflow }) + async createWorkflow( + @common.Body() data: WorkflowCreateInput + ): Promise<Workflow> { + return await this.service.createWorkflow({ + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + name: true, + + user: { + select: { + id: true, + }, + }, + + trigger: true, + time: true, + timeUnit: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [Workflow] }) + @ApiNestedQuery(WorkflowFindManyArgs) + async workflows(@common.Req() request: Request): Promise<Workflow[]> { + const args = plainToClass(WorkflowFindManyArgs, request.query); + return this.service.workflows({ + ...args, + select: { + id: true, + name: true, + + user: { + select: { + id: true, + }, + }, + + trigger: true, + time: true, + timeUnit: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: Workflow }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async workflow( + @common.Param() params: WorkflowWhereUniqueInput + ): Promise<Workflow | null> { + const result = await this.service.workflow({ + where: params, + select: { + id: true, + name: true, + + user: { + select: { + id: true, + }, + }, + + trigger: true, + time: true, + timeUnit: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: Workflow }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateWorkflow( + @common.Param() params: WorkflowWhereUniqueInput, + @common.Body() data: WorkflowUpdateInput + ): Promise<Workflow | null> { + try { + return await this.service.updateWorkflow({ + where: params, + data: { + ...data, + + user: { + connect: data.user, + }, + }, + select: { + id: true, + name: true, + + user: { + select: { + id: true, + }, + }, + + trigger: true, + time: true, + timeUnit: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: Workflow }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteWorkflow( + @common.Param() params: WorkflowWhereUniqueInput + ): Promise<Workflow | null> { + try { + return await this.service.deleteWorkflow({ + where: params, + select: { + id: true, + name: true, + + user: { + select: { + id: true, + }, + }, + + trigger: true, + time: true, + timeUnit: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/steps") + @ApiNestedQuery(WorkflowStepFindManyArgs) + async findSteps( + @common.Req() request: Request, + @common.Param() params: WorkflowWhereUniqueInput + ): Promise<WorkflowStep[]> { + const query = plainToClass(WorkflowStepFindManyArgs, request.query); + const results = await this.service.findSteps(params.id, { + ...query, + select: { + id: true, + stepNumber: true, + action: true, + + workflow: { + select: { + id: true, + }, + }, + + sendTo: true, + reminderBody: true, + emailSubject: true, + template: true, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/steps") + async connectSteps( + @common.Param() params: WorkflowWhereUniqueInput, + @common.Body() body: WorkflowStepWhereUniqueInput[] + ): Promise<void> { + const data = { + steps: { + connect: body, + }, + }; + await this.service.updateWorkflow({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/steps") + async updateSteps( + @common.Param() params: WorkflowWhereUniqueInput, + @common.Body() body: WorkflowStepWhereUniqueInput[] + ): Promise<void> { + const data = { + steps: { + set: body, + }, + }; + await this.service.updateWorkflow({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/steps") + async disconnectSteps( + @common.Param() params: WorkflowWhereUniqueInput, + @common.Body() body: WorkflowStepWhereUniqueInput[] + ): Promise<void> { + const data = { + steps: { + disconnect: body, + }, + }; + await this.service.updateWorkflow({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Get("/:id/activeOn") + @ApiNestedQuery(WorkflowsOnEventTypeFindManyArgs) + async findActiveOn( + @common.Req() request: Request, + @common.Param() params: WorkflowWhereUniqueInput + ): Promise<WorkflowsOnEventType[]> { + const query = plainToClass(WorkflowsOnEventTypeFindManyArgs, request.query); + const results = await this.service.findActiveOn(params.id, { + ...query, + select: { + id: true, + + workflow: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/activeOn") + async connectActiveOn( + @common.Param() params: WorkflowWhereUniqueInput, + @common.Body() body: WorkflowsOnEventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + activeOn: { + connect: body, + }, + }; + await this.service.updateWorkflow({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/activeOn") + async updateActiveOn( + @common.Param() params: WorkflowWhereUniqueInput, + @common.Body() body: WorkflowsOnEventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + activeOn: { + set: body, + }, + }; + await this.service.updateWorkflow({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/activeOn") + async disconnectActiveOn( + @common.Param() params: WorkflowWhereUniqueInput, + @common.Body() body: WorkflowsOnEventTypeWhereUniqueInput[] + ): Promise<void> { + const data = { + activeOn: { + disconnect: body, + }, + }; + await this.service.updateWorkflow({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/workflow/base/workflow.module.base.ts b/apps/roi-cacl-2/src/workflow/base/workflow.module.base.ts new file mode 100644 index 0000000..34e4af3 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/workflow.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class WorkflowModuleBase {} diff --git a/apps/roi-cacl-2/src/workflow/base/workflow.resolver.base.ts b/apps/roi-cacl-2/src/workflow/base/workflow.resolver.base.ts new file mode 100644 index 0000000..7517683 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/workflow.resolver.base.ts @@ -0,0 +1,157 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { Workflow } from "./Workflow"; +import { WorkflowCountArgs } from "./WorkflowCountArgs"; +import { WorkflowFindManyArgs } from "./WorkflowFindManyArgs"; +import { WorkflowFindUniqueArgs } from "./WorkflowFindUniqueArgs"; +import { CreateWorkflowArgs } from "./CreateWorkflowArgs"; +import { UpdateWorkflowArgs } from "./UpdateWorkflowArgs"; +import { DeleteWorkflowArgs } from "./DeleteWorkflowArgs"; +import { WorkflowStepFindManyArgs } from "../../workflowStep/base/WorkflowStepFindManyArgs"; +import { WorkflowStep } from "../../workflowStep/base/WorkflowStep"; +import { WorkflowsOnEventTypeFindManyArgs } from "../../workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs"; +import { WorkflowsOnEventType } from "../../workflowsOnEventType/base/WorkflowsOnEventType"; +import { User } from "../../user/base/User"; +import { WorkflowService } from "../workflow.service"; +@graphql.Resolver(() => Workflow) +export class WorkflowResolverBase { + constructor(protected readonly service: WorkflowService) {} + + async _workflowsMeta( + @graphql.Args() args: WorkflowCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [Workflow]) + async workflows( + @graphql.Args() args: WorkflowFindManyArgs + ): Promise<Workflow[]> { + return this.service.workflows(args); + } + + @graphql.Query(() => Workflow, { nullable: true }) + async workflow( + @graphql.Args() args: WorkflowFindUniqueArgs + ): Promise<Workflow | null> { + const result = await this.service.workflow(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => Workflow) + async createWorkflow( + @graphql.Args() args: CreateWorkflowArgs + ): Promise<Workflow> { + return await this.service.createWorkflow({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } + + @graphql.Mutation(() => Workflow) + async updateWorkflow( + @graphql.Args() args: UpdateWorkflowArgs + ): Promise<Workflow | null> { + try { + return await this.service.updateWorkflow({ + ...args, + data: { + ...args.data, + + user: { + connect: args.data.user, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => Workflow) + async deleteWorkflow( + @graphql.Args() args: DeleteWorkflowArgs + ): Promise<Workflow | null> { + try { + return await this.service.deleteWorkflow(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [WorkflowStep], { name: "steps" }) + async findSteps( + @graphql.Parent() parent: Workflow, + @graphql.Args() args: WorkflowStepFindManyArgs + ): Promise<WorkflowStep[]> { + const results = await this.service.findSteps(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => [WorkflowsOnEventType], { name: "activeOn" }) + async findActiveOn( + @graphql.Parent() parent: Workflow, + @graphql.Args() args: WorkflowsOnEventTypeFindManyArgs + ): Promise<WorkflowsOnEventType[]> { + const results = await this.service.findActiveOn(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => User, { + nullable: true, + name: "user", + }) + async getUser(@graphql.Parent() parent: Workflow): Promise<User | null> { + const result = await this.service.getUser(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/workflow/base/workflow.service.base.ts b/apps/roi-cacl-2/src/workflow/base/workflow.service.base.ts new file mode 100644 index 0000000..86fa520 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/base/workflow.service.base.ts @@ -0,0 +1,84 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + Workflow as PrismaWorkflow, + WorkflowStep as PrismaWorkflowStep, + WorkflowsOnEventType as PrismaWorkflowsOnEventType, + User as PrismaUser, +} from "@prisma/client"; + +export class WorkflowServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count(args: Omit<Prisma.WorkflowCountArgs, "select">): Promise<number> { + return this.prisma.workflow.count(args); + } + + async workflows<T extends Prisma.WorkflowFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowFindManyArgs> + ): Promise<PrismaWorkflow[]> { + return this.prisma.workflow.findMany<Prisma.WorkflowFindManyArgs>(args); + } + async workflow<T extends Prisma.WorkflowFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowFindUniqueArgs> + ): Promise<PrismaWorkflow | null> { + return this.prisma.workflow.findUnique(args); + } + async createWorkflow<T extends Prisma.WorkflowCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowCreateArgs> + ): Promise<PrismaWorkflow> { + return this.prisma.workflow.create<T>(args); + } + async updateWorkflow<T extends Prisma.WorkflowUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowUpdateArgs> + ): Promise<PrismaWorkflow> { + return this.prisma.workflow.update<T>(args); + } + async deleteWorkflow<T extends Prisma.WorkflowDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowDeleteArgs> + ): Promise<PrismaWorkflow> { + return this.prisma.workflow.delete(args); + } + + async findSteps( + parentId: number, + args: Prisma.WorkflowStepFindManyArgs + ): Promise<PrismaWorkflowStep[]> { + return this.prisma.workflow + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .steps(args); + } + + async findActiveOn( + parentId: number, + args: Prisma.WorkflowsOnEventTypeFindManyArgs + ): Promise<PrismaWorkflowsOnEventType[]> { + return this.prisma.workflow + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .activeOn(args); + } + + async getUser(parentId: number): Promise<PrismaUser | null> { + return this.prisma.workflow + .findUnique({ + where: { id: parentId }, + }) + .user(); + } +} diff --git a/apps/roi-cacl-2/src/workflow/workflow.controller.ts b/apps/roi-cacl-2/src/workflow/workflow.controller.ts new file mode 100644 index 0000000..52b5699 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/workflow.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { WorkflowService } from "./workflow.service"; +import { WorkflowControllerBase } from "./base/workflow.controller.base"; + +@swagger.ApiTags("workflows") +@common.Controller("workflows") +export class WorkflowController extends WorkflowControllerBase { + constructor(protected readonly service: WorkflowService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflow/workflow.module.ts b/apps/roi-cacl-2/src/workflow/workflow.module.ts new file mode 100644 index 0000000..bcee4da --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/workflow.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { WorkflowModuleBase } from "./base/workflow.module.base"; +import { WorkflowService } from "./workflow.service"; +import { WorkflowController } from "./workflow.controller"; +import { WorkflowResolver } from "./workflow.resolver"; + +@Module({ + imports: [WorkflowModuleBase], + controllers: [WorkflowController], + providers: [WorkflowService, WorkflowResolver], + exports: [WorkflowService], +}) +export class WorkflowModule {} diff --git a/apps/roi-cacl-2/src/workflow/workflow.resolver.ts b/apps/roi-cacl-2/src/workflow/workflow.resolver.ts new file mode 100644 index 0000000..d9593c9 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/workflow.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { WorkflowResolverBase } from "./base/workflow.resolver.base"; +import { Workflow } from "./base/Workflow"; +import { WorkflowService } from "./workflow.service"; + +@graphql.Resolver(() => Workflow) +export class WorkflowResolver extends WorkflowResolverBase { + constructor(protected readonly service: WorkflowService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflow/workflow.service.ts b/apps/roi-cacl-2/src/workflow/workflow.service.ts new file mode 100644 index 0000000..f12f940 --- /dev/null +++ b/apps/roi-cacl-2/src/workflow/workflow.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { WorkflowServiceBase } from "./base/workflow.service.base"; + +@Injectable() +export class WorkflowService extends WorkflowServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/workflowReminder/base/CreateWorkflowReminderArgs.ts b/apps/roi-cacl-2/src/workflowReminder/base/CreateWorkflowReminderArgs.ts new file mode 100644 index 0000000..4a0ed4b --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/CreateWorkflowReminderArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowReminderCreateInput } from "./WorkflowReminderCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateWorkflowReminderArgs { + @ApiProperty({ + required: true, + type: () => WorkflowReminderCreateInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderCreateInput) + @Field(() => WorkflowReminderCreateInput, { nullable: false }) + data!: WorkflowReminderCreateInput; +} + +export { CreateWorkflowReminderArgs as CreateWorkflowReminderArgs }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/DeleteWorkflowReminderArgs.ts b/apps/roi-cacl-2/src/workflowReminder/base/DeleteWorkflowReminderArgs.ts new file mode 100644 index 0000000..4fa0572 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/DeleteWorkflowReminderArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowReminderWhereUniqueInput } from "./WorkflowReminderWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteWorkflowReminderArgs { + @ApiProperty({ + required: true, + type: () => WorkflowReminderWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderWhereUniqueInput) + @Field(() => WorkflowReminderWhereUniqueInput, { nullable: false }) + where!: WorkflowReminderWhereUniqueInput; +} + +export { DeleteWorkflowReminderArgs as DeleteWorkflowReminderArgs }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/EnumWorkflowReminderMethod.ts b/apps/roi-cacl-2/src/workflowReminder/base/EnumWorkflowReminderMethod.ts new file mode 100644 index 0000000..042984c --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/EnumWorkflowReminderMethod.ts @@ -0,0 +1,21 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumWorkflowReminderMethod { + Email = "EMAIL", + Sms = "SMS", +} + +registerEnumType(EnumWorkflowReminderMethod, { + name: "EnumWorkflowReminderMethod", +}); diff --git a/apps/roi-cacl-2/src/workflowReminder/base/UpdateWorkflowReminderArgs.ts b/apps/roi-cacl-2/src/workflowReminder/base/UpdateWorkflowReminderArgs.ts new file mode 100644 index 0000000..c2cbc8f --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/UpdateWorkflowReminderArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowReminderWhereUniqueInput } from "./WorkflowReminderWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowReminderUpdateInput } from "./WorkflowReminderUpdateInput"; + +@ArgsType() +class UpdateWorkflowReminderArgs { + @ApiProperty({ + required: true, + type: () => WorkflowReminderWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderWhereUniqueInput) + @Field(() => WorkflowReminderWhereUniqueInput, { nullable: false }) + where!: WorkflowReminderWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => WorkflowReminderUpdateInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderUpdateInput) + @Field(() => WorkflowReminderUpdateInput, { nullable: false }) + data!: WorkflowReminderUpdateInput; +} + +export { UpdateWorkflowReminderArgs as UpdateWorkflowReminderArgs }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminder.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminder.ts new file mode 100644 index 0000000..64a9853 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminder.ts @@ -0,0 +1,93 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + ValidateNested, + IsOptional, + IsEnum, + IsDate, + IsString, + IsBoolean, +} from "class-validator"; +import { Booking } from "../../booking/base/Booking"; +import { Type } from "class-transformer"; +import { EnumWorkflowReminderMethod } from "./EnumWorkflowReminderMethod"; +import { WorkflowStep } from "../../workflowStep/base/WorkflowStep"; + +@ObjectType() +class WorkflowReminder { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: false, + type: () => Booking, + }) + @ValidateNested() + @Type(() => Booking) + @IsOptional() + booking?: Booking | null; + + @ApiProperty({ + required: true, + enum: EnumWorkflowReminderMethod, + }) + @IsEnum(EnumWorkflowReminderMethod) + @Field(() => EnumWorkflowReminderMethod, { + nullable: true, + }) + method?: "EMAIL" | "SMS"; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + scheduledDate!: Date; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + referenceId!: string | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + scheduled!: boolean; + + @ApiProperty({ + required: true, + type: () => WorkflowStep, + }) + @ValidateNested() + @Type(() => WorkflowStep) + workflowStep?: WorkflowStep; +} + +export { WorkflowReminder as WorkflowReminder }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCountArgs.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCountArgs.ts new file mode 100644 index 0000000..adf8329 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowReminderWhereInput } from "./WorkflowReminderWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowReminderCountArgs { + @ApiProperty({ + required: false, + type: () => WorkflowReminderWhereInput, + }) + @Field(() => WorkflowReminderWhereInput, { nullable: true }) + @Type(() => WorkflowReminderWhereInput) + where?: WorkflowReminderWhereInput; +} + +export { WorkflowReminderCountArgs as WorkflowReminderCountArgs }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCreateInput.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCreateInput.ts new file mode 100644 index 0000000..b53513d --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderCreateInput.ts @@ -0,0 +1,86 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { + ValidateNested, + IsOptional, + IsEnum, + IsDate, + IsString, + IsBoolean, +} from "class-validator"; +import { Type } from "class-transformer"; +import { EnumWorkflowReminderMethod } from "./EnumWorkflowReminderMethod"; +import { WorkflowStepWhereUniqueInput } from "../../workflowStep/base/WorkflowStepWhereUniqueInput"; + +@InputType() +class WorkflowReminderCreateInput { + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: true, + enum: EnumWorkflowReminderMethod, + }) + @IsEnum(EnumWorkflowReminderMethod) + @Field(() => EnumWorkflowReminderMethod) + method!: "EMAIL" | "SMS"; + + @ApiProperty({ + required: true, + }) + @IsDate() + @Type(() => Date) + @Field(() => Date) + scheduledDate!: Date; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + referenceId?: string | null; + + @ApiProperty({ + required: true, + type: Boolean, + }) + @IsBoolean() + @Field(() => Boolean) + scheduled!: boolean; + + @ApiProperty({ + required: true, + type: () => WorkflowStepWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereUniqueInput) + @Field(() => WorkflowStepWhereUniqueInput) + workflowStep!: WorkflowStepWhereUniqueInput; +} + +export { WorkflowReminderCreateInput as WorkflowReminderCreateInput }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindManyArgs.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindManyArgs.ts new file mode 100644 index 0000000..dffc2d2 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowReminderWhereInput } from "./WorkflowReminderWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowReminderOrderByInput } from "./WorkflowReminderOrderByInput"; + +@ArgsType() +class WorkflowReminderFindManyArgs { + @ApiProperty({ + required: false, + type: () => WorkflowReminderWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => WorkflowReminderWhereInput, { nullable: true }) + @Type(() => WorkflowReminderWhereInput) + where?: WorkflowReminderWhereInput; + + @ApiProperty({ + required: false, + type: [WorkflowReminderOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [WorkflowReminderOrderByInput], { nullable: true }) + @Type(() => WorkflowReminderOrderByInput) + orderBy?: Array<WorkflowReminderOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { WorkflowReminderFindManyArgs as WorkflowReminderFindManyArgs }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindUniqueArgs.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindUniqueArgs.ts new file mode 100644 index 0000000..3ecfb70 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowReminderWhereUniqueInput } from "./WorkflowReminderWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowReminderFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => WorkflowReminderWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderWhereUniqueInput) + @Field(() => WorkflowReminderWhereUniqueInput, { nullable: false }) + where!: WorkflowReminderWhereUniqueInput; +} + +export { WorkflowReminderFindUniqueArgs as WorkflowReminderFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderListRelationFilter.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderListRelationFilter.ts new file mode 100644 index 0000000..0431e50 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowReminderWhereInput } from "./WorkflowReminderWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class WorkflowReminderListRelationFilter { + @ApiProperty({ + required: false, + type: () => WorkflowReminderWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderWhereInput) + @IsOptional() + @Field(() => WorkflowReminderWhereInput, { + nullable: true, + }) + every?: WorkflowReminderWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderWhereInput) + @IsOptional() + @Field(() => WorkflowReminderWhereInput, { + nullable: true, + }) + some?: WorkflowReminderWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderWhereInput) + @IsOptional() + @Field(() => WorkflowReminderWhereInput, { + nullable: true, + }) + none?: WorkflowReminderWhereInput; +} +export { WorkflowReminderListRelationFilter as WorkflowReminderListRelationFilter }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderOrderByInput.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderOrderByInput.ts new file mode 100644 index 0000000..fdcc0fa --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderOrderByInput.ts @@ -0,0 +1,100 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class WorkflowReminderOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + bookingUid?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + method?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + scheduledDate?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + referenceId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + scheduled?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + workflowStepId?: SortOrder; +} + +export { WorkflowReminderOrderByInput as WorkflowReminderOrderByInput }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderUpdateInput.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderUpdateInput.ts new file mode 100644 index 0000000..f49e1b6 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderUpdateInput.ts @@ -0,0 +1,98 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { + ValidateNested, + IsOptional, + IsEnum, + IsDate, + IsString, + IsBoolean, +} from "class-validator"; +import { Type } from "class-transformer"; +import { EnumWorkflowReminderMethod } from "./EnumWorkflowReminderMethod"; +import { WorkflowStepWhereUniqueInput } from "../../workflowStep/base/WorkflowStepWhereUniqueInput"; + +@InputType() +class WorkflowReminderUpdateInput { + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput | null; + + @ApiProperty({ + required: false, + enum: EnumWorkflowReminderMethod, + }) + @IsEnum(EnumWorkflowReminderMethod) + @IsOptional() + @Field(() => EnumWorkflowReminderMethod, { + nullable: true, + }) + method?: "EMAIL" | "SMS"; + + @ApiProperty({ + required: false, + }) + @IsDate() + @Type(() => Date) + @IsOptional() + @Field(() => Date, { + nullable: true, + }) + scheduledDate?: Date; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + referenceId?: string | null; + + @ApiProperty({ + required: false, + type: Boolean, + }) + @IsBoolean() + @IsOptional() + @Field(() => Boolean, { + nullable: true, + }) + scheduled?: boolean; + + @ApiProperty({ + required: false, + type: () => WorkflowStepWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereUniqueInput) + @IsOptional() + @Field(() => WorkflowStepWhereUniqueInput, { + nullable: true, + }) + workflowStep?: WorkflowStepWhereUniqueInput; +} + +export { WorkflowReminderUpdateInput as WorkflowReminderUpdateInput }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereInput.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereInput.ts new file mode 100644 index 0000000..ca7ba9b --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereInput.ts @@ -0,0 +1,106 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested, IsEnum } from "class-validator"; +import { BookingWhereUniqueInput } from "../../booking/base/BookingWhereUniqueInput"; +import { EnumWorkflowReminderMethod } from "./EnumWorkflowReminderMethod"; +import { DateTimeFilter } from "../../util/DateTimeFilter"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { BooleanFilter } from "../../util/BooleanFilter"; +import { WorkflowStepWhereUniqueInput } from "../../workflowStep/base/WorkflowStepWhereUniqueInput"; + +@InputType() +class WorkflowReminderWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: () => BookingWhereUniqueInput, + }) + @ValidateNested() + @Type(() => BookingWhereUniqueInput) + @IsOptional() + @Field(() => BookingWhereUniqueInput, { + nullable: true, + }) + booking?: BookingWhereUniqueInput; + + @ApiProperty({ + required: false, + enum: EnumWorkflowReminderMethod, + }) + @IsEnum(EnumWorkflowReminderMethod) + @IsOptional() + @Field(() => EnumWorkflowReminderMethod, { + nullable: true, + }) + method?: "EMAIL" | "SMS"; + + @ApiProperty({ + required: false, + type: DateTimeFilter, + }) + @Type(() => DateTimeFilter) + @IsOptional() + @Field(() => DateTimeFilter, { + nullable: true, + }) + scheduledDate?: DateTimeFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + referenceId?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: BooleanFilter, + }) + @Type(() => BooleanFilter) + @IsOptional() + @Field(() => BooleanFilter, { + nullable: true, + }) + scheduled?: BooleanFilter; + + @ApiProperty({ + required: false, + type: () => WorkflowStepWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereUniqueInput) + @IsOptional() + @Field(() => WorkflowStepWhereUniqueInput, { + nullable: true, + }) + workflowStep?: WorkflowStepWhereUniqueInput; +} + +export { WorkflowReminderWhereInput as WorkflowReminderWhereInput }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereUniqueInput.ts b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereUniqueInput.ts new file mode 100644 index 0000000..534c778 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/WorkflowReminderWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class WorkflowReminderWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { WorkflowReminderWhereUniqueInput as WorkflowReminderWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.spec.ts b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.spec.ts new file mode 100644 index 0000000..f60441e --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.spec.ts @@ -0,0 +1,190 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { WorkflowReminderController } from "../workflowReminder.controller"; +import { WorkflowReminderService } from "../workflowReminder.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + scheduledDate: new Date(), + referenceId: "exampleReferenceId", + scheduled: "true", +}; +const CREATE_RESULT = { + id: 42, + scheduledDate: new Date(), + referenceId: "exampleReferenceId", + scheduled: "true", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + scheduledDate: new Date(), + referenceId: "exampleReferenceId", + scheduled: "true", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + scheduledDate: new Date(), + referenceId: "exampleReferenceId", + scheduled: "true", +}; + +const service = { + createWorkflowReminder() { + return CREATE_RESULT; + }, + workflowReminders: () => FIND_MANY_RESULT, + workflowReminder: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("WorkflowReminder", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: WorkflowReminderService, + useValue: service, + }, + ], + controllers: [WorkflowReminderController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /workflowReminders", async () => { + await request(app.getHttpServer()) + .post("/workflowReminders") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + scheduledDate: CREATE_RESULT.scheduledDate.toISOString(), + }); + }); + + test("GET /workflowReminders", async () => { + await request(app.getHttpServer()) + .get("/workflowReminders") + .expect(HttpStatus.OK) + .expect([ + { + ...FIND_MANY_RESULT[0], + scheduledDate: FIND_MANY_RESULT[0].scheduledDate.toISOString(), + }, + ]); + }); + + test("GET /workflowReminders/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflowReminders"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /workflowReminders/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflowReminders"}/${existingId}`) + .expect(HttpStatus.OK) + .expect({ + ...FIND_ONE_RESULT, + scheduledDate: FIND_ONE_RESULT.scheduledDate.toISOString(), + }); + }); + + test("POST /workflowReminders existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/workflowReminders") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect({ + ...CREATE_RESULT, + scheduledDate: CREATE_RESULT.scheduledDate.toISOString(), + }) + .then(function () { + agent + .post("/workflowReminders") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.ts b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.ts new file mode 100644 index 0000000..955dc0c --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.controller.base.ts @@ -0,0 +1,232 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { WorkflowReminderService } from "../workflowReminder.service"; +import { WorkflowReminderCreateInput } from "./WorkflowReminderCreateInput"; +import { WorkflowReminder } from "./WorkflowReminder"; +import { WorkflowReminderFindManyArgs } from "./WorkflowReminderFindManyArgs"; +import { WorkflowReminderWhereUniqueInput } from "./WorkflowReminderWhereUniqueInput"; +import { WorkflowReminderUpdateInput } from "./WorkflowReminderUpdateInput"; + +export class WorkflowReminderControllerBase { + constructor(protected readonly service: WorkflowReminderService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: WorkflowReminder }) + async createWorkflowReminder( + @common.Body() data: WorkflowReminderCreateInput + ): Promise<WorkflowReminder> { + return await this.service.createWorkflowReminder({ + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + + workflowStep: { + connect: data.workflowStep, + }, + }, + select: { + id: true, + + booking: { + select: { + id: true, + }, + }, + + method: true, + scheduledDate: true, + referenceId: true, + scheduled: true, + + workflowStep: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [WorkflowReminder] }) + @ApiNestedQuery(WorkflowReminderFindManyArgs) + async workflowReminders( + @common.Req() request: Request + ): Promise<WorkflowReminder[]> { + const args = plainToClass(WorkflowReminderFindManyArgs, request.query); + return this.service.workflowReminders({ + ...args, + select: { + id: true, + + booking: { + select: { + id: true, + }, + }, + + method: true, + scheduledDate: true, + referenceId: true, + scheduled: true, + + workflowStep: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: WorkflowReminder }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async workflowReminder( + @common.Param() params: WorkflowReminderWhereUniqueInput + ): Promise<WorkflowReminder | null> { + const result = await this.service.workflowReminder({ + where: params, + select: { + id: true, + + booking: { + select: { + id: true, + }, + }, + + method: true, + scheduledDate: true, + referenceId: true, + scheduled: true, + + workflowStep: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: WorkflowReminder }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateWorkflowReminder( + @common.Param() params: WorkflowReminderWhereUniqueInput, + @common.Body() data: WorkflowReminderUpdateInput + ): Promise<WorkflowReminder | null> { + try { + return await this.service.updateWorkflowReminder({ + where: params, + data: { + ...data, + + booking: data.booking + ? { + connect: data.booking, + } + : undefined, + + workflowStep: { + connect: data.workflowStep, + }, + }, + select: { + id: true, + + booking: { + select: { + id: true, + }, + }, + + method: true, + scheduledDate: true, + referenceId: true, + scheduled: true, + + workflowStep: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: WorkflowReminder }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteWorkflowReminder( + @common.Param() params: WorkflowReminderWhereUniqueInput + ): Promise<WorkflowReminder | null> { + try { + return await this.service.deleteWorkflowReminder({ + where: params, + select: { + id: true, + + booking: { + select: { + id: true, + }, + }, + + method: true, + scheduledDate: true, + referenceId: true, + scheduled: true, + + workflowStep: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.module.base.ts b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.module.base.ts new file mode 100644 index 0000000..a5bf7f6 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class WorkflowReminderModuleBase {} diff --git a/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.resolver.base.ts b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.resolver.base.ts new file mode 100644 index 0000000..2aef60f --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.resolver.base.ts @@ -0,0 +1,155 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { WorkflowReminder } from "./WorkflowReminder"; +import { WorkflowReminderCountArgs } from "./WorkflowReminderCountArgs"; +import { WorkflowReminderFindManyArgs } from "./WorkflowReminderFindManyArgs"; +import { WorkflowReminderFindUniqueArgs } from "./WorkflowReminderFindUniqueArgs"; +import { CreateWorkflowReminderArgs } from "./CreateWorkflowReminderArgs"; +import { UpdateWorkflowReminderArgs } from "./UpdateWorkflowReminderArgs"; +import { DeleteWorkflowReminderArgs } from "./DeleteWorkflowReminderArgs"; +import { Booking } from "../../booking/base/Booking"; +import { WorkflowStep } from "../../workflowStep/base/WorkflowStep"; +import { WorkflowReminderService } from "../workflowReminder.service"; +@graphql.Resolver(() => WorkflowReminder) +export class WorkflowReminderResolverBase { + constructor(protected readonly service: WorkflowReminderService) {} + + async _workflowRemindersMeta( + @graphql.Args() args: WorkflowReminderCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [WorkflowReminder]) + async workflowReminders( + @graphql.Args() args: WorkflowReminderFindManyArgs + ): Promise<WorkflowReminder[]> { + return this.service.workflowReminders(args); + } + + @graphql.Query(() => WorkflowReminder, { nullable: true }) + async workflowReminder( + @graphql.Args() args: WorkflowReminderFindUniqueArgs + ): Promise<WorkflowReminder | null> { + const result = await this.service.workflowReminder(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => WorkflowReminder) + async createWorkflowReminder( + @graphql.Args() args: CreateWorkflowReminderArgs + ): Promise<WorkflowReminder> { + return await this.service.createWorkflowReminder({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + + workflowStep: { + connect: args.data.workflowStep, + }, + }, + }); + } + + @graphql.Mutation(() => WorkflowReminder) + async updateWorkflowReminder( + @graphql.Args() args: UpdateWorkflowReminderArgs + ): Promise<WorkflowReminder | null> { + try { + return await this.service.updateWorkflowReminder({ + ...args, + data: { + ...args.data, + + booking: args.data.booking + ? { + connect: args.data.booking, + } + : undefined, + + workflowStep: { + connect: args.data.workflowStep, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => WorkflowReminder) + async deleteWorkflowReminder( + @graphql.Args() args: DeleteWorkflowReminderArgs + ): Promise<WorkflowReminder | null> { + try { + return await this.service.deleteWorkflowReminder(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => Booking, { + nullable: true, + name: "booking", + }) + async getBooking( + @graphql.Parent() parent: WorkflowReminder + ): Promise<Booking | null> { + const result = await this.service.getBooking(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => WorkflowStep, { + nullable: true, + name: "workflowStep", + }) + async getWorkflowStep( + @graphql.Parent() parent: WorkflowReminder + ): Promise<WorkflowStep | null> { + const result = await this.service.getWorkflowStep(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.service.base.ts b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.service.base.ts new file mode 100644 index 0000000..6818e53 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/base/workflowReminder.service.base.ts @@ -0,0 +1,73 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + WorkflowReminder as PrismaWorkflowReminder, + Booking as PrismaBooking, + WorkflowStep as PrismaWorkflowStep, +} from "@prisma/client"; + +export class WorkflowReminderServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.WorkflowReminderCountArgs, "select"> + ): Promise<number> { + return this.prisma.workflowReminder.count(args); + } + + async workflowReminders<T extends Prisma.WorkflowReminderFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowReminderFindManyArgs> + ): Promise<PrismaWorkflowReminder[]> { + return this.prisma.workflowReminder.findMany<Prisma.WorkflowReminderFindManyArgs>( + args + ); + } + async workflowReminder<T extends Prisma.WorkflowReminderFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowReminderFindUniqueArgs> + ): Promise<PrismaWorkflowReminder | null> { + return this.prisma.workflowReminder.findUnique(args); + } + async createWorkflowReminder<T extends Prisma.WorkflowReminderCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowReminderCreateArgs> + ): Promise<PrismaWorkflowReminder> { + return this.prisma.workflowReminder.create<T>(args); + } + async updateWorkflowReminder<T extends Prisma.WorkflowReminderUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowReminderUpdateArgs> + ): Promise<PrismaWorkflowReminder> { + return this.prisma.workflowReminder.update<T>(args); + } + async deleteWorkflowReminder<T extends Prisma.WorkflowReminderDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowReminderDeleteArgs> + ): Promise<PrismaWorkflowReminder> { + return this.prisma.workflowReminder.delete(args); + } + + async getBooking(parentId: number): Promise<PrismaBooking | null> { + return this.prisma.workflowReminder + .findUnique({ + where: { id: parentId }, + }) + .booking(); + } + + async getWorkflowStep(parentId: number): Promise<PrismaWorkflowStep | null> { + return this.prisma.workflowReminder + .findUnique({ + where: { id: parentId }, + }) + .workflowStep(); + } +} diff --git a/apps/roi-cacl-2/src/workflowReminder/workflowReminder.controller.ts b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.controller.ts new file mode 100644 index 0000000..6bb3138 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { WorkflowReminderService } from "./workflowReminder.service"; +import { WorkflowReminderControllerBase } from "./base/workflowReminder.controller.base"; + +@swagger.ApiTags("workflowReminders") +@common.Controller("workflowReminders") +export class WorkflowReminderController extends WorkflowReminderControllerBase { + constructor(protected readonly service: WorkflowReminderService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflowReminder/workflowReminder.module.ts b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.module.ts new file mode 100644 index 0000000..abae12e --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { WorkflowReminderModuleBase } from "./base/workflowReminder.module.base"; +import { WorkflowReminderService } from "./workflowReminder.service"; +import { WorkflowReminderController } from "./workflowReminder.controller"; +import { WorkflowReminderResolver } from "./workflowReminder.resolver"; + +@Module({ + imports: [WorkflowReminderModuleBase], + controllers: [WorkflowReminderController], + providers: [WorkflowReminderService, WorkflowReminderResolver], + exports: [WorkflowReminderService], +}) +export class WorkflowReminderModule {} diff --git a/apps/roi-cacl-2/src/workflowReminder/workflowReminder.resolver.ts b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.resolver.ts new file mode 100644 index 0000000..aba5763 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { WorkflowReminderResolverBase } from "./base/workflowReminder.resolver.base"; +import { WorkflowReminder } from "./base/WorkflowReminder"; +import { WorkflowReminderService } from "./workflowReminder.service"; + +@graphql.Resolver(() => WorkflowReminder) +export class WorkflowReminderResolver extends WorkflowReminderResolverBase { + constructor(protected readonly service: WorkflowReminderService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflowReminder/workflowReminder.service.ts b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.service.ts new file mode 100644 index 0000000..6108cf8 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowReminder/workflowReminder.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { WorkflowReminderServiceBase } from "./base/workflowReminder.service.base"; + +@Injectable() +export class WorkflowReminderService extends WorkflowReminderServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/workflowStep/base/CreateWorkflowStepArgs.ts b/apps/roi-cacl-2/src/workflowStep/base/CreateWorkflowStepArgs.ts new file mode 100644 index 0000000..731a9a2 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/CreateWorkflowStepArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowStepCreateInput } from "./WorkflowStepCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateWorkflowStepArgs { + @ApiProperty({ + required: true, + type: () => WorkflowStepCreateInput, + }) + @ValidateNested() + @Type(() => WorkflowStepCreateInput) + @Field(() => WorkflowStepCreateInput, { nullable: false }) + data!: WorkflowStepCreateInput; +} + +export { CreateWorkflowStepArgs as CreateWorkflowStepArgs }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/DeleteWorkflowStepArgs.ts b/apps/roi-cacl-2/src/workflowStep/base/DeleteWorkflowStepArgs.ts new file mode 100644 index 0000000..f16a4bf --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/DeleteWorkflowStepArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowStepWhereUniqueInput } from "./WorkflowStepWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteWorkflowStepArgs { + @ApiProperty({ + required: true, + type: () => WorkflowStepWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereUniqueInput) + @Field(() => WorkflowStepWhereUniqueInput, { nullable: false }) + where!: WorkflowStepWhereUniqueInput; +} + +export { DeleteWorkflowStepArgs as DeleteWorkflowStepArgs }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepAction.ts b/apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepAction.ts new file mode 100644 index 0000000..b2838cd --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepAction.ts @@ -0,0 +1,23 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumWorkflowStepAction { + EmailHost = "EMAIL_HOST", + EmailAttendee = "EMAIL_ATTENDEE", + SmsAttendee = "SMS_ATTENDEE", + SmsNumber = "SMS_NUMBER", +} + +registerEnumType(EnumWorkflowStepAction, { + name: "EnumWorkflowStepAction", +}); diff --git a/apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepTemplate.ts b/apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepTemplate.ts new file mode 100644 index 0000000..6943e6d --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/EnumWorkflowStepTemplate.ts @@ -0,0 +1,21 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { registerEnumType } from "@nestjs/graphql"; + +export enum EnumWorkflowStepTemplate { + Reminder = "REMINDER", + Custom = "CUSTOM", +} + +registerEnumType(EnumWorkflowStepTemplate, { + name: "EnumWorkflowStepTemplate", +}); diff --git a/apps/roi-cacl-2/src/workflowStep/base/UpdateWorkflowStepArgs.ts b/apps/roi-cacl-2/src/workflowStep/base/UpdateWorkflowStepArgs.ts new file mode 100644 index 0000000..3e7f900 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/UpdateWorkflowStepArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowStepWhereUniqueInput } from "./WorkflowStepWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowStepUpdateInput } from "./WorkflowStepUpdateInput"; + +@ArgsType() +class UpdateWorkflowStepArgs { + @ApiProperty({ + required: true, + type: () => WorkflowStepWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereUniqueInput) + @Field(() => WorkflowStepWhereUniqueInput, { nullable: false }) + where!: WorkflowStepWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => WorkflowStepUpdateInput, + }) + @ValidateNested() + @Type(() => WorkflowStepUpdateInput) + @Field(() => WorkflowStepUpdateInput, { nullable: false }) + data!: WorkflowStepUpdateInput; +} + +export { UpdateWorkflowStepArgs as UpdateWorkflowStepArgs }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts new file mode 100644 index 0000000..192594f --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowReminderWhereUniqueInput } from "../../workflowReminder/base/WorkflowReminderWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput { + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + connect?: Array<WorkflowReminderWhereUniqueInput>; +} + +export { WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput as WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts new file mode 100644 index 0000000..0412763 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowReminderUpdateManyWithoutWorkflowStepsInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { WorkflowReminderWhereUniqueInput } from "../../workflowReminder/base/WorkflowReminderWhereUniqueInput"; +import { ApiProperty } from "@nestjs/swagger"; + +@InputType() +class WorkflowReminderUpdateManyWithoutWorkflowStepsInput { + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + connect?: Array<WorkflowReminderWhereUniqueInput>; + + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + disconnect?: Array<WorkflowReminderWhereUniqueInput>; + + @Field(() => [WorkflowReminderWhereUniqueInput], { + nullable: true, + }) + @ApiProperty({ + required: false, + type: () => [WorkflowReminderWhereUniqueInput], + }) + set?: Array<WorkflowReminderWhereUniqueInput>; +} + +export { WorkflowReminderUpdateManyWithoutWorkflowStepsInput as WorkflowReminderUpdateManyWithoutWorkflowStepsInput }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStep.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStep.ts new file mode 100644 index 0000000..9d0bcdd --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStep.ts @@ -0,0 +1,116 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsEnum, + ValidateNested, + IsString, + IsOptional, +} from "class-validator"; +import { EnumWorkflowStepAction } from "./EnumWorkflowStepAction"; +import { Workflow } from "../../workflow/base/Workflow"; +import { Type } from "class-transformer"; +import { EnumWorkflowStepTemplate } from "./EnumWorkflowStepTemplate"; +import { WorkflowReminder } from "../../workflowReminder/base/WorkflowReminder"; + +@ObjectType() +class WorkflowStep { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + stepNumber!: number; + + @ApiProperty({ + required: true, + enum: EnumWorkflowStepAction, + }) + @IsEnum(EnumWorkflowStepAction) + @Field(() => EnumWorkflowStepAction, { + nullable: true, + }) + action?: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + + @ApiProperty({ + required: true, + type: () => Workflow, + }) + @ValidateNested() + @Type(() => Workflow) + workflow?: Workflow; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + sendTo!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + reminderBody!: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + emailSubject!: string | null; + + @ApiProperty({ + required: true, + enum: EnumWorkflowStepTemplate, + }) + @IsEnum(EnumWorkflowStepTemplate) + @Field(() => EnumWorkflowStepTemplate, { + nullable: true, + }) + template?: "REMINDER" | "CUSTOM"; + + @ApiProperty({ + required: false, + type: () => [WorkflowReminder], + }) + @ValidateNested() + @Type(() => WorkflowReminder) + @IsOptional() + workflowReminders?: Array<WorkflowReminder>; +} + +export { WorkflowStep as WorkflowStep }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCountArgs.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCountArgs.ts new file mode 100644 index 0000000..ac7fd89 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowStepWhereInput } from "./WorkflowStepWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowStepCountArgs { + @ApiProperty({ + required: false, + type: () => WorkflowStepWhereInput, + }) + @Field(() => WorkflowStepWhereInput, { nullable: true }) + @Type(() => WorkflowStepWhereInput) + where?: WorkflowStepWhereInput; +} + +export { WorkflowStepCountArgs as WorkflowStepCountArgs }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCreateInput.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCreateInput.ts new file mode 100644 index 0000000..8785d6c --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepCreateInput.ts @@ -0,0 +1,108 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsEnum, + ValidateNested, + IsString, + IsOptional, +} from "class-validator"; +import { EnumWorkflowStepAction } from "./EnumWorkflowStepAction"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EnumWorkflowStepTemplate } from "./EnumWorkflowStepTemplate"; +import { WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput } from "./WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput"; + +@InputType() +class WorkflowStepCreateInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + stepNumber!: number; + + @ApiProperty({ + required: true, + enum: EnumWorkflowStepAction, + }) + @IsEnum(EnumWorkflowStepAction) + @Field(() => EnumWorkflowStepAction) + action!: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + + @ApiProperty({ + required: true, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @Field(() => WorkflowWhereUniqueInput) + workflow!: WorkflowWhereUniqueInput; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + sendTo?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + reminderBody?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + emailSubject?: string | null; + + @ApiProperty({ + required: true, + enum: EnumWorkflowStepTemplate, + }) + @IsEnum(EnumWorkflowStepTemplate) + @Field(() => EnumWorkflowStepTemplate) + template!: "REMINDER" | "CUSTOM"; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput) + @IsOptional() + @Field(() => WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput, { + nullable: true, + }) + workflowReminders?: WorkflowReminderCreateNestedManyWithoutWorkflowStepsInput; +} + +export { WorkflowStepCreateInput as WorkflowStepCreateInput }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindManyArgs.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindManyArgs.ts new file mode 100644 index 0000000..ab7fa74 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowStepWhereInput } from "./WorkflowStepWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowStepOrderByInput } from "./WorkflowStepOrderByInput"; + +@ArgsType() +class WorkflowStepFindManyArgs { + @ApiProperty({ + required: false, + type: () => WorkflowStepWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => WorkflowStepWhereInput, { nullable: true }) + @Type(() => WorkflowStepWhereInput) + where?: WorkflowStepWhereInput; + + @ApiProperty({ + required: false, + type: [WorkflowStepOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [WorkflowStepOrderByInput], { nullable: true }) + @Type(() => WorkflowStepOrderByInput) + orderBy?: Array<WorkflowStepOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { WorkflowStepFindManyArgs as WorkflowStepFindManyArgs }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindUniqueArgs.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindUniqueArgs.ts new file mode 100644 index 0000000..3703c52 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowStepWhereUniqueInput } from "./WorkflowStepWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowStepFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => WorkflowStepWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereUniqueInput) + @Field(() => WorkflowStepWhereUniqueInput, { nullable: false }) + where!: WorkflowStepWhereUniqueInput; +} + +export { WorkflowStepFindUniqueArgs as WorkflowStepFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepListRelationFilter.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepListRelationFilter.ts new file mode 100644 index 0000000..a5b8b73 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowStepWhereInput } from "./WorkflowStepWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class WorkflowStepListRelationFilter { + @ApiProperty({ + required: false, + type: () => WorkflowStepWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereInput) + @IsOptional() + @Field(() => WorkflowStepWhereInput, { + nullable: true, + }) + every?: WorkflowStepWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowStepWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereInput) + @IsOptional() + @Field(() => WorkflowStepWhereInput, { + nullable: true, + }) + some?: WorkflowStepWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowStepWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowStepWhereInput) + @IsOptional() + @Field(() => WorkflowStepWhereInput, { + nullable: true, + }) + none?: WorkflowStepWhereInput; +} +export { WorkflowStepListRelationFilter as WorkflowStepListRelationFilter }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepOrderByInput.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepOrderByInput.ts new file mode 100644 index 0000000..b666efb --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepOrderByInput.ts @@ -0,0 +1,111 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class WorkflowStepOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + stepNumber?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + action?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + workflowId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + sendTo?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + reminderBody?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + emailSubject?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + template?: SortOrder; +} + +export { WorkflowStepOrderByInput as WorkflowStepOrderByInput }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepUpdateInput.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepUpdateInput.ts new file mode 100644 index 0000000..a28e539 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepUpdateInput.ts @@ -0,0 +1,120 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { + IsInt, + IsOptional, + IsEnum, + ValidateNested, + IsString, +} from "class-validator"; +import { EnumWorkflowStepAction } from "./EnumWorkflowStepAction"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { Type } from "class-transformer"; +import { EnumWorkflowStepTemplate } from "./EnumWorkflowStepTemplate"; +import { WorkflowReminderUpdateManyWithoutWorkflowStepsInput } from "./WorkflowReminderUpdateManyWithoutWorkflowStepsInput"; + +@InputType() +class WorkflowStepUpdateInput { + @ApiProperty({ + required: false, + type: Number, + }) + @IsInt() + @IsOptional() + @Field(() => Number, { + nullable: true, + }) + stepNumber?: number; + + @ApiProperty({ + required: false, + enum: EnumWorkflowStepAction, + }) + @IsEnum(EnumWorkflowStepAction) + @IsOptional() + @Field(() => EnumWorkflowStepAction, { + nullable: true, + }) + action?: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + + @ApiProperty({ + required: false, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @IsOptional() + @Field(() => WorkflowWhereUniqueInput, { + nullable: true, + }) + workflow?: WorkflowWhereUniqueInput; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + sendTo?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + reminderBody?: string | null; + + @ApiProperty({ + required: false, + type: String, + }) + @IsString() + @IsOptional() + @Field(() => String, { + nullable: true, + }) + emailSubject?: string | null; + + @ApiProperty({ + required: false, + enum: EnumWorkflowStepTemplate, + }) + @IsEnum(EnumWorkflowStepTemplate) + @IsOptional() + @Field(() => EnumWorkflowStepTemplate, { + nullable: true, + }) + template?: "REMINDER" | "CUSTOM"; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderUpdateManyWithoutWorkflowStepsInput, + }) + @ValidateNested() + @Type(() => WorkflowReminderUpdateManyWithoutWorkflowStepsInput) + @IsOptional() + @Field(() => WorkflowReminderUpdateManyWithoutWorkflowStepsInput, { + nullable: true, + }) + workflowReminders?: WorkflowReminderUpdateManyWithoutWorkflowStepsInput; +} + +export { WorkflowStepUpdateInput as WorkflowStepUpdateInput }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereInput.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereInput.ts new file mode 100644 index 0000000..34d3483 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereInput.ts @@ -0,0 +1,127 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, IsEnum, ValidateNested } from "class-validator"; +import { EnumWorkflowStepAction } from "./EnumWorkflowStepAction"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { StringNullableFilter } from "../../util/StringNullableFilter"; +import { EnumWorkflowStepTemplate } from "./EnumWorkflowStepTemplate"; +import { WorkflowReminderListRelationFilter } from "../../workflowReminder/base/WorkflowReminderListRelationFilter"; + +@InputType() +class WorkflowStepWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + stepNumber?: IntFilter; + + @ApiProperty({ + required: false, + enum: EnumWorkflowStepAction, + }) + @IsEnum(EnumWorkflowStepAction) + @IsOptional() + @Field(() => EnumWorkflowStepAction, { + nullable: true, + }) + action?: "EMAIL_HOST" | "EMAIL_ATTENDEE" | "SMS_ATTENDEE" | "SMS_NUMBER"; + + @ApiProperty({ + required: false, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @IsOptional() + @Field(() => WorkflowWhereUniqueInput, { + nullable: true, + }) + workflow?: WorkflowWhereUniqueInput; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + sendTo?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + reminderBody?: StringNullableFilter; + + @ApiProperty({ + required: false, + type: StringNullableFilter, + }) + @Type(() => StringNullableFilter) + @IsOptional() + @Field(() => StringNullableFilter, { + nullable: true, + }) + emailSubject?: StringNullableFilter; + + @ApiProperty({ + required: false, + enum: EnumWorkflowStepTemplate, + }) + @IsEnum(EnumWorkflowStepTemplate) + @IsOptional() + @Field(() => EnumWorkflowStepTemplate, { + nullable: true, + }) + template?: "REMINDER" | "CUSTOM"; + + @ApiProperty({ + required: false, + type: () => WorkflowReminderListRelationFilter, + }) + @ValidateNested() + @Type(() => WorkflowReminderListRelationFilter) + @IsOptional() + @Field(() => WorkflowReminderListRelationFilter, { + nullable: true, + }) + workflowReminders?: WorkflowReminderListRelationFilter; +} + +export { WorkflowStepWhereInput as WorkflowStepWhereInput }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereUniqueInput.ts b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereUniqueInput.ts new file mode 100644 index 0000000..1b0b47e --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/WorkflowStepWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class WorkflowStepWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { WorkflowStepWhereUniqueInput as WorkflowStepWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.spec.ts b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.spec.ts new file mode 100644 index 0000000..c49a1b4 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.spec.ts @@ -0,0 +1,180 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { WorkflowStepController } from "../workflowStep.controller"; +import { WorkflowStepService } from "../workflowStep.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, + stepNumber: 42, + sendTo: "exampleSendTo", + reminderBody: "exampleReminderBody", + emailSubject: "exampleEmailSubject", +}; +const CREATE_RESULT = { + id: 42, + stepNumber: 42, + sendTo: "exampleSendTo", + reminderBody: "exampleReminderBody", + emailSubject: "exampleEmailSubject", +}; +const FIND_MANY_RESULT = [ + { + id: 42, + stepNumber: 42, + sendTo: "exampleSendTo", + reminderBody: "exampleReminderBody", + emailSubject: "exampleEmailSubject", + }, +]; +const FIND_ONE_RESULT = { + id: 42, + stepNumber: 42, + sendTo: "exampleSendTo", + reminderBody: "exampleReminderBody", + emailSubject: "exampleEmailSubject", +}; + +const service = { + createWorkflowStep() { + return CREATE_RESULT; + }, + workflowSteps: () => FIND_MANY_RESULT, + workflowStep: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("WorkflowStep", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: WorkflowStepService, + useValue: service, + }, + ], + controllers: [WorkflowStepController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /workflowSteps", async () => { + await request(app.getHttpServer()) + .post("/workflowSteps") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /workflowSteps", async () => { + await request(app.getHttpServer()) + .get("/workflowSteps") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /workflowSteps/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflowSteps"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /workflowSteps/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflowSteps"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /workflowSteps existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/workflowSteps") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/workflowSteps") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.ts b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.ts new file mode 100644 index 0000000..55f1e90 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.controller.base.ts @@ -0,0 +1,290 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { WorkflowStepService } from "../workflowStep.service"; +import { WorkflowStepCreateInput } from "./WorkflowStepCreateInput"; +import { WorkflowStep } from "./WorkflowStep"; +import { WorkflowStepFindManyArgs } from "./WorkflowStepFindManyArgs"; +import { WorkflowStepWhereUniqueInput } from "./WorkflowStepWhereUniqueInput"; +import { WorkflowStepUpdateInput } from "./WorkflowStepUpdateInput"; +import { WorkflowReminderFindManyArgs } from "../../workflowReminder/base/WorkflowReminderFindManyArgs"; +import { WorkflowReminder } from "../../workflowReminder/base/WorkflowReminder"; +import { WorkflowReminderWhereUniqueInput } from "../../workflowReminder/base/WorkflowReminderWhereUniqueInput"; + +export class WorkflowStepControllerBase { + constructor(protected readonly service: WorkflowStepService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: WorkflowStep }) + async createWorkflowStep( + @common.Body() data: WorkflowStepCreateInput + ): Promise<WorkflowStep> { + return await this.service.createWorkflowStep({ + data: { + ...data, + + workflow: { + connect: data.workflow, + }, + }, + select: { + id: true, + stepNumber: true, + action: true, + + workflow: { + select: { + id: true, + }, + }, + + sendTo: true, + reminderBody: true, + emailSubject: true, + template: true, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [WorkflowStep] }) + @ApiNestedQuery(WorkflowStepFindManyArgs) + async workflowSteps(@common.Req() request: Request): Promise<WorkflowStep[]> { + const args = plainToClass(WorkflowStepFindManyArgs, request.query); + return this.service.workflowSteps({ + ...args, + select: { + id: true, + stepNumber: true, + action: true, + + workflow: { + select: { + id: true, + }, + }, + + sendTo: true, + reminderBody: true, + emailSubject: true, + template: true, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: WorkflowStep }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async workflowStep( + @common.Param() params: WorkflowStepWhereUniqueInput + ): Promise<WorkflowStep | null> { + const result = await this.service.workflowStep({ + where: params, + select: { + id: true, + stepNumber: true, + action: true, + + workflow: { + select: { + id: true, + }, + }, + + sendTo: true, + reminderBody: true, + emailSubject: true, + template: true, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: WorkflowStep }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateWorkflowStep( + @common.Param() params: WorkflowStepWhereUniqueInput, + @common.Body() data: WorkflowStepUpdateInput + ): Promise<WorkflowStep | null> { + try { + return await this.service.updateWorkflowStep({ + where: params, + data: { + ...data, + + workflow: { + connect: data.workflow, + }, + }, + select: { + id: true, + stepNumber: true, + action: true, + + workflow: { + select: { + id: true, + }, + }, + + sendTo: true, + reminderBody: true, + emailSubject: true, + template: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: WorkflowStep }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteWorkflowStep( + @common.Param() params: WorkflowStepWhereUniqueInput + ): Promise<WorkflowStep | null> { + try { + return await this.service.deleteWorkflowStep({ + where: params, + select: { + id: true, + stepNumber: true, + action: true, + + workflow: { + select: { + id: true, + }, + }, + + sendTo: true, + reminderBody: true, + emailSubject: true, + template: true, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Get("/:id/workflowReminders") + @ApiNestedQuery(WorkflowReminderFindManyArgs) + async findWorkflowReminders( + @common.Req() request: Request, + @common.Param() params: WorkflowStepWhereUniqueInput + ): Promise<WorkflowReminder[]> { + const query = plainToClass(WorkflowReminderFindManyArgs, request.query); + const results = await this.service.findWorkflowReminders(params.id, { + ...query, + select: { + id: true, + + booking: { + select: { + id: true, + }, + }, + + method: true, + scheduledDate: true, + referenceId: true, + scheduled: true, + + workflowStep: { + select: { + id: true, + }, + }, + }, + }); + if (results === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return results; + } + + @common.Post("/:id/workflowReminders") + async connectWorkflowReminders( + @common.Param() params: WorkflowStepWhereUniqueInput, + @common.Body() body: WorkflowReminderWhereUniqueInput[] + ): Promise<void> { + const data = { + workflowReminders: { + connect: body, + }, + }; + await this.service.updateWorkflowStep({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Patch("/:id/workflowReminders") + async updateWorkflowReminders( + @common.Param() params: WorkflowStepWhereUniqueInput, + @common.Body() body: WorkflowReminderWhereUniqueInput[] + ): Promise<void> { + const data = { + workflowReminders: { + set: body, + }, + }; + await this.service.updateWorkflowStep({ + where: params, + data, + select: { id: true }, + }); + } + + @common.Delete("/:id/workflowReminders") + async disconnectWorkflowReminders( + @common.Param() params: WorkflowStepWhereUniqueInput, + @common.Body() body: WorkflowReminderWhereUniqueInput[] + ): Promise<void> { + const data = { + workflowReminders: { + disconnect: body, + }, + }; + await this.service.updateWorkflowStep({ + where: params, + data, + select: { id: true }, + }); + } +} diff --git a/apps/roi-cacl-2/src/workflowStep/base/workflowStep.module.base.ts b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.module.base.ts new file mode 100644 index 0000000..435ee2d --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class WorkflowStepModuleBase {} diff --git a/apps/roi-cacl-2/src/workflowStep/base/workflowStep.resolver.base.ts b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.resolver.base.ts new file mode 100644 index 0000000..d1df62b --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.resolver.base.ts @@ -0,0 +1,143 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { WorkflowStep } from "./WorkflowStep"; +import { WorkflowStepCountArgs } from "./WorkflowStepCountArgs"; +import { WorkflowStepFindManyArgs } from "./WorkflowStepFindManyArgs"; +import { WorkflowStepFindUniqueArgs } from "./WorkflowStepFindUniqueArgs"; +import { CreateWorkflowStepArgs } from "./CreateWorkflowStepArgs"; +import { UpdateWorkflowStepArgs } from "./UpdateWorkflowStepArgs"; +import { DeleteWorkflowStepArgs } from "./DeleteWorkflowStepArgs"; +import { WorkflowReminderFindManyArgs } from "../../workflowReminder/base/WorkflowReminderFindManyArgs"; +import { WorkflowReminder } from "../../workflowReminder/base/WorkflowReminder"; +import { Workflow } from "../../workflow/base/Workflow"; +import { WorkflowStepService } from "../workflowStep.service"; +@graphql.Resolver(() => WorkflowStep) +export class WorkflowStepResolverBase { + constructor(protected readonly service: WorkflowStepService) {} + + async _workflowStepsMeta( + @graphql.Args() args: WorkflowStepCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [WorkflowStep]) + async workflowSteps( + @graphql.Args() args: WorkflowStepFindManyArgs + ): Promise<WorkflowStep[]> { + return this.service.workflowSteps(args); + } + + @graphql.Query(() => WorkflowStep, { nullable: true }) + async workflowStep( + @graphql.Args() args: WorkflowStepFindUniqueArgs + ): Promise<WorkflowStep | null> { + const result = await this.service.workflowStep(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => WorkflowStep) + async createWorkflowStep( + @graphql.Args() args: CreateWorkflowStepArgs + ): Promise<WorkflowStep> { + return await this.service.createWorkflowStep({ + ...args, + data: { + ...args.data, + + workflow: { + connect: args.data.workflow, + }, + }, + }); + } + + @graphql.Mutation(() => WorkflowStep) + async updateWorkflowStep( + @graphql.Args() args: UpdateWorkflowStepArgs + ): Promise<WorkflowStep | null> { + try { + return await this.service.updateWorkflowStep({ + ...args, + data: { + ...args.data, + + workflow: { + connect: args.data.workflow, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => WorkflowStep) + async deleteWorkflowStep( + @graphql.Args() args: DeleteWorkflowStepArgs + ): Promise<WorkflowStep | null> { + try { + return await this.service.deleteWorkflowStep(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => [WorkflowReminder], { name: "workflowReminders" }) + async findWorkflowReminders( + @graphql.Parent() parent: WorkflowStep, + @graphql.Args() args: WorkflowReminderFindManyArgs + ): Promise<WorkflowReminder[]> { + const results = await this.service.findWorkflowReminders(parent.id, args); + + if (!results) { + return []; + } + + return results; + } + + @graphql.ResolveField(() => Workflow, { + nullable: true, + name: "workflow", + }) + async getWorkflow( + @graphql.Parent() parent: WorkflowStep + ): Promise<Workflow | null> { + const result = await this.service.getWorkflow(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/workflowStep/base/workflowStep.service.base.ts b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.service.base.ts new file mode 100644 index 0000000..68964b4 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/base/workflowStep.service.base.ts @@ -0,0 +1,76 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + WorkflowStep as PrismaWorkflowStep, + WorkflowReminder as PrismaWorkflowReminder, + Workflow as PrismaWorkflow, +} from "@prisma/client"; + +export class WorkflowStepServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.WorkflowStepCountArgs, "select"> + ): Promise<number> { + return this.prisma.workflowStep.count(args); + } + + async workflowSteps<T extends Prisma.WorkflowStepFindManyArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowStepFindManyArgs> + ): Promise<PrismaWorkflowStep[]> { + return this.prisma.workflowStep.findMany<Prisma.WorkflowStepFindManyArgs>( + args + ); + } + async workflowStep<T extends Prisma.WorkflowStepFindUniqueArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowStepFindUniqueArgs> + ): Promise<PrismaWorkflowStep | null> { + return this.prisma.workflowStep.findUnique(args); + } + async createWorkflowStep<T extends Prisma.WorkflowStepCreateArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowStepCreateArgs> + ): Promise<PrismaWorkflowStep> { + return this.prisma.workflowStep.create<T>(args); + } + async updateWorkflowStep<T extends Prisma.WorkflowStepUpdateArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowStepUpdateArgs> + ): Promise<PrismaWorkflowStep> { + return this.prisma.workflowStep.update<T>(args); + } + async deleteWorkflowStep<T extends Prisma.WorkflowStepDeleteArgs>( + args: Prisma.SelectSubset<T, Prisma.WorkflowStepDeleteArgs> + ): Promise<PrismaWorkflowStep> { + return this.prisma.workflowStep.delete(args); + } + + async findWorkflowReminders( + parentId: number, + args: Prisma.WorkflowReminderFindManyArgs + ): Promise<PrismaWorkflowReminder[]> { + return this.prisma.workflowStep + .findUniqueOrThrow({ + where: { id: parentId }, + }) + .workflowReminders(args); + } + + async getWorkflow(parentId: number): Promise<PrismaWorkflow | null> { + return this.prisma.workflowStep + .findUnique({ + where: { id: parentId }, + }) + .workflow(); + } +} diff --git a/apps/roi-cacl-2/src/workflowStep/workflowStep.controller.ts b/apps/roi-cacl-2/src/workflowStep/workflowStep.controller.ts new file mode 100644 index 0000000..06db7eb --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/workflowStep.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { WorkflowStepService } from "./workflowStep.service"; +import { WorkflowStepControllerBase } from "./base/workflowStep.controller.base"; + +@swagger.ApiTags("workflowSteps") +@common.Controller("workflowSteps") +export class WorkflowStepController extends WorkflowStepControllerBase { + constructor(protected readonly service: WorkflowStepService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflowStep/workflowStep.module.ts b/apps/roi-cacl-2/src/workflowStep/workflowStep.module.ts new file mode 100644 index 0000000..f5d30a7 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/workflowStep.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { WorkflowStepModuleBase } from "./base/workflowStep.module.base"; +import { WorkflowStepService } from "./workflowStep.service"; +import { WorkflowStepController } from "./workflowStep.controller"; +import { WorkflowStepResolver } from "./workflowStep.resolver"; + +@Module({ + imports: [WorkflowStepModuleBase], + controllers: [WorkflowStepController], + providers: [WorkflowStepService, WorkflowStepResolver], + exports: [WorkflowStepService], +}) +export class WorkflowStepModule {} diff --git a/apps/roi-cacl-2/src/workflowStep/workflowStep.resolver.ts b/apps/roi-cacl-2/src/workflowStep/workflowStep.resolver.ts new file mode 100644 index 0000000..10600b1 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/workflowStep.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { WorkflowStepResolverBase } from "./base/workflowStep.resolver.base"; +import { WorkflowStep } from "./base/WorkflowStep"; +import { WorkflowStepService } from "./workflowStep.service"; + +@graphql.Resolver(() => WorkflowStep) +export class WorkflowStepResolver extends WorkflowStepResolverBase { + constructor(protected readonly service: WorkflowStepService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflowStep/workflowStep.service.ts b/apps/roi-cacl-2/src/workflowStep/workflowStep.service.ts new file mode 100644 index 0000000..3b1df7d --- /dev/null +++ b/apps/roi-cacl-2/src/workflowStep/workflowStep.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { WorkflowStepServiceBase } from "./base/workflowStep.service.base"; + +@Injectable() +export class WorkflowStepService extends WorkflowStepServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/CreateWorkflowsOnEventTypeArgs.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/CreateWorkflowsOnEventTypeArgs.ts new file mode 100644 index 0000000..89dfc5f --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/CreateWorkflowsOnEventTypeArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowsOnEventTypeCreateInput } from "./WorkflowsOnEventTypeCreateInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class CreateWorkflowsOnEventTypeArgs { + @ApiProperty({ + required: true, + type: () => WorkflowsOnEventTypeCreateInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeCreateInput) + @Field(() => WorkflowsOnEventTypeCreateInput, { nullable: false }) + data!: WorkflowsOnEventTypeCreateInput; +} + +export { CreateWorkflowsOnEventTypeArgs as CreateWorkflowsOnEventTypeArgs }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/DeleteWorkflowsOnEventTypeArgs.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/DeleteWorkflowsOnEventTypeArgs.ts new file mode 100644 index 0000000..d34881a --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/DeleteWorkflowsOnEventTypeArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "./WorkflowsOnEventTypeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class DeleteWorkflowsOnEventTypeArgs { + @ApiProperty({ + required: true, + type: () => WorkflowsOnEventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeWhereUniqueInput) + @Field(() => WorkflowsOnEventTypeWhereUniqueInput, { nullable: false }) + where!: WorkflowsOnEventTypeWhereUniqueInput; +} + +export { DeleteWorkflowsOnEventTypeArgs as DeleteWorkflowsOnEventTypeArgs }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/UpdateWorkflowsOnEventTypeArgs.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/UpdateWorkflowsOnEventTypeArgs.ts new file mode 100644 index 0000000..e21baf0 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/UpdateWorkflowsOnEventTypeArgs.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "./WorkflowsOnEventTypeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowsOnEventTypeUpdateInput } from "./WorkflowsOnEventTypeUpdateInput"; + +@ArgsType() +class UpdateWorkflowsOnEventTypeArgs { + @ApiProperty({ + required: true, + type: () => WorkflowsOnEventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeWhereUniqueInput) + @Field(() => WorkflowsOnEventTypeWhereUniqueInput, { nullable: false }) + where!: WorkflowsOnEventTypeWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => WorkflowsOnEventTypeUpdateInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeUpdateInput) + @Field(() => WorkflowsOnEventTypeUpdateInput, { nullable: false }) + data!: WorkflowsOnEventTypeUpdateInput; +} + +export { UpdateWorkflowsOnEventTypeArgs as UpdateWorkflowsOnEventTypeArgs }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventType.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventType.ts new file mode 100644 index 0000000..6eb1cd8 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventType.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ObjectType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt, ValidateNested } from "class-validator"; +import { Workflow } from "../../workflow/base/Workflow"; +import { Type } from "class-transformer"; +import { EventType } from "../../eventType/base/EventType"; + +@ObjectType() +class WorkflowsOnEventType { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Field(() => Number) + id!: number; + + @ApiProperty({ + required: true, + type: () => Workflow, + }) + @ValidateNested() + @Type(() => Workflow) + workflow?: Workflow; + + @ApiProperty({ + required: true, + type: () => EventType, + }) + @ValidateNested() + @Type(() => EventType) + eventType?: EventType; +} + +export { WorkflowsOnEventType as WorkflowsOnEventType }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCountArgs.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCountArgs.ts new file mode 100644 index 0000000..63caa0f --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCountArgs.ts @@ -0,0 +1,28 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowsOnEventTypeWhereInput } from "./WorkflowsOnEventTypeWhereInput"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowsOnEventTypeCountArgs { + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeWhereInput, + }) + @Field(() => WorkflowsOnEventTypeWhereInput, { nullable: true }) + @Type(() => WorkflowsOnEventTypeWhereInput) + where?: WorkflowsOnEventTypeWhereInput; +} + +export { WorkflowsOnEventTypeCountArgs as WorkflowsOnEventTypeCountArgs }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCreateInput.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCreateInput.ts new file mode 100644 index 0000000..086b0d9 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeCreateInput.ts @@ -0,0 +1,40 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; + +@InputType() +class WorkflowsOnEventTypeCreateInput { + @ApiProperty({ + required: true, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @Field(() => WorkflowWhereUniqueInput) + workflow!: WorkflowWhereUniqueInput; + + @ApiProperty({ + required: true, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @Field(() => EventTypeWhereUniqueInput) + eventType!: EventTypeWhereUniqueInput; +} + +export { WorkflowsOnEventTypeCreateInput as WorkflowsOnEventTypeCreateInput }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs.ts new file mode 100644 index 0000000..0b1130b --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindManyArgs.ts @@ -0,0 +1,62 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowsOnEventTypeWhereInput } from "./WorkflowsOnEventTypeWhereInput"; +import { IsOptional, ValidateNested, IsInt } from "class-validator"; +import { Type } from "class-transformer"; +import { WorkflowsOnEventTypeOrderByInput } from "./WorkflowsOnEventTypeOrderByInput"; + +@ArgsType() +class WorkflowsOnEventTypeFindManyArgs { + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeWhereInput, + }) + @IsOptional() + @ValidateNested() + @Field(() => WorkflowsOnEventTypeWhereInput, { nullable: true }) + @Type(() => WorkflowsOnEventTypeWhereInput) + where?: WorkflowsOnEventTypeWhereInput; + + @ApiProperty({ + required: false, + type: [WorkflowsOnEventTypeOrderByInput], + }) + @IsOptional() + @ValidateNested({ each: true }) + @Field(() => [WorkflowsOnEventTypeOrderByInput], { nullable: true }) + @Type(() => WorkflowsOnEventTypeOrderByInput) + orderBy?: Array<WorkflowsOnEventTypeOrderByInput>; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + skip?: number; + + @ApiProperty({ + required: false, + type: Number, + }) + @IsOptional() + @IsInt() + @Field(() => Number, { nullable: true }) + @Type(() => Number) + take?: number; +} + +export { WorkflowsOnEventTypeFindManyArgs as WorkflowsOnEventTypeFindManyArgs }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindUniqueArgs.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindUniqueArgs.ts new file mode 100644 index 0000000..ce87b0c --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeFindUniqueArgs.ts @@ -0,0 +1,30 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "./WorkflowsOnEventTypeWhereUniqueInput"; +import { ValidateNested } from "class-validator"; +import { Type } from "class-transformer"; + +@ArgsType() +class WorkflowsOnEventTypeFindUniqueArgs { + @ApiProperty({ + required: true, + type: () => WorkflowsOnEventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeWhereUniqueInput) + @Field(() => WorkflowsOnEventTypeWhereUniqueInput, { nullable: false }) + where!: WorkflowsOnEventTypeWhereUniqueInput; +} + +export { WorkflowsOnEventTypeFindUniqueArgs as WorkflowsOnEventTypeFindUniqueArgs }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeListRelationFilter.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeListRelationFilter.ts new file mode 100644 index 0000000..706969e --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeListRelationFilter.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowsOnEventTypeWhereInput } from "./WorkflowsOnEventTypeWhereInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; + +@InputType() +class WorkflowsOnEventTypeListRelationFilter { + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeWhereInput) + @IsOptional() + @Field(() => WorkflowsOnEventTypeWhereInput, { + nullable: true, + }) + every?: WorkflowsOnEventTypeWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeWhereInput) + @IsOptional() + @Field(() => WorkflowsOnEventTypeWhereInput, { + nullable: true, + }) + some?: WorkflowsOnEventTypeWhereInput; + + @ApiProperty({ + required: false, + type: () => WorkflowsOnEventTypeWhereInput, + }) + @ValidateNested() + @Type(() => WorkflowsOnEventTypeWhereInput) + @IsOptional() + @Field(() => WorkflowsOnEventTypeWhereInput, { + nullable: true, + }) + none?: WorkflowsOnEventTypeWhereInput; +} +export { WorkflowsOnEventTypeListRelationFilter as WorkflowsOnEventTypeListRelationFilter }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeOrderByInput.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeOrderByInput.ts new file mode 100644 index 0000000..fe1230b --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeOrderByInput.ts @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsOptional, IsEnum } from "class-validator"; +import { SortOrder } from "../../util/SortOrder"; + +@InputType({ + isAbstract: true, + description: undefined, +}) +class WorkflowsOnEventTypeOrderByInput { + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + id?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + workflowId?: SortOrder; + + @ApiProperty({ + required: false, + enum: ["asc", "desc"], + }) + @IsOptional() + @IsEnum(SortOrder) + @Field(() => SortOrder, { + nullable: true, + }) + eventTypeId?: SortOrder; +} + +export { WorkflowsOnEventTypeOrderByInput as WorkflowsOnEventTypeOrderByInput }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeUpdateInput.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeUpdateInput.ts new file mode 100644 index 0000000..1eda04a --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeUpdateInput.ts @@ -0,0 +1,46 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { ValidateNested, IsOptional } from "class-validator"; +import { Type } from "class-transformer"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; + +@InputType() +class WorkflowsOnEventTypeUpdateInput { + @ApiProperty({ + required: false, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @IsOptional() + @Field(() => WorkflowWhereUniqueInput, { + nullable: true, + }) + workflow?: WorkflowWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; +} + +export { WorkflowsOnEventTypeUpdateInput as WorkflowsOnEventTypeUpdateInput }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereInput.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereInput.ts new file mode 100644 index 0000000..2ef2359 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereInput.ts @@ -0,0 +1,58 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IntFilter } from "../../util/IntFilter"; +import { Type } from "class-transformer"; +import { IsOptional, ValidateNested } from "class-validator"; +import { WorkflowWhereUniqueInput } from "../../workflow/base/WorkflowWhereUniqueInput"; +import { EventTypeWhereUniqueInput } from "../../eventType/base/EventTypeWhereUniqueInput"; + +@InputType() +class WorkflowsOnEventTypeWhereInput { + @ApiProperty({ + required: false, + type: IntFilter, + }) + @Type(() => IntFilter) + @IsOptional() + @Field(() => IntFilter, { + nullable: true, + }) + id?: IntFilter; + + @ApiProperty({ + required: false, + type: () => WorkflowWhereUniqueInput, + }) + @ValidateNested() + @Type(() => WorkflowWhereUniqueInput) + @IsOptional() + @Field(() => WorkflowWhereUniqueInput, { + nullable: true, + }) + workflow?: WorkflowWhereUniqueInput; + + @ApiProperty({ + required: false, + type: () => EventTypeWhereUniqueInput, + }) + @ValidateNested() + @Type(() => EventTypeWhereUniqueInput) + @IsOptional() + @Field(() => EventTypeWhereUniqueInput, { + nullable: true, + }) + eventType?: EventTypeWhereUniqueInput; +} + +export { WorkflowsOnEventTypeWhereInput as WorkflowsOnEventTypeWhereInput }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput.ts new file mode 100644 index 0000000..e208e2f --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/WorkflowsOnEventTypeWhereUniqueInput.ts @@ -0,0 +1,31 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { InputType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { IsInt } from "class-validator"; +import { Transform } from "class-transformer"; + +@InputType() +class WorkflowsOnEventTypeWhereUniqueInput { + @ApiProperty({ + required: true, + type: Number, + }) + @IsInt() + @Transform((prop) => parseInt(prop.value), { + toClassOnly: true, + }) + @Field(() => Number) + id!: number; +} + +export { WorkflowsOnEventTypeWhereUniqueInput as WorkflowsOnEventTypeWhereUniqueInput }; diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.spec.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.spec.ts new file mode 100644 index 0000000..a83f1a0 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.spec.ts @@ -0,0 +1,164 @@ +import { Test } from "@nestjs/testing"; +import { + INestApplication, + HttpStatus, + ExecutionContext, + CallHandler, +} from "@nestjs/common"; +import request from "supertest"; +import { ACGuard } from "nest-access-control"; +import { DefaultAuthGuard } from "../../auth/defaultAuth.guard"; +import { ACLModule } from "../../auth/acl.module"; +import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor"; +import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor"; +import { map } from "rxjs"; +import { WorkflowsOnEventTypeController } from "../workflowsOnEventType.controller"; +import { WorkflowsOnEventTypeService } from "../workflowsOnEventType.service"; + +const nonExistingId = "nonExistingId"; +const existingId = "existingId"; +const CREATE_INPUT = { + id: 42, +}; +const CREATE_RESULT = { + id: 42, +}; +const FIND_MANY_RESULT = [ + { + id: 42, + }, +]; +const FIND_ONE_RESULT = { + id: 42, +}; + +const service = { + createWorkflowsOnEventType() { + return CREATE_RESULT; + }, + workflowsOnEventTypes: () => FIND_MANY_RESULT, + workflowsOnEventType: ({ where }: { where: { id: string } }) => { + switch (where.id) { + case existingId: + return FIND_ONE_RESULT; + case nonExistingId: + return null; + } + }, +}; + +const basicAuthGuard = { + canActivate: (context: ExecutionContext) => { + const argumentHost = context.switchToHttp(); + const request = argumentHost.getRequest(); + request.user = { + roles: ["user"], + }; + return true; + }, +}; + +const acGuard = { + canActivate: () => { + return true; + }, +}; + +const aclFilterResponseInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle().pipe( + map((data) => { + return data; + }) + ); + }, +}; +const aclValidateRequestInterceptor = { + intercept: (context: ExecutionContext, next: CallHandler) => { + return next.handle(); + }, +}; + +describe("WorkflowsOnEventType", () => { + let app: INestApplication; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + providers: [ + { + provide: WorkflowsOnEventTypeService, + useValue: service, + }, + ], + controllers: [WorkflowsOnEventTypeController], + imports: [ACLModule], + }) + .overrideGuard(DefaultAuthGuard) + .useValue(basicAuthGuard) + .overrideGuard(ACGuard) + .useValue(acGuard) + .overrideInterceptor(AclFilterResponseInterceptor) + .useValue(aclFilterResponseInterceptor) + .overrideInterceptor(AclValidateRequestInterceptor) + .useValue(aclValidateRequestInterceptor) + .compile(); + + app = moduleRef.createNestApplication(); + await app.init(); + }); + + test("POST /workflowsOnEventTypes", async () => { + await request(app.getHttpServer()) + .post("/workflowsOnEventTypes") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT); + }); + + test("GET /workflowsOnEventTypes", async () => { + await request(app.getHttpServer()) + .get("/workflowsOnEventTypes") + .expect(HttpStatus.OK) + .expect([FIND_MANY_RESULT[0]]); + }); + + test("GET /workflowsOnEventTypes/:id non existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflowsOnEventTypes"}/${nonExistingId}`) + .expect(HttpStatus.NOT_FOUND) + .expect({ + statusCode: HttpStatus.NOT_FOUND, + message: `No resource was found for {"${"id"}":"${nonExistingId}"}`, + error: "Not Found", + }); + }); + + test("GET /workflowsOnEventTypes/:id existing", async () => { + await request(app.getHttpServer()) + .get(`${"/workflowsOnEventTypes"}/${existingId}`) + .expect(HttpStatus.OK) + .expect(FIND_ONE_RESULT); + }); + + test("POST /workflowsOnEventTypes existing resource", async () => { + const agent = request(app.getHttpServer()); + await agent + .post("/workflowsOnEventTypes") + .send(CREATE_INPUT) + .expect(HttpStatus.CREATED) + .expect(CREATE_RESULT) + .then(function () { + agent + .post("/workflowsOnEventTypes") + .send(CREATE_INPUT) + .expect(HttpStatus.CONFLICT) + .expect({ + statusCode: HttpStatus.CONFLICT, + }); + }); + }); + + afterAll(async () => { + await app.close(); + }); +}); diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.ts new file mode 100644 index 0000000..12bd8dc --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.controller.base.ts @@ -0,0 +1,203 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { isRecordNotFoundError } from "../../prisma.util"; +import * as errors from "../../errors"; +import { Request } from "express"; +import { plainToClass } from "class-transformer"; +import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator"; +import { WorkflowsOnEventTypeService } from "../workflowsOnEventType.service"; +import { WorkflowsOnEventTypeCreateInput } from "./WorkflowsOnEventTypeCreateInput"; +import { WorkflowsOnEventType } from "./WorkflowsOnEventType"; +import { WorkflowsOnEventTypeFindManyArgs } from "./WorkflowsOnEventTypeFindManyArgs"; +import { WorkflowsOnEventTypeWhereUniqueInput } from "./WorkflowsOnEventTypeWhereUniqueInput"; +import { WorkflowsOnEventTypeUpdateInput } from "./WorkflowsOnEventTypeUpdateInput"; + +export class WorkflowsOnEventTypeControllerBase { + constructor(protected readonly service: WorkflowsOnEventTypeService) {} + @common.Post() + @swagger.ApiCreatedResponse({ type: WorkflowsOnEventType }) + async createWorkflowsOnEventType( + @common.Body() data: WorkflowsOnEventTypeCreateInput + ): Promise<WorkflowsOnEventType> { + return await this.service.createWorkflowsOnEventType({ + data: { + ...data, + + workflow: { + connect: data.workflow, + }, + + eventType: { + connect: data.eventType, + }, + }, + select: { + id: true, + + workflow: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get() + @swagger.ApiOkResponse({ type: [WorkflowsOnEventType] }) + @ApiNestedQuery(WorkflowsOnEventTypeFindManyArgs) + async workflowsOnEventTypes( + @common.Req() request: Request + ): Promise<WorkflowsOnEventType[]> { + const args = plainToClass(WorkflowsOnEventTypeFindManyArgs, request.query); + return this.service.workflowsOnEventTypes({ + ...args, + select: { + id: true, + + workflow: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } + + @common.Get("/:id") + @swagger.ApiOkResponse({ type: WorkflowsOnEventType }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async workflowsOnEventType( + @common.Param() params: WorkflowsOnEventTypeWhereUniqueInput + ): Promise<WorkflowsOnEventType | null> { + const result = await this.service.workflowsOnEventType({ + where: params, + select: { + id: true, + + workflow: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + if (result === null) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + return result; + } + + @common.Patch("/:id") + @swagger.ApiOkResponse({ type: WorkflowsOnEventType }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async updateWorkflowsOnEventType( + @common.Param() params: WorkflowsOnEventTypeWhereUniqueInput, + @common.Body() data: WorkflowsOnEventTypeUpdateInput + ): Promise<WorkflowsOnEventType | null> { + try { + return await this.service.updateWorkflowsOnEventType({ + where: params, + data: { + ...data, + + workflow: { + connect: data.workflow, + }, + + eventType: { + connect: data.eventType, + }, + }, + select: { + id: true, + + workflow: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } + + @common.Delete("/:id") + @swagger.ApiOkResponse({ type: WorkflowsOnEventType }) + @swagger.ApiNotFoundResponse({ type: errors.NotFoundException }) + async deleteWorkflowsOnEventType( + @common.Param() params: WorkflowsOnEventTypeWhereUniqueInput + ): Promise<WorkflowsOnEventType | null> { + try { + return await this.service.deleteWorkflowsOnEventType({ + where: params, + select: { + id: true, + + workflow: { + select: { + id: true, + }, + }, + + eventType: { + select: { + id: true, + }, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new errors.NotFoundException( + `No resource was found for ${JSON.stringify(params)}` + ); + } + throw error; + } + } +} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.module.base.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.module.base.ts new file mode 100644 index 0000000..8c22b63 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.module.base.ts @@ -0,0 +1,18 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [], + exports: [], +}) +export class WorkflowsOnEventTypeModuleBase {} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.resolver.base.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.resolver.base.ts new file mode 100644 index 0000000..14ac41b --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.resolver.base.ts @@ -0,0 +1,151 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import * as graphql from "@nestjs/graphql"; +import { GraphQLError } from "graphql"; +import { isRecordNotFoundError } from "../../prisma.util"; +import { MetaQueryPayload } from "../../util/MetaQueryPayload"; +import { WorkflowsOnEventType } from "./WorkflowsOnEventType"; +import { WorkflowsOnEventTypeCountArgs } from "./WorkflowsOnEventTypeCountArgs"; +import { WorkflowsOnEventTypeFindManyArgs } from "./WorkflowsOnEventTypeFindManyArgs"; +import { WorkflowsOnEventTypeFindUniqueArgs } from "./WorkflowsOnEventTypeFindUniqueArgs"; +import { CreateWorkflowsOnEventTypeArgs } from "./CreateWorkflowsOnEventTypeArgs"; +import { UpdateWorkflowsOnEventTypeArgs } from "./UpdateWorkflowsOnEventTypeArgs"; +import { DeleteWorkflowsOnEventTypeArgs } from "./DeleteWorkflowsOnEventTypeArgs"; +import { Workflow } from "../../workflow/base/Workflow"; +import { EventType } from "../../eventType/base/EventType"; +import { WorkflowsOnEventTypeService } from "../workflowsOnEventType.service"; +@graphql.Resolver(() => WorkflowsOnEventType) +export class WorkflowsOnEventTypeResolverBase { + constructor(protected readonly service: WorkflowsOnEventTypeService) {} + + async _workflowsOnEventTypesMeta( + @graphql.Args() args: WorkflowsOnEventTypeCountArgs + ): Promise<MetaQueryPayload> { + const result = await this.service.count(args); + return { + count: result, + }; + } + + @graphql.Query(() => [WorkflowsOnEventType]) + async workflowsOnEventTypes( + @graphql.Args() args: WorkflowsOnEventTypeFindManyArgs + ): Promise<WorkflowsOnEventType[]> { + return this.service.workflowsOnEventTypes(args); + } + + @graphql.Query(() => WorkflowsOnEventType, { nullable: true }) + async workflowsOnEventType( + @graphql.Args() args: WorkflowsOnEventTypeFindUniqueArgs + ): Promise<WorkflowsOnEventType | null> { + const result = await this.service.workflowsOnEventType(args); + if (result === null) { + return null; + } + return result; + } + + @graphql.Mutation(() => WorkflowsOnEventType) + async createWorkflowsOnEventType( + @graphql.Args() args: CreateWorkflowsOnEventTypeArgs + ): Promise<WorkflowsOnEventType> { + return await this.service.createWorkflowsOnEventType({ + ...args, + data: { + ...args.data, + + workflow: { + connect: args.data.workflow, + }, + + eventType: { + connect: args.data.eventType, + }, + }, + }); + } + + @graphql.Mutation(() => WorkflowsOnEventType) + async updateWorkflowsOnEventType( + @graphql.Args() args: UpdateWorkflowsOnEventTypeArgs + ): Promise<WorkflowsOnEventType | null> { + try { + return await this.service.updateWorkflowsOnEventType({ + ...args, + data: { + ...args.data, + + workflow: { + connect: args.data.workflow, + }, + + eventType: { + connect: args.data.eventType, + }, + }, + }); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.Mutation(() => WorkflowsOnEventType) + async deleteWorkflowsOnEventType( + @graphql.Args() args: DeleteWorkflowsOnEventTypeArgs + ): Promise<WorkflowsOnEventType | null> { + try { + return await this.service.deleteWorkflowsOnEventType(args); + } catch (error) { + if (isRecordNotFoundError(error)) { + throw new GraphQLError( + `No resource was found for ${JSON.stringify(args.where)}` + ); + } + throw error; + } + } + + @graphql.ResolveField(() => Workflow, { + nullable: true, + name: "workflow", + }) + async getWorkflow( + @graphql.Parent() parent: WorkflowsOnEventType + ): Promise<Workflow | null> { + const result = await this.service.getWorkflow(parent.id); + + if (!result) { + return null; + } + return result; + } + + @graphql.ResolveField(() => EventType, { + nullable: true, + name: "eventType", + }) + async getEventType( + @graphql.Parent() parent: WorkflowsOnEventType + ): Promise<EventType | null> { + const result = await this.service.getEventType(parent.id); + + if (!result) { + return null; + } + return result; + } +} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.service.base.ts b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.service.base.ts new file mode 100644 index 0000000..25b0d7f --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/base/workflowsOnEventType.service.base.ts @@ -0,0 +1,83 @@ +/* +------------------------------------------------------------------------------ +This code was generated by Amplication. + +Changes to this file will be lost if the code is regenerated. + +There are other ways to to customize your code, see this doc to learn more +https://docs.amplication.com/how-to/custom-code + +------------------------------------------------------------------------------ + */ +import { PrismaService } from "../../prisma/prisma.service"; + +import { + Prisma, + WorkflowsOnEventType as PrismaWorkflowsOnEventType, + Workflow as PrismaWorkflow, + EventType as PrismaEventType, +} from "@prisma/client"; + +export class WorkflowsOnEventTypeServiceBase { + constructor(protected readonly prisma: PrismaService) {} + + async count( + args: Omit<Prisma.WorkflowsOnEventTypeCountArgs, "select"> + ): Promise<number> { + return this.prisma.workflowsOnEventType.count(args); + } + + async workflowsOnEventTypes< + T extends Prisma.WorkflowsOnEventTypeFindManyArgs + >( + args: Prisma.SelectSubset<T, Prisma.WorkflowsOnEventTypeFindManyArgs> + ): Promise<PrismaWorkflowsOnEventType[]> { + return this.prisma.workflowsOnEventType.findMany<Prisma.WorkflowsOnEventTypeFindManyArgs>( + args + ); + } + async workflowsOnEventType< + T extends Prisma.WorkflowsOnEventTypeFindUniqueArgs + >( + args: Prisma.SelectSubset<T, Prisma.WorkflowsOnEventTypeFindUniqueArgs> + ): Promise<PrismaWorkflowsOnEventType | null> { + return this.prisma.workflowsOnEventType.findUnique(args); + } + async createWorkflowsOnEventType< + T extends Prisma.WorkflowsOnEventTypeCreateArgs + >( + args: Prisma.SelectSubset<T, Prisma.WorkflowsOnEventTypeCreateArgs> + ): Promise<PrismaWorkflowsOnEventType> { + return this.prisma.workflowsOnEventType.create<T>(args); + } + async updateWorkflowsOnEventType< + T extends Prisma.WorkflowsOnEventTypeUpdateArgs + >( + args: Prisma.SelectSubset<T, Prisma.WorkflowsOnEventTypeUpdateArgs> + ): Promise<PrismaWorkflowsOnEventType> { + return this.prisma.workflowsOnEventType.update<T>(args); + } + async deleteWorkflowsOnEventType< + T extends Prisma.WorkflowsOnEventTypeDeleteArgs + >( + args: Prisma.SelectSubset<T, Prisma.WorkflowsOnEventTypeDeleteArgs> + ): Promise<PrismaWorkflowsOnEventType> { + return this.prisma.workflowsOnEventType.delete(args); + } + + async getWorkflow(parentId: number): Promise<PrismaWorkflow | null> { + return this.prisma.workflowsOnEventType + .findUnique({ + where: { id: parentId }, + }) + .workflow(); + } + + async getEventType(parentId: number): Promise<PrismaEventType | null> { + return this.prisma.workflowsOnEventType + .findUnique({ + where: { id: parentId }, + }) + .eventType(); + } +} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.controller.ts b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.controller.ts new file mode 100644 index 0000000..b327fcd --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.controller.ts @@ -0,0 +1,12 @@ +import * as common from "@nestjs/common"; +import * as swagger from "@nestjs/swagger"; +import { WorkflowsOnEventTypeService } from "./workflowsOnEventType.service"; +import { WorkflowsOnEventTypeControllerBase } from "./base/workflowsOnEventType.controller.base"; + +@swagger.ApiTags("workflowsOnEventTypes") +@common.Controller("workflowsOnEventTypes") +export class WorkflowsOnEventTypeController extends WorkflowsOnEventTypeControllerBase { + constructor(protected readonly service: WorkflowsOnEventTypeService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.module.ts b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.module.ts new file mode 100644 index 0000000..e1de1ff --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.module.ts @@ -0,0 +1,13 @@ +import { Module } from "@nestjs/common"; +import { WorkflowsOnEventTypeModuleBase } from "./base/workflowsOnEventType.module.base"; +import { WorkflowsOnEventTypeService } from "./workflowsOnEventType.service"; +import { WorkflowsOnEventTypeController } from "./workflowsOnEventType.controller"; +import { WorkflowsOnEventTypeResolver } from "./workflowsOnEventType.resolver"; + +@Module({ + imports: [WorkflowsOnEventTypeModuleBase], + controllers: [WorkflowsOnEventTypeController], + providers: [WorkflowsOnEventTypeService, WorkflowsOnEventTypeResolver], + exports: [WorkflowsOnEventTypeService], +}) +export class WorkflowsOnEventTypeModule {} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.resolver.ts b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.resolver.ts new file mode 100644 index 0000000..7637108 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.resolver.ts @@ -0,0 +1,11 @@ +import * as graphql from "@nestjs/graphql"; +import { WorkflowsOnEventTypeResolverBase } from "./base/workflowsOnEventType.resolver.base"; +import { WorkflowsOnEventType } from "./base/WorkflowsOnEventType"; +import { WorkflowsOnEventTypeService } from "./workflowsOnEventType.service"; + +@graphql.Resolver(() => WorkflowsOnEventType) +export class WorkflowsOnEventTypeResolver extends WorkflowsOnEventTypeResolverBase { + constructor(protected readonly service: WorkflowsOnEventTypeService) { + super(service); + } +} diff --git a/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.service.ts b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.service.ts new file mode 100644 index 0000000..ca9a2c0 --- /dev/null +++ b/apps/roi-cacl-2/src/workflowsOnEventType/workflowsOnEventType.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from "@nestjs/common"; +import { PrismaService } from "../prisma/prisma.service"; +import { WorkflowsOnEventTypeServiceBase } from "./base/workflowsOnEventType.service.base"; + +@Injectable() +export class WorkflowsOnEventTypeService extends WorkflowsOnEventTypeServiceBase { + constructor(protected readonly prisma: PrismaService) { + super(prisma); + } +} diff --git a/apps/roi-cacl-2/tsconfig.build.json b/apps/roi-cacl-2/tsconfig.build.json new file mode 100644 index 0000000..e579401 --- /dev/null +++ b/apps/roi-cacl-2/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["node_modules", "prisma", "test", "dist", "**/*spec.ts", "admin"] +} diff --git a/apps/roi-cacl-2/tsconfig.json b/apps/roi-cacl-2/tsconfig.json new file mode 100644 index 0000000..707e8cd --- /dev/null +++ b/apps/roi-cacl-2/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "module": "commonjs", + "declaration": false, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es2022", + "lib": ["es2023"], + "sourceMap": true, + "outDir": "./dist", + "incremental": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true + }, + "include": ["src"] +} From 329e6b6dd446f9fb5ba2d174e35e0f4eedac2a1d Mon Sep 17 00:00:00 2001 From: "amplication[bot]" <bot@amplication.com> Date: Thu, 11 Apr 2024 13:51:27 +0000 Subject: [PATCH 2/2] Amplication build # cluvapui401571upfj8nepqcf Build URL: [https://app.amplication-sandbox.com/clte3ekxk00064uis9y053fqx/cluva4e280000nm1qlucbvizr/cluva7ffe00011upfyk074oua/builds/cluvapui401571upfj8nepqcf](https://app.amplication-sandbox.com/clte3ekxk00064uis9y053fqx/cluva4e280000nm1qlucbvizr/cluva7ffe00011upfyk074oua/builds/cluvapui401571upfj8nepqcf) --- apps/roi-cacl-2/src/eventType/RoiDto.ts | 34 +++++++++++++++++++ .../base/eventType.controller.base.ts | 23 +++++++++++++ .../eventType/base/eventType.resolver.base.ts | 9 +++++ .../eventType/base/eventType.service.base.ts | 6 ++++ 4 files changed, 72 insertions(+) create mode 100644 apps/roi-cacl-2/src/eventType/RoiDto.ts diff --git a/apps/roi-cacl-2/src/eventType/RoiDto.ts b/apps/roi-cacl-2/src/eventType/RoiDto.ts new file mode 100644 index 0000000..bfa34de --- /dev/null +++ b/apps/roi-cacl-2/src/eventType/RoiDto.ts @@ -0,0 +1,34 @@ +import { ArgsType, Field } from "@nestjs/graphql"; +import { ApiProperty } from "@nestjs/swagger"; +import { Type } from "class-transformer"; +import { BookingFindManyArgs } from "../booking/base/BookingFindManyArgs"; +import { EnumReminderMailReminderType } from "../reminderMail/base/EnumReminderMailReminderType"; + +@ArgsType() +class RoiDto { + @Field(() => String) + @ApiProperty({ + required: true, + type: () => String + }) + @Type(() => String) + property1!: string; + + @Field(() => BookingFindManyArgs) + @ApiProperty({ + required: true, + type: () => BookingFindManyArgs + }) + @Type(() => BookingFindManyArgs) + prop2!: BookingFindManyArgs; + + @Field(() => EnumReminderMailReminderType) + @ApiProperty({ + required: true, + enum: EnumReminderMailReminderType + }) + @Type(() => EnumReminderMailReminderType) + prop3!: EnumReminderMailReminderType; +} + +export { RoiDto as RoiDto }; \ No newline at end of file diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts b/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts index fd81cef..f80d298 100644 --- a/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts +++ b/apps/roi-cacl-2/src/eventType/base/eventType.controller.base.ts @@ -1050,4 +1050,27 @@ export class EventTypeControllerBase { select: { id: true }, }); } + + @common.Get("/:id/roi-dto") + @swagger.ApiOkResponse({ + type: Booking, + }) + @swagger.ApiNotFoundResponse({ + type: errors.NotFoundException, + }) + @swagger.ApiForbiddenResponse({ + type: errors.ForbiddenException, + }) + async RoiAPI( + @common.Query() + query: BookingFindManyArgs, + @common.Body() + body: string + ): Promise<Booking> { + const args = { + prop2: query, + property1: body, + }; + return this.service.RoiAPI(args); + } } diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts b/apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts index cd08302..101f9f2 100644 --- a/apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts +++ b/apps/roi-cacl-2/src/eventType/base/eventType.resolver.base.ts @@ -36,6 +36,7 @@ import { Team } from "../../team/base/Team"; import { Schedule } from "../../schedule/base/Schedule"; import { DestinationCalendar } from "../../destinationCalendar/base/DestinationCalendar"; import { HashedLink } from "../../hashedLink/base/HashedLink"; +import { RoiDto } from "../RoiDto"; import { EventTypeService } from "../eventType.service"; @graphql.Resolver(() => EventType) export class EventTypeResolverBase { @@ -306,4 +307,12 @@ export class EventTypeResolverBase { } return result; } + + @graphql.Query(() => Booking) + async RoiAPI( + @graphql.Args() + args: RoiDto + ): Promise<Booking> { + return this.service.RoiAPI(args); + } } diff --git a/apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts b/apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts index d3c7499..029a654 100644 --- a/apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts +++ b/apps/roi-cacl-2/src/eventType/base/eventType.service.base.ts @@ -26,6 +26,9 @@ import { HashedLink as PrismaHashedLink, } from "@prisma/client"; +import { RoiDto } from "../RoiDto"; +import { Booking } from "../../booking/base/Booking"; + export class EventTypeServiceBase { constructor(protected readonly prisma: PrismaService) {} @@ -160,4 +163,7 @@ export class EventTypeServiceBase { }) .hashedLink(); } + async RoiAPI(args: RoiDto): Promise<Booking> { + throw new Error("Not implemented"); + } }