Skip to content

Commit

Permalink
last factures endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine2116 committed Nov 17, 2023
1 parent cfae2d1 commit 55e5f7b
Show file tree
Hide file tree
Showing 15 changed files with 2,309 additions and 210 deletions.
16 changes: 0 additions & 16 deletions choruspro.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,3 @@ func getOAuthToken(clientId, clientSecret string, authUrl *url.URL) (*oauth2.Tok

return tok, nil
}

// Bool is a helper routine that allocates a new bool value
// to store v and returns a pointer to it.
func Bool(v bool) *bool { return &v }

// Int is a helper routine that allocates a new int value
// to store v and returns a pointer to it.
func Int(v int) *int { return &v }

// Int64 is a helper routine that allocates a new int64 value
// to store v and returns a pointer to it.
func Int64(v int64) *int64 { return &v }

// String is a helper routine that allocates a new string value
// to store v and returns a pointer to it.
func String(v string) *string { return &v }
7 changes: 4 additions & 3 deletions choruspro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ const (
)

var (
defaultDate = time.Date(2023, 01, 01, 0, 0, 0, 0, time.UTC)
defaultDateStr = `"2023-01-01"`
defaultDateTimeStr = `"2023-01-01T00:00:00Z"`
defaultDate = time.Date(2023, 01, 01, 0, 0, 0, 0, time.UTC)
defaultDateStr = `"2023-01-01"`
defaultISODateTimeStr = `"2023-01-01T00:00:00Z"`
defaultDateTimeStr = `"2023-01-01 00:00"`
)

func setup() (client *Client, mux *http.ServeMux, teardown func()) {
Expand Down
10 changes: 10 additions & 0 deletions date.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ func (t *Date) UnmarshalJSON(data []byte) error {
t.Time, err = time.Parse("\"2006-01-02\"", string(data))
return err
}

type Datetime struct {
time.Time
}

func (t *Datetime) UnmarshalJSON(data []byte) error {
var err error
t.Time, err = time.Parse("\"2006-01-02 15:04\"", string(data))
return err
}
21 changes: 21 additions & 0 deletions factures.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,24 @@ const (
TypeFactureAvoir TypeFacture = "AVOIR"
TypeFactureAcompte TypeFacture = "ACOMPTE"
)

type TypeTva string

const (
TypeTvaSurDebit TypeTva = "TVA_SUR_DEBIT"
TypeTvaSurEncaissement TypeTva = "TVA_SUR_ENCAISSEMENT"
TypeTvaExoneration TypeTva = "EXONERATION"
TypeTvaSansTva TypeTva = "SANS_TVA"
)

type TypeIdentifiant string

const (
TypeIdentifiantSiret TypeIdentifiant = "SIRET"
TypeIdentifiantUEHorsFrance TypeIdentifiant = "UE_HORS_FRANCE"
TypeIdentifiantHorsUE TypeIdentifiant = "HORS_UE"
TypeIdentifiantRidet TypeIdentifiant = "RIDET"
TypeIdentifiantTahiti TypeIdentifiant = "TAHITI"
TypeIdentifiantAutre TypeIdentifiant = "AUTRE"
TypeIdentifiantParticulier TypeIdentifiant = "PARTICULIER"
)
276 changes: 206 additions & 70 deletions factures_consultations.go

Large diffs are not rendered by default.

0 comments on commit 55e5f7b

Please sign in to comment.