- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
[Components] OnlineCheckWriter: New action components #14119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            jcortes
  merged 1 commit into
  PipedreamHQ:master
from
jcortes:onlinecheckwriter-new-action-components
  
      
      
   
  Sep 30, 2024 
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
        
          
          
            134 changes: 134 additions & 0 deletions
          
          134 
        
  components/onlinecheckwriter/actions/create-check/create-check.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,134 @@ | ||
| import app from "../../onlinecheckwriter.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "onlinecheckwriter-create-check", | ||
| name: "Create Check", | ||
| description: "Creates a new check. [See the documentation](https://apiv3.onlinecheckwriter.com/#211cb6e4-bda7-46de-9e84-a5e8b2709206)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| bankAccountId: { | ||
| propDefinition: [ | ||
| app, | ||
| "bankAccountId", | ||
| ], | ||
| }, | ||
| payeeId: { | ||
| propDefinition: [ | ||
| app, | ||
| "payeeId", | ||
| ], | ||
| }, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| app, | ||
| "categoryId", | ||
| ], | ||
| }, | ||
| issueDate: { | ||
| propDefinition: [ | ||
| app, | ||
| "issueDate", | ||
| ], | ||
| }, | ||
| amount: { | ||
| propDefinition: [ | ||
| app, | ||
| "amount", | ||
| ], | ||
| }, | ||
| memo: { | ||
| propDefinition: [ | ||
| app, | ||
| "memo", | ||
| ], | ||
| }, | ||
| note: { | ||
| propDefinition: [ | ||
| app, | ||
| "note", | ||
| ], | ||
| }, | ||
| invoiceNumber: { | ||
| propDefinition: [ | ||
| app, | ||
| "invoiceNumber", | ||
| ], | ||
| }, | ||
| noSign: { | ||
| propDefinition: [ | ||
| app, | ||
| "noSign", | ||
| ], | ||
| }, | ||
| noAmount: { | ||
| propDefinition: [ | ||
| app, | ||
| "noAmount", | ||
| ], | ||
| }, | ||
| noDate: { | ||
| propDefinition: [ | ||
| app, | ||
| "noDate", | ||
| ], | ||
| }, | ||
| noPayee: { | ||
| propDefinition: [ | ||
| app, | ||
| "noPayee", | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| createChecks(args = {}) { | ||
| return this.app.post({ | ||
| path: "/checks", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| createChecks, | ||
| bankAccountId, | ||
| payeeId, | ||
| categoryId, | ||
| issueDate, | ||
| amount, | ||
| memo, | ||
| note, | ||
| invoiceNumber, | ||
| noSign, | ||
| noAmount, | ||
| noDate, | ||
| noPayee, | ||
| } = this; | ||
|  | ||
| const response = await createChecks({ | ||
| $, | ||
| data: { | ||
| checks: [ | ||
| { | ||
| bankAccountId, | ||
| payeeId, | ||
| categoryId, | ||
| issueDate, | ||
| amount, | ||
| memo, | ||
| note, | ||
| invoiceNumber, | ||
| noSign, | ||
| noAmount, | ||
| noDate, | ||
| noPayee, | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
|  | ||
| $.export("$summary", `Successfully created a new check with ID \`${response.data.checks[0].checkId}\`.`); | ||
| return response; | ||
| }, | ||
| }; | 
        
          
          
            82 changes: 82 additions & 0 deletions
          
          82 
        
  components/onlinecheckwriter/actions/create-email-check/create-email-check.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,82 @@ | ||
| import app from "../../onlinecheckwriter.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "onlinecheckwriter-create-email-check", | ||
| name: "Create Email Check", | ||
| description: "Create an email check for a payee. [See the documentation](https://apiv3.onlinecheckwriter.com/#211cb6e4-bda7-46de-9e84-a5e8b2709206).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| checkId: { | ||
| propDefinition: [ | ||
| app, | ||
| "checkId", | ||
| ], | ||
| }, | ||
| payeeEmail: { | ||
| optional: false, | ||
| propDefinition: [ | ||
| app, | ||
| "payeeEmail", | ||
| ], | ||
| }, | ||
| enableSmsInform: { | ||
| propDefinition: [ | ||
| app, | ||
| "enableSmsInform", | ||
| ], | ||
| }, | ||
| payeePhone: { | ||
| optional: false, | ||
| description: "Required if **Enable SMS Inform** is `true` and not exist any phone on associated payee,", | ||
| propDefinition: [ | ||
| app, | ||
| "payeePhone", | ||
| ], | ||
| }, | ||
| sendAttachment: { | ||
| type: "boolean", | ||
| label: "Send Attachment", | ||
| description: "This will send added attachments along with the check.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| methods: { | ||
| createEmailChecks(args = {}) { | ||
| return this.app.post({ | ||
| path: "/emailchecks", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| createEmailChecks, | ||
| checkId, | ||
| payeeEmail, | ||
| enableSmsInform, | ||
| payeePhone, | ||
| sendAttachment, | ||
| } = this; | ||
|  | ||
| const response = await createEmailChecks({ | ||
| $, | ||
| data: { | ||
| emailChecks: [ | ||
| { | ||
| checkId, | ||
| payeeEmail, | ||
| enableSmsInform, | ||
| payeePhone, | ||
| ...(sendAttachment !== undefined && { | ||
| sendAttachment: +sendAttachment, | ||
| }), | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully created email checks."); | ||
| return response; | ||
| }, | ||
| }; | ||
        
          
          
            145 changes: 145 additions & 0 deletions
          
          145 
        
  components/onlinecheckwriter/actions/create-mail-check/create-mail-check.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,145 @@ | ||
| import app from "../../onlinecheckwriter.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "onlinecheckwriter-create-mail-check", | ||
| name: "Create Mail Check", | ||
| description: "Creates a mail check. [See the documentation](https://apiv3.onlinecheckwriter.com/#f4562b65-70e8-4c4d-8444-8898e61ab7f0).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| isShippingToCustomAddress: { | ||
| type: "boolean", | ||
| label: "Shipping To Custom Address?", | ||
| description: "Value is `true` if sending mail to custom address. Default `false`", | ||
| optional: true, | ||
| }, | ||
| customFromAddressId: { | ||
| description: "Must be a custom from address ID. Required if **Shipping To Custom Address?** is `true`.", | ||
| propDefinition: [ | ||
| app, | ||
| "customFromAddressId", | ||
| ], | ||
| }, | ||
| customToAddressId: { | ||
| description: "Must be a custom to address ID. Required if **Shipping To Custom Address?** is `true`.", | ||
| propDefinition: [ | ||
| app, | ||
| "customToAddressId", | ||
| ], | ||
| }, | ||
| customShippingTypeId: { | ||
| label: "Custom Shipping Type ID", | ||
| description: "Must be a valid custom shipping type ID. Required if **Shipping To Custom Address?** is `true`.", | ||
| propDefinition: [ | ||
| app, | ||
| "shippingTypeId", | ||
| ], | ||
| }, | ||
| checkId: { | ||
| propDefinition: [ | ||
| app, | ||
| "checkId", | ||
| ], | ||
| }, | ||
| shippingTypeId: { | ||
| optional: false, | ||
| description: "The shipping type ID of the check.", | ||
| propDefinition: [ | ||
| app, | ||
| "shippingTypeId", | ||
| ], | ||
| }, | ||
| paperTypeId: { | ||
| propDefinition: [ | ||
| app, | ||
| "paperTypeId", | ||
| ], | ||
| }, | ||
| informTypeId: { | ||
| propDefinition: [ | ||
| app, | ||
| "informTypeId", | ||
| ], | ||
| }, | ||
| enableSmsInform: { | ||
| propDefinition: [ | ||
| app, | ||
| "enableSmsInform", | ||
| ], | ||
| }, | ||
| enableEmailInform: { | ||
| type: "boolean", | ||
| label: "Enable Email Inform", | ||
| description: "Value is `true` if email inform is enabled. Default `false`.", | ||
| optional: true, | ||
| }, | ||
| payeeEmail: { | ||
| description: "Required if **Enable Email Inform** is `true` and there is no email on the associated payee.", | ||
| propDefinition: [ | ||
| app, | ||
| "payeeEmail", | ||
| ], | ||
| }, | ||
| payeePhone: { | ||
| description: "Required if **Enable SMS Inform** is `true` and there is no phone on the associated payee.", | ||
| propDefinition: [ | ||
| app, | ||
| "payeePhone", | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| createMailChecks(args = {}) { | ||
| return this.app.post({ | ||
| path: "/mailchecks", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| createMailChecks, | ||
| isShippingToCustomAddress, | ||
| customFromAddressId, | ||
| customToAddressId, | ||
| customShippingTypeId, | ||
| checkId, | ||
| shippingTypeId, | ||
| paperTypeId, | ||
| informTypeId, | ||
| enableSmsInform, | ||
| enableEmailInform, | ||
| payeeEmail, | ||
| payeePhone, | ||
| } = this; | ||
|         
                  jcortes marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
|  | ||
| const response = await createMailChecks({ | ||
| $, | ||
| data: { | ||
| isShippingToCustomAddress, | ||
| customFromAddressId, | ||
| customToAddressId, | ||
| customShippingTypeId, | ||
| mailChecks: [ | ||
| { | ||
| checkId, | ||
| shippingTypeId, | ||
| paperTypeId, | ||
| informTypeId, | ||
| ...(enableSmsInform !== undefined && { | ||
| enableSmsInform: +enableSmsInform, | ||
| }), | ||
| ...(enableEmailInform !== undefined && { | ||
| enableEmailInform: +enableEmailInform, | ||
| }), | ||
| payeeEmail, | ||
| payeePhone, | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully created and mailed checks."); | ||
| return response; | ||
| }, | ||
| }; | ||
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.