-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
299 changed files
with
11,566 additions
and
1,827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ APP_BASE_URL="localhost:3000" | |
|
||
# Mailer Configuration | ||
EMAIL_DELIVERY_METHOD='letter_opener' | ||
MAILER_SENDER="info@miru.saeloun.com" | ||
DEFAULT_MAILER_SENDER="info@miru.so" | ||
REPLY_TO_EMAIL="[email protected]" | ||
|
||
# SendGrid Email Configuration | ||
|
@@ -55,4 +55,4 @@ DB_USER= | |
DB_PASS= | ||
|
||
# Cable | ||
WEBSOCKET_URL="ws://localhost:3000/cable" | ||
WEBSOCKET_URL="ws://localhost:3000/cable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.2.0 | ||
3.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#syntax=docker/dockerfile:1 | ||
FROM ruby:3.2.0-slim AS base | ||
FROM ruby:3.2.1-slim AS base | ||
|
||
ARG NODE_VERSION=16.4.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#syntax=docker/dockerfile:1 | ||
FROM ruby:3.2.0-slim AS base | ||
FROM ruby:3.2.1-slim AS base | ||
|
||
ARG NODE_VERSION=16.4.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
class InternalApi::V1::ExpensesController < ApplicationController | ||
before_action :set_expense, only: :show | ||
|
||
def index | ||
authorize Expense | ||
|
||
expenses = Expenses::FetchService.new(current_company, params).process | ||
|
||
render :index, locals: expenses | ||
end | ||
|
||
def create | ||
authorize Expense | ||
|
||
expense = current_company.expenses.create!(expense_params) | ||
|
||
render :create, locals: { | ||
expense: Expense::ShowPresenter.new(expense).process | ||
} | ||
end | ||
|
||
def show | ||
authorize @expense | ||
|
||
render :show, locals: { expense: Expense::ShowPresenter.new(@expense).process } | ||
end | ||
|
||
private | ||
|
||
def expense_params | ||
params.require(:expense).permit( | ||
:amount, :date, :description, :expense_type, :expense_category_id, :vendor_id, :receipts | ||
) | ||
end | ||
|
||
def set_expense | ||
@expense = Expense.find(params[:id]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/controllers/internal_api/v1/users/confirmations_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
class InternalApi::V1::Users::ConfirmationsController < Devise::ConfirmationsController | ||
respond_to :json | ||
|
||
def create | ||
self.resource = resource_class.send_confirmation_instructions(resource_params) | ||
if successfully_sent?(resource) | ||
render json: { notice: I18n.t("confirmation.send_instructions", email: resource.email) }, status: :ok | ||
else | ||
respond_with_error(resource) | ||
end | ||
end | ||
|
||
private | ||
|
||
def respond_with_error(resource) | ||
if resource.errors.any? | ||
resource.errors.full_messages.each do |message| | ||
render json: { error: message }, status: :unprocessable_entity | ||
end | ||
end | ||
end | ||
end |
37 changes: 37 additions & 0 deletions
37
app/controllers/internal_api/v1/users/passwords_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
class InternalApi::V1::Users::PasswordsController < Devise::PasswordsController | ||
respond_to :json | ||
|
||
def create | ||
self.resource = resource_class.send_reset_password_instructions(resource_params) | ||
if successfully_sent?(resource) | ||
render json: { notice: I18n.t("password.create.success") }, status: :ok | ||
else | ||
respond_with_error(resource) | ||
end | ||
end | ||
|
||
def update | ||
user = User.reset_password_by_token(password_params) | ||
if user.errors.empty? | ||
render json: { notice: I18n.t("password.update.success") }, status: :ok | ||
else | ||
respond_with_error(user) | ||
end | ||
end | ||
|
||
private | ||
|
||
def password_params | ||
params.require(:user).permit(:reset_password_token, :password, :password_confirmation) | ||
end | ||
|
||
def respond_with_error(resource) | ||
if resource.errors.any? | ||
resource.errors.full_messages.each do |message| | ||
render json: { error: message }, status: :unprocessable_entity | ||
end | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
app/controllers/internal_api/v1/users/registrations_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
class InternalApi::V1::Users::RegistrationsController < Devise::RegistrationsController | ||
respond_to :json | ||
|
||
def respond_with(user, _opts = {}) | ||
if user.errors.present? | ||
render json: { error: user.errors }, status: :unprocessable_entity | ||
else | ||
render json: { notice: I18n.t("devise.registrations.signed_up") }, status: :ok | ||
end | ||
end | ||
end |
Oops, something went wrong.