Coder Social home page Coder Social logo

plannabel / plb-5ws-calc Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 70 KB

Calculates key dates for your wedding (UK and NI), and is is part of Plannabel's 'Five Ws For Your Wedding' web app.

License: GNU General Public License v3.0

JavaScript 100.00%
weddings javascript dates

plb-5ws-calc's Introduction

Plannabel · PLB-5Ws-CALC

This microservice calculates key dates for your wedding (UK and NI), and is is part of Plannabel's 'Five Ws For Your Wedding' web app at https://www.plannabel.com/5Ws

It's built with:

Run

  • Development: npm run dev starts micro-dev, "a belt full of tools that make building microservices using micro a breeze! It's only meant to be used in development, not in production".
  • Production: npm start starts micro on default port 3000 (other deployment & port options).

Try it

dev mode: micro-dev running on localhost:3000

Send an HTTP POST request with a JSON document... here's an example using curl to make the request:

curl -H "Content-Type: application/json" -X POST -d '{
    "couple": {
        "PersonA": {
            "gender": "M",
            "aged16to17": false,
            "citizen": "EU-EEA"
        },
        "PersonB": {
            "gender": "F",
            "aged16to17": true,
            "citizen": "UK"
        }
    },
    "wedding": {
        "date": "2019-06-05T23:00:00.000Z",
        "jurisdiction": "NI",
        "marriagePlace": "NI",
        "type": "Civil-Marriage,Faith-NonReg-Hindu"
    }
}' localhost:3000

Result:

{
  couple: {
    sameSex: false,
    under18: true,
    citizenBothSame: false,
    citizenOneIsUK: true,
    citizenOneIsEUEEA: true,
    citizenOneIsOther: false
  },
  jurisdictions: {
    residentCountry: "NI",
    marriageCountry: "NI",
    countryEnglandWales: false,
    countrySCO: false,
    countryNI: true
  },
  wedding: {
    type: "Civil-Marriage,Faith-NonReg-Hindu",
    isFaith: true,
    isFaithNonReg: true,
    isAnglican: false,
    isCatholic: false,
    isJewish: false,
    isMuslim: false
  },
  dates: {
    noticePeriod: [28, "days"],
    registerOpens: [12, "months"],
    dateToday: "2017-10-11T23:00:00.000Z",
    weddingDate: "2019-06-05T23:00:00.000Z",
    earliestDateCanMarry: "2017-11-09T00:00:00.000Z",
    dateRegisterFrom: "2018-06-05T23:00:00.000Z",
    dateRegisterByLatest: "2019-05-08T23:00:00.000Z",
    weddingCountdown: "1 year, 7 months and 25 days",
    sleepsToWeddingDay: 601
  }
}

JSON request specification:

{
  "couple": {
      "PersonA": {
          "gender": "M" | "F",
          "age": "18plus" | "16to17",
          "citizen": "UK" | "EU-EEA" | "Other" 
      },
      "PersonB": {
          "gender": "M" | "F",
          "age": "18plus" | "16to17",
          "citizen": "UK" | "EU-EEA" | "Other"
      }
  },
  "wedding": {
    "date": ISO_DATE_STRING,
    "jurisdiction": "EnglandWales" | "Scotland" | "NI" | "Abroad",
    "marriagePlace": "EnglandWales" | "Scotland" | "NI" | "Abroad",
    "type": "Civil-Marriage"?, "Faith-Anglican"?, "Faith-NonReg-Catholic"?,
             "Faith-ChurchofWales"?, "Faith-NonReg-ChurchofScotland"?,
             "Faith-CoI"?, "Faith-Methodist"?, "Faith-Presbyterian"?, 
             "Civil-Partnership"?, "Faith-Quaker"?, "Faith-NonReg-Hindu"?
             "Faith-Jewish"?, "Faith-NonReg-Muslim"?
  }
}

plb-5ws-calc's People

Contributors

ajaykurien avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.