switchboard-contract 1.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +31 -0
  4. data/Rakefile +3 -0
  5. data/contracts/3/compiled/advice_session.avpr +190 -0
  6. data/contracts/3/compiled/advice_session_image.avpr +36 -0
  7. data/contracts/3/compiled/advice_session_review.avpr +90 -0
  8. data/contracts/3/compiled/advisor.avpr +77 -0
  9. data/contracts/3/compiled/advisor_config.avpr +38 -0
  10. data/contracts/3/compiled/lawyer.avpr +83 -0
  11. data/contracts/3/compiled/location.avpr +128 -0
  12. data/contracts/3/compiled/offer.avpr +111 -0
  13. data/contracts/3/compiled/package.avpr +85 -0
  14. data/contracts/3/compiled/package_detail.avpr +100 -0
  15. data/contracts/3/compiled/provider_offer.avpr +144 -0
  16. data/contracts/3/compiled/specialty.avpr +61 -0
  17. data/contracts/3/compiled/user.avpr +50 -0
  18. data/contracts/3/compiled/user_authentication.avpr +111 -0
  19. data/contracts/3/source/advice_session.avdl +72 -0
  20. data/contracts/3/source/advice_session_image.avdl +16 -0
  21. data/contracts/3/source/advice_session_review.avdl +40 -0
  22. data/contracts/3/source/advisor.avdl +30 -0
  23. data/contracts/3/source/advisor_config.avdl +17 -0
  24. data/contracts/3/source/common.inc +20 -0
  25. data/contracts/3/source/lawyer.avdl +45 -0
  26. data/contracts/3/source/location.avdl +76 -0
  27. data/contracts/3/source/offer.avdl +51 -0
  28. data/contracts/3/source/package.avdl +36 -0
  29. data/contracts/3/source/package_detail.avdl +41 -0
  30. data/contracts/3/source/provider_offer.avdl +38 -0
  31. data/contracts/3/source/specialty.avdl +33 -0
  32. data/contracts/3/source/user.avdl +12 -0
  33. data/contracts/3/source/user_authentication.avdl +57 -0
  34. data/contracts/4/compiled/lawyer.avpr +127 -0
  35. data/contracts/4/compiled/lawyer_address.avpr +54 -0
  36. data/contracts/4/compiled/review.avpr +44 -0
  37. data/contracts/4/compiled/specialty.avpr +43 -0
  38. data/contracts/4/source/lawyer.avdl +69 -0
  39. data/contracts/4/source/lawyer_address.avdl +31 -0
  40. data/contracts/4/source/review.avdl +28 -0
  41. data/contracts/4/source/specialty.avdl +23 -0
  42. data/contracts/messaging/compiled/access_token.avpr +41 -0
  43. data/contracts/messaging/compiled/channel.avpr +111 -0
  44. data/contracts/messaging/source/access_token.avdl +21 -0
  45. data/contracts/messaging/source/channel.avdl +59 -0
  46. data/contracts/mobile/compiled/advice_session.avpr +160 -0
  47. data/contracts/mobile/compiled/checkout.avpr +115 -0
  48. data/contracts/mobile/compiled/lawyer.avpr +787 -0
  49. data/contracts/mobile/compiled/offer.avpr +111 -0
  50. data/contracts/mobile/compiled/package.avpr +85 -0
  51. data/contracts/mobile/compiled/package_detail.avpr +100 -0
  52. data/contracts/mobile/compiled/package_slug.avpr +67 -0
  53. data/contracts/mobile/compiled/promotion.avpr +45 -0
  54. data/contracts/mobile/compiled/provider_offer.avpr +144 -0
  55. data/contracts/mobile/compiled/review.avpr +83 -0
  56. data/contracts/mobile/compiled/specialty.avpr +55 -0
  57. data/contracts/mobile/source/advice_session.avdl +61 -0
  58. data/contracts/mobile/source/checkout.avdl +90 -0
  59. data/contracts/mobile/source/lawyer.avdl +321 -0
  60. data/contracts/mobile/source/offer.avdl +51 -0
  61. data/contracts/mobile/source/package.avdl +36 -0
  62. data/contracts/mobile/source/package_detail.avdl +41 -0
  63. data/contracts/mobile/source/package_slug.avdl +30 -0
  64. data/contracts/mobile/source/promotion.avdl +18 -0
  65. data/contracts/mobile/source/provider_offer.avdl +38 -0
  66. data/contracts/mobile/source/review.avdl +43 -0
  67. data/contracts/mobile/source/specialty.avdl +32 -0
  68. data/contracts/sales_force/compiled/account.avpr +94 -0
  69. data/contracts/sales_force/compiled/account_professional.avpr +39 -0
  70. data/contracts/sales_force/source/account.avdl +50 -0
  71. data/contracts/sales_force/source/account_professional.avdl +14 -0
  72. data/contracts/verify/compiled/lawyer.avpr +79 -0
  73. data/contracts/verify/compiled/license.avpr +64 -0
  74. data/contracts/verify/source/lawyer.avdl +41 -0
  75. data/contracts/verify/source/license.avdl +36 -0
  76. data/lib/switchboard/contract.rb +8 -0
  77. data/lib/switchboard/contract/documentation.rb +7 -0
  78. data/lib/switchboard/contract/service.rb +15 -0
  79. data/lib/switchboard/contract/version.rb +5 -0
  80. metadata +164 -0
@@ -0,0 +1,51 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Offer {
4
+
5
+ record Package {
6
+ /** The primary key */
7
+ int id;
8
+ string name;
9
+ string short_description;
10
+ boolean call;
11
+ int call_duration_in_minutes;
12
+ boolean document;
13
+ int max_document_length_in_pages;
14
+ boolean claim_game;
15
+ boolean offline;
16
+ int specialty_id;
17
+ string micro_description;
18
+ }
19
+
20
+ /** The main class for this protocol */
21
+ record Offer {
22
+ /** The primary key */
23
+ int id;
24
+ int state_id;
25
+ int consumer_fee_in_cents;
26
+ Package package;
27
+ }
28
+
29
+ record OfferFetchOption {
30
+ /** Which page of records to fetch */
31
+ int page = 1;
32
+
33
+ /** How many records per page */
34
+ int per_page = 10;
35
+
36
+ /** The ID of the package this offer is associated with. */
37
+ int package_id;
38
+
39
+ /** Enabled meaning it is available for the public to purchase. */
40
+ boolean enabled;
41
+
42
+ /** The name of the package this offer is associated with. */
43
+ string name;
44
+ }
45
+
46
+ /** Returns a list of Offers */
47
+ array<Offer> index(OfferFetchOption options);
48
+
49
+ /** Return a single Offer */
50
+ array<Offer> show(int id);
51
+ }
@@ -0,0 +1,36 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Package {
4
+
5
+ /** The main class for this protocol */
6
+ record Package {
7
+ /** The primary key */
8
+ int id;
9
+ string name;
10
+ string short_description;
11
+ boolean call;
12
+ int call_duration_in_minutes;
13
+ boolean document;
14
+ int max_document_length_in_pages;
15
+ boolean claim_game;
16
+ boolean offline;
17
+ int specialty_id;
18
+ string micro_description;
19
+ }
20
+
21
+ record PackageFetchOption {
22
+ /** Which page of records to fetch */
23
+ int page = 1;
24
+
25
+ /** How many records per page */
26
+ int per_page = 10;
27
+
28
+ int specialty_id;
29
+ }
30
+
31
+ /** Returns a list of Packages */
32
+ array<Package> index(PackageFetchOption options);
33
+
34
+ /** Return a single Package */
35
+ array<Package> show(int id);
36
+ }
@@ -0,0 +1,41 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol PackageDetail {
4
+
5
+ /** The main class for this protocol */
6
+ record Package {
7
+ /** The primary key */
8
+ int id;
9
+ string name;
10
+ string short_description;
11
+ boolean call;
12
+ int call_duration_in_minutes;
13
+ boolean document;
14
+ int max_document_length_in_pages;
15
+ boolean claim_game;
16
+ boolean offline;
17
+ int specialty_id;
18
+ string how_it_works;
19
+ string whats_included;
20
+ string whats_not_included;
21
+ string micro_description;
22
+ string right_for_you_if;
23
+ string hero_image_url;
24
+ }
25
+
26
+ record PackageFetchOption {
27
+ /** Which page of records to fetch */
28
+ int page = 1;
29
+
30
+ /** How many records per page */
31
+ int per_page = 10;
32
+
33
+ int specialty_id;
34
+ }
35
+
36
+ /** Returns a list of Packages */
37
+ array<Package> index(PackageFetchOption options);
38
+
39
+ /** Return a single Package */
40
+ array<Package> show(int id);
41
+ }
@@ -0,0 +1,30 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol PackageSlug {
4
+
5
+ /** The main class for this protocol */
6
+ record PackageSlug {
7
+ /** The primary key */
8
+ int id;
9
+ int specialty_id;
10
+ string name;
11
+ string slug;
12
+ }
13
+
14
+ record PackageFetchOption {
15
+ /** Which page of records to fetch */
16
+ int page = 1;
17
+
18
+ /** How many records per page */
19
+ int per_page = 10;
20
+
21
+ int specialty_id;
22
+ boolean advisor;
23
+ }
24
+
25
+ /** Returns a list of PackageSlugs */
26
+ array<PackageSlug> index(PackageFetchOption options);
27
+
28
+ /** Return a single PackageSlug */
29
+ array<PackageSlug> show(int id);
30
+ }
@@ -0,0 +1,18 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Promotion {
4
+
5
+ record Promotion {
6
+ int discount_amount_in_cents;
7
+ int new_total_price_in_cents;
8
+ }
9
+
10
+ record PromotionFetchOption {
11
+ int page = 1;
12
+ int per_page = 10;
13
+ int offer_id;
14
+ string short_code;
15
+ }
16
+
17
+ array<Promotion> index(PromotionFetchOption options);
18
+ }
@@ -0,0 +1,38 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol ProviderOffer {
4
+ import protocol "../compiled/package.avpr";
5
+
6
+ /** The main class for this protocol */
7
+ record ProviderOffer {
8
+ /** The primary key */
9
+ int id;
10
+ int state_id;
11
+ int lawyer_id;
12
+ int provider_id;
13
+ int offer_id;
14
+ int consumer_fee_in_cents;
15
+ boolean available;
16
+ Package package;
17
+ }
18
+
19
+ record ProviderOfferFetchOption {
20
+ /** Which page of records to fetch */
21
+ int page = 1;
22
+
23
+ /** How many records per page */
24
+ int per_page = 10;
25
+
26
+ int provider_id;
27
+ int offer_id;
28
+ int state_id;
29
+ int specialty_id;
30
+ boolean available;
31
+ }
32
+
33
+ /** Returns a list of ProviderOffers */
34
+ array<ProviderOffer> index(ProviderOfferFetchOption options);
35
+
36
+ /** Return a single ProviderOffer */
37
+ array<ProviderOffer> show(int id);
38
+ }
@@ -0,0 +1,43 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Review {
4
+
5
+ /** Each individual rating type */
6
+ record ReviewRatings {
7
+ int overall;
8
+ int trustworthy;
9
+ int responsive;
10
+ int knowledgeable;
11
+ int communication;
12
+ }
13
+
14
+ /** The main class for this protocol */
15
+ record Review {
16
+ /** The primary key */
17
+ int id;
18
+
19
+ /** The lawyer's id */
20
+ int lawyer_id;
21
+
22
+ /** Title of the Review */
23
+ string title;
24
+
25
+ /** The body text of the review */
26
+ string body;
27
+
28
+ boolean recommended;
29
+ int specialty_id;
30
+ boolean anonymous;
31
+ int approval_status;
32
+ string display_name;
33
+ int created_at;
34
+ int updated_at;
35
+
36
+ string cache_key;
37
+
38
+ ReviewRatings ratings;
39
+ }
40
+
41
+ /** Look up many reviews in bulk */
42
+ array<Review> index();
43
+ }
@@ -0,0 +1,32 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Specialty {
4
+
5
+ /** The main class for this protocol */
6
+ record Specialty {
7
+ /** The primary key */
8
+ int id;
9
+
10
+ /** Name of the specialty */
11
+ string name;
12
+
13
+ /** Pretty name for SEO */
14
+ string seo_name;
15
+
16
+ /** What you would call an attorny practicing in this area (i.e. Bankruptcy Attorney) */
17
+ string title;
18
+
19
+ /** Blurb about what this specialty is about */
20
+ string description;
21
+
22
+ /** Pretty slug for use in the URLs */
23
+ string slug;
24
+ }
25
+
26
+ /** Look up many specialties in bulk */
27
+ array<Specialty> index();
28
+
29
+ /** Look up a specialty by id */
30
+ array<Specialty> show(int id);
31
+
32
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "protocol" : "Account",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "AccountAddress",
7
+ "fields" : [ {
8
+ "name" : "address_line1",
9
+ "type" : "string"
10
+ }, {
11
+ "name" : "address_line2",
12
+ "type" : [ "null", "string" ]
13
+ }, {
14
+ "name" : "city",
15
+ "type" : "string"
16
+ }, {
17
+ "name" : "county",
18
+ "type" : [ "null", "string" ]
19
+ }, {
20
+ "name" : "postal_code",
21
+ "type" : "string"
22
+ } ]
23
+ }, {
24
+ "type" : "record",
25
+ "name" : "UpsertParams",
26
+ "fields" : [ {
27
+ "name" : "id",
28
+ "type" : "int",
29
+ "doc" : "Account id field in sales force"
30
+ }, {
31
+ "name" : "address",
32
+ "type" : "AccountAddress"
33
+ }, {
34
+ "name" : "contact_email",
35
+ "type" : "string"
36
+ }, {
37
+ "name" : "contact_name",
38
+ "type" : [ "null", "string" ]
39
+ }, {
40
+ "name" : "phone_number",
41
+ "type" : [ "null", "string" ]
42
+ } ]
43
+ }, {
44
+ "type" : "record",
45
+ "name" : "Account",
46
+ "doc" : "The main account record data type",
47
+ "fields" : [ {
48
+ "name" : "id",
49
+ "type" : "int",
50
+ "doc" : "Account id field in sales force"
51
+ }, {
52
+ "name" : "customer_id",
53
+ "type" : "int",
54
+ "doc" : "Avvo's internal customer id"
55
+ }, {
56
+ "name" : "address",
57
+ "type" : "AccountAddress"
58
+ }, {
59
+ "name" : "contact_email",
60
+ "type" : "string"
61
+ }, {
62
+ "name" : "contact_name",
63
+ "type" : [ "null", "string" ]
64
+ }, {
65
+ "name" : "phone_number",
66
+ "type" : [ "null", "string" ]
67
+ }, {
68
+ "name" : "start_date",
69
+ "type" : [ "null", "string" ],
70
+ "doc" : "Date of first invoice for the customer, YYYY-mm-dd"
71
+ } ]
72
+ }, {
73
+ "type" : "record",
74
+ "name" : "UpsertRequest",
75
+ "doc" : "REQUEST DATA TYPES",
76
+ "fields" : [ {
77
+ "name" : "account",
78
+ "type" : "UpsertParams"
79
+ } ]
80
+ } ],
81
+ "messages" : {
82
+ "update" : {
83
+ "doc" : "Procedures",
84
+ "request" : [ {
85
+ "name" : "params",
86
+ "type" : "UpsertParams"
87
+ } ],
88
+ "response" : {
89
+ "type" : "array",
90
+ "items" : "Account"
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "protocol" : "AccountProfessional",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "AccountProfessional",
7
+ "fields" : [ {
8
+ "name" : "account_id",
9
+ "type" : "string",
10
+ "doc" : "sales force account id (string uuid)"
11
+ }, {
12
+ "name" : "professional_id",
13
+ "type" : "int",
14
+ "doc" : "avvo account id"
15
+ } ]
16
+ } ],
17
+ "messages" : {
18
+ "create" : {
19
+ "request" : [ {
20
+ "name" : "params",
21
+ "type" : "AccountProfessional"
22
+ } ],
23
+ "response" : {
24
+ "type" : "array",
25
+ "items" : "AccountProfessional"
26
+ }
27
+ },
28
+ "destroy" : {
29
+ "request" : [ {
30
+ "name" : "params",
31
+ "type" : "AccountProfessional"
32
+ } ],
33
+ "response" : {
34
+ "type" : "array",
35
+ "items" : "AccountProfessional"
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,50 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Account {
4
+ record AccountAddress {
5
+ string address_line1;
6
+ union { null, string } address_line2;
7
+ string city;
8
+ union { null, string } county;
9
+ string postal_code;
10
+ }
11
+
12
+ record UpsertParams {
13
+ /** Account id field in sales force */
14
+ int id;
15
+
16
+ AccountAddress address;
17
+ string contact_email;
18
+ union { null, string } contact_name;
19
+ union { null, string } phone_number;
20
+ }
21
+
22
+ /** The main account record data type */
23
+ record Account {
24
+ /** Account id field in sales force */
25
+ int id;
26
+
27
+ /** Avvo's internal customer id */
28
+ int customer_id;
29
+
30
+ AccountAddress address;
31
+ string contact_email;
32
+ union { null, string } contact_name;
33
+ union { null, string } phone_number;
34
+
35
+ /** Date of first invoice for the customer, YYYY-mm-dd */
36
+ union { null, string } start_date;
37
+ }
38
+
39
+
40
+ /** REQUEST DATA TYPES */
41
+
42
+ record UpsertRequest {
43
+ UpsertParams account;
44
+ }
45
+
46
+
47
+ /** Procedures */
48
+
49
+ array<Account> update(UpsertParams params);
50
+ }